Admin Columns - Version 1.4.4

Version Description

  • added posts columns Last Modified and Comment count
  • added media columns for EXIF and IPTC image data
  • added custom fields columns to the Media Library
  • given column values it's own class
  • added bug fix for sorting bookmarks/links
  • added fix for possible php warning
Download this release

Release Info

Developer codepress
Plugin Icon 128x128 Admin Columns
Version 1.4.4
Comparing to
See all releases

Code changes from version 1.1.3 to 1.4.4

Files changed (50) hide show
  1. assets/css/admin-column.css +314 -20
  2. assets/css/column.css +38 -0
  3. assets/images/addon_sortable_1.png +0 -0
  4. assets/images/arrows.png +0 -0
  5. assets/images/comment_edit.png +0 -0
  6. assets/images/cross.png +0 -0
  7. assets/images/information.png +0 -0
  8. assets/images/loading.gif +0 -0
  9. assets/images/no.png +0 -0
  10. assets/images/reorder_arrow.png +0 -0
  11. assets/images/settings.png +0 -0
  12. assets/images/sort.png +0 -0
  13. assets/images/square.png +0 -0
  14. assets/images/trash.png +0 -0
  15. assets/js/admin-column.js +238 -6
  16. assets/js/jquery.qtip.js +19 -0
  17. assets/ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  18. assets/ui-theme/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  19. assets/ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  20. assets/ui-theme/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  21. assets/ui-theme/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  22. assets/ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  23. assets/ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  24. assets/ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  25. assets/ui-theme/images/ui-icons_222222_256x240.png +0 -0
  26. assets/ui-theme/images/ui-icons_2e83ff_256x240.png +0 -0
  27. assets/ui-theme/images/ui-icons_454545_256x240.png +0 -0
  28. assets/ui-theme/images/ui-icons_888888_256x240.png +0 -0
  29. assets/ui-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  30. assets/ui-theme/jquery-ui-1.8.18.custom.css +120 -0
  31. classes/sortable.php +1076 -0
  32. classes/values.php +529 -0
  33. classes/values/comments.php +139 -0
  34. classes/values/link.php +97 -0
  35. classes/values/media.php +170 -0
  36. classes/values/posts.php +231 -0
  37. classes/values/users.php +116 -0
  38. codepress-admin-columns.php +1501 -817
  39. languages/codepress-admin-columns-nl_NL.mo +0 -0
  40. languages/codepress-admin-columns-nl_NL.po +342 -125
  41. languages/codepress-admin-columns-pl_PL.mo +0 -0
  42. languages/codepress-admin-columns-pl_PL.po +530 -0
  43. readme.txt +161 -26
  44. screenshot-1.png +0 -0
  45. screenshot-2.png +0 -0
  46. screenshot-3.png +0 -0
  47. screenshot-4.png +0 -0
  48. screenshot-5.png +0 -0
  49. screenshot-6.png +0 -0
  50. screenshot-7.png +0 -0
assets/css/admin-column.css CHANGED
@@ -1,15 +1,58 @@
1
- #general-cpac-settings {}
 
 
2
  #cpac .postbox {
3
  margin: 0 10px 10px 0;
4
  }
5
  #cpac .cpac-menu {
6
  clear: both;
7
- float: left;
8
- width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/reorder.png') no-repeat scroll 0 0;
46
  margin-left: 5px;
47
  height: 23px;
48
- width: 171px;
 
 
 
 
 
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 #DFDFDF;
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;
@@ -110,6 +155,7 @@
110
  margin-right: 30px;
111
  overflow: hidden;
112
  height: 17px;
 
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
  }
@@ -207,8 +400,33 @@
207
  #restore-cpac-settings .inside .description {
208
  color: #832525;
209
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  #likethisplugin-cpac-settings {
211
- padding: 0 0 10px;
212
  }
213
  #likethisplugin-cpac-settings ul {
214
  margin-left: 20px;
@@ -221,9 +439,85 @@
221
  text-decoration: none;
222
  }
223
  #likethisplugin-cpac-settings li.donate_link a {
224
- color: green;
225
- text-decoration: underline;
226
  }
227
  #likethisplugin-cpac-settings li.donate_link a:hover {
228
  color: darkgreen;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  }
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;
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
  }
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;
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,42 @@
 
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
+ }
12
+ span.status-open {}
13
+ span.status-closed {
14
+ color: red;
15
+ }
16
+
17
+ /* =Comment Counts column
18
+ -------------------------------------------------------------- */
19
+ .column-comment-count a.post-com-count {
20
+ display: inline-block;
21
+ }
22
+ .column-comment-count .description a {
23
+ display: inline-block;
24
+ height: 16px;
25
+ line-height: 16px;
26
+ padding: 3px 5px 3px 22px;
27
+ margin: 0 4px 4px 0;
28
+ background: #e4e4e4;
29
+ border-radius: 3px;
30
+ }
31
+ .column-comment-count a.cp-approved {
32
+ background: #e4e4e4 url(../images/checkmark.png) no-repeat 3px 50%;
33
+ }
34
+ .column-comment-count a.cp-moderated {
35
+ background: #e4e4e4 url(../images/comment_edit.png) no-repeat 3px 50%;
36
+ }
37
+ .column-comment-count a.cp-spam {
38
+ background: #e4e4e4 url(../images/no.png) no-repeat 3px 50%;
39
+ }
40
+ .column-comment-count a.cp-trash {
41
+ background: #e4e4e4 url(../images/trash.png) no-repeat 3px 50%;
42
  }
assets/images/addon_sortable_1.png ADDED
Binary file
assets/images/arrows.png CHANGED
Binary file
assets/images/comment_edit.png ADDED
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/images/trash.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').find('.cpac-type-inside').slideToggle(150);
 
 
 
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,226 @@ 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
+ // loop through all width-range-sliders
287
+ jQuery('.input-width-range').each( function(){
288
+
289
+ var input = jQuery(this).closest('.cpac-type-inside').find('.input-width');
290
+ var descr = jQuery(this).closest('.cpac-type-inside').find('.width-decription');
291
+ var input_default = jQuery(input)[0].defaultValue;
292
+ var translation_default = descr.attr('title');
293
+
294
+ // add slider
295
+ jQuery(this).slider({
296
+ range: 'min',
297
+ value: 1,
298
+ min: 0,
299
+ max: 100,
300
+ value: input_default,
301
+ slide: function( event, ui ) {
302
+
303
+ // set default
304
+ var descr_value = ui.value > 0 ? ui.value + '%' : translation_default;
305
+
306
+ // set input value
307
+ jQuery(input).val( ui.value );
308
+
309
+ // set description
310
+ jQuery(descr).text( descr_value );
311
+ }
312
+ });
313
+ });
314
+ }
315
+
316
+ /**
317
+ * Addon actviate/deactivate
318
+ *
319
+ */
320
+ function cpac_addon_activation()
321
+ {
322
+ jQuery('#cpac-box-plugin_settings .addons .activation_code a.button').click(function(e) {
323
+ e.preventDefault();
324
+
325
+ // get input values
326
+ var row = jQuery(this).closest('tr');
327
+ var type = jQuery(row).attr('id').replace('cpac-activation-','');
328
+ var parent_class = jQuery(this).parent('div');
329
+ var msg = jQuery(row).find('.activation-error-msg');
330
+
331
+ // get translated string
332
+ var translations = jQuery('#cpac-box-plugin_settings .addon-translation-string');
333
+ var msg_fillin = jQuery('.tstring-fill-in',translations).text();
334
+ var msg_unrecognised = jQuery('.tstring-unrecognised',translations).text();
335
+
336
+ // reset
337
+ jQuery(msg).empty();
338
+
339
+ // Activate
340
+ if ( parent_class.hasClass('activate') ) {
341
+
342
+ // get input values
343
+ var input = jQuery('.activate input', row);
344
+ var button = jQuery('.activate .button', row);
345
+ var key = input.val();
346
+ var default_val = jQuery(input)[0].defaultValue;
347
+
348
+ // make sure the input value has changed
349
+ if ( key == default_val ) {
350
+ jQuery(msg).text(msg_fillin).hide().fadeIn();
351
+ return false;
352
+ }
353
+
354
+ // set loading icon
355
+ button.addClass('loading');
356
+
357
+ // update key
358
+ jQuery.ajax({
359
+ url : ajaxurl,
360
+ type : 'POST',
361
+ dataType : 'json',
362
+ data : {
363
+ action : 'cpac_addon_activation',
364
+ type : 'sortable',
365
+ key : key
366
+ },
367
+ success: function(data) {
368
+ if ( data != null ) {
369
+ jQuery('div.activate', row).hide(); // hide activation button
370
+ jQuery('div.deactivate', row).show(); // show deactivation button
371
+ jQuery('div.deactivate span.masked_key', row).text(data); // display the returned masked key
372
+ } else {
373
+ jQuery(msg).text(msg_unrecognised).hide().fadeIn();
374
+ }
375
+ },
376
+ error: function(xhr, ajaxOptions, thrownError) {
377
+ //console.log(xhr);
378
+ //console.log(ajaxOptions);
379
+ //console.log(thrownError);
380
+ jQuery(msg).text(msg_unrecognised).hide().fadeIn();
381
+ },
382
+ complete: function() {
383
+ button.removeClass('loading');
384
+ }
385
+ });
386
+ }
387
+
388
+ // Deactivate
389
+ if ( parent_class.hasClass('deactivate') ) {
390
+
391
+ var button = jQuery('.deactivate .button', row);
392
+ var input = jQuery('.activate input', row);
393
+
394
+ // set loading icon
395
+ button.addClass('loading');
396
+
397
+ // update key
398
+ jQuery.ajax({
399
+ url : ajaxurl,
400
+ type : 'POST',
401
+ dataType : 'json',
402
+ data : {
403
+ action : 'cpac_addon_activation',
404
+ type : 'sortable',
405
+ key : 'remove'
406
+ },
407
+ success: function(data) {
408
+ jQuery('div.activate', row).show(); // show activation button
409
+ jQuery('div.deactivate', row).hide(); // hide deactivation button
410
+ jQuery('div.deactivate span.masked_key', row).empty(); // remove masked key
411
+ input.val('');
412
+ },
413
+ error: function(xhr, ajaxOptions, thrownError) {
414
+ //console.log(xhr);
415
+ //console.log(ajaxOptions);
416
+ //console.log(thrownError);
417
+ },
418
+ complete: function() {
419
+ button.removeClass('loading');
420
+ }
421
+ });
422
+ }
423
+ });
424
  }
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,1076 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 = Codepress_Admin_Columns::get_post_types();
35
+ $this->show_all_results = false;
36
+
37
+ // init sorting
38
+ add_action( 'admin_init', array( $this, 'register_sortable_columns' ) );
39
+
40
+ // init filtering
41
+ // add_action( 'admin_init', array( $this, 'register_filtering_columns' ) );
42
+
43
+ // handle requests for sorting columns
44
+ add_filter( 'request', array( $this, 'handle_requests_orderby_column'), 1 );
45
+ add_action( 'pre_user_query', array( $this, 'handle_requests_orderby_users_column'), 1 );
46
+ add_action( 'admin_init', array( $this, 'handle_requests_orderby_links_column'), 1 );
47
+ add_action( 'admin_init', array( $this, 'handle_requests_orderby_comments_column'), 1 );
48
+ }
49
+
50
+ /**
51
+ * Register sortable columns
52
+ *
53
+ * Hooks into apply_filters( "manage_{$screen->id}_sortable_columns" ) which is found in class-wp-list-table.php
54
+ *
55
+ * @since 1.0
56
+ */
57
+ function register_sortable_columns()
58
+ {
59
+ if ( ! $this->unlocked )
60
+ return false;
61
+
62
+ /** Posts */
63
+ foreach ( $this->post_types as $post_type )
64
+ add_filter( "manage_edit-{$post_type}_sortable_columns", array($this, 'callback_add_sortable_posts_column'));
65
+
66
+ /** Users */
67
+ add_filter( "manage_users_sortable_columns", array($this, 'callback_add_sortable_users_column'));
68
+
69
+ /** Media */
70
+ add_filter( "manage_upload_sortable_columns", array($this, 'callback_add_sortable_media_column'));
71
+
72
+ /** Links */
73
+ add_filter( "manage_link-manager_sortable_columns", array($this, 'callback_add_sortable_links_column'));
74
+
75
+ /** Comments */
76
+ add_filter( "manage_edit-comments_sortable_columns", array($this, 'callback_add_sortable_comments_column'));
77
+ }
78
+
79
+ /**
80
+ * Callback add Posts sortable column
81
+ *
82
+ * @since 1.0
83
+ */
84
+ public function callback_add_sortable_posts_column($columns)
85
+ {
86
+ global $post_type;
87
+
88
+ return $this->add_managed_sortable_columns($post_type, $columns);
89
+ }
90
+
91
+ /**
92
+ * Callback add Users sortable column
93
+ *
94
+ * @since 1.1
95
+ */
96
+ public function callback_add_sortable_users_column($columns)
97
+ {
98
+ return $this->add_managed_sortable_columns('wp-users', $columns);
99
+ }
100
+
101
+ /**
102
+ * Callback add Media sortable column
103
+ *
104
+ * @since 1.3
105
+ */
106
+ public function callback_add_sortable_media_column($columns)
107
+ {
108
+ return $this->add_managed_sortable_columns('wp-media', $columns);
109
+ }
110
+
111
+ /**
112
+ * Callback add Links sortable column
113
+ *
114
+ * @since 1.3.1
115
+ */
116
+ public function callback_add_sortable_links_column($columns)
117
+ {
118
+ return $this->add_managed_sortable_columns('wp-links', $columns);
119
+ }
120
+
121
+ /**
122
+ * Callback add Comments sortable column
123
+ *
124
+ * @since 1.3.1
125
+ */
126
+ public function callback_add_sortable_comments_column($columns)
127
+ {
128
+ return $this->add_managed_sortable_columns('wp-comments', $columns);
129
+ }
130
+
131
+ /**
132
+ * Add managed sortable columns by Type
133
+ *
134
+ * @since 1.1
135
+ */
136
+ private function add_managed_sortable_columns( $type = 'post', $columns )
137
+ {
138
+ $display_columns = $this->get_merged_columns($type);
139
+
140
+ if ( ! $display_columns )
141
+ return $columns;
142
+
143
+ foreach ( $display_columns as $id => $vars ) {
144
+ if ( isset($vars['options']['sortorder']) && $vars['options']['sortorder'] == 'on' ){
145
+
146
+ // register format
147
+ $columns[$id] = $this->sanitize_string($vars['label']);
148
+ }
149
+ }
150
+
151
+ return $columns;
152
+ }
153
+
154
+ /**
155
+ * Admin requests for orderby column
156
+ *
157
+ * Only works for WP_Query objects ( such as posts and media )
158
+ *
159
+ * @since 1.0
160
+ */
161
+ public function handle_requests_orderby_column( $vars )
162
+ {
163
+ if ( ! isset( $vars['orderby'] ) )
164
+ return $vars;
165
+
166
+ /** Users */
167
+ // You would expect to see get_orderby_users_vars(), but sorting for
168
+ // users is handled through a different filter. Not 'request', but 'pre_user_query'.
169
+ // See handle_requests_orderby_users_column().
170
+
171
+ /** Media */
172
+ elseif ( $this->request_uri_is('upload') )
173
+ $vars = $this->get_orderby_media_vars($vars);
174
+
175
+ /** Posts */
176
+ elseif ( !empty($vars['post_type']) )
177
+ $vars = $this->get_orderby_posts_vars($vars);
178
+
179
+ return $vars;
180
+ }
181
+
182
+ /**
183
+ * Orderby Users column
184
+ *
185
+ * @since 1.3
186
+ */
187
+ public function handle_requests_orderby_users_column($user_query)
188
+ {
189
+ //print_r($user_query); exit;
190
+
191
+ // query vars
192
+ $vars = $user_query->query_vars;
193
+
194
+ // Column
195
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-users' );
196
+
197
+ if ( empty($column) )
198
+ return $vars;
199
+
200
+ // id
201
+ $id = key($column);
202
+
203
+ // type
204
+ $type = $id;
205
+
206
+ // Check for user custom fields: column-meta-[customfieldname]
207
+ if ( Codepress_Admin_Columns::is_column_meta($type) )
208
+ $type = 'column-user-meta';
209
+
210
+ // Check for post count: column-user_postcount-[posttype]
211
+ if ( $this->get_posttype_by_postcount_column($type) )
212
+ $type = 'column-user_postcount';
213
+
214
+ // var
215
+ $cusers = array();
216
+ switch( $type ) :
217
+
218
+ case 'column-user_id':
219
+ $user_query->query_orderby = "ORDER BY ID {$user_query->query_vars['order']}";
220
+ $user_query->query_vars['orderby'] = 'ID';
221
+ break;
222
+
223
+ case 'column-user_registered':
224
+ $user_query->query_orderby = "ORDER BY user_registered {$user_query->query_vars['order']}";
225
+ $user_query->query_vars['orderby'] = 'registered';
226
+ break;
227
+
228
+ case 'column-nickname' :
229
+ $sort_flag = SORT_REGULAR;
230
+ foreach ( $this->get_users_data() as $u ) {
231
+ if ($u->nickname || $this->show_all_results ) {
232
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->nickname);
233
+ }
234
+ }
235
+ break;
236
+
237
+ case 'column-first_name' :
238
+ $sort_flag = SORT_REGULAR;
239
+ foreach ( $this->get_users_data() as $u ) {
240
+ if ($u->first_name || $this->show_all_results ) {
241
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->first_name);
242
+ }
243
+ }
244
+ break;
245
+
246
+ case 'column-last_name' :
247
+ $sort_flag = SORT_REGULAR;
248
+ foreach ( $this->get_users_data() as $u ) {
249
+ if ($u->last_name || $this->show_all_results ) {
250
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->last_name);
251
+ }
252
+ }
253
+ break;
254
+
255
+ case 'column-user_url' :
256
+ $sort_flag = SORT_REGULAR;
257
+ foreach ( $this->get_users_data() as $u ) {
258
+ if ($u->user_url || $this->show_all_results ) {
259
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->user_url);
260
+ }
261
+ }
262
+ break;
263
+
264
+ case 'column-user_description' :
265
+ $sort_flag = SORT_REGULAR;
266
+ foreach ( $this->get_users_data() as $u ) {
267
+ if ($u->user_description || $this->show_all_results ) {
268
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->user_description);
269
+ }
270
+ }
271
+ break;
272
+
273
+ case 'column-user_postcount' :
274
+ $post_type = $this->get_posttype_by_postcount_column($id);
275
+ if ( $post_type ) {
276
+ $sort_flag = SORT_REGULAR;
277
+ foreach ( $this->get_users_data() as $u ) {
278
+ $count = $this->get_post_count( $post_type, $u->ID );
279
+ $cusers[$u->ID] = $this->prepare_sort_string_value($count);
280
+ }
281
+ }
282
+ break;
283
+
284
+ case 'role' :
285
+ $sort_flag = SORT_REGULAR;
286
+ foreach ( $this->get_users_data() as $u ) {
287
+ $role = !empty($u->roles[0]) ? $u->roles[0] : '';
288
+ if ($role || $this->show_all_results ) {
289
+ $cusers[$u->ID] = $this->prepare_sort_string_value($role);
290
+ }
291
+ }
292
+ break;
293
+
294
+ case 'column-user-meta' :
295
+ $field = $column[$id]['field'];
296
+ if ( $field ) {
297
+
298
+ // order numeric or string
299
+ $sort_flag = SORT_REGULAR;
300
+ if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' ) {
301
+ $sort_flag = SORT_NUMERIC;
302
+ }
303
+
304
+ // sort by metavalue
305
+ foreach ( $this->get_users_data() as $u ) {
306
+ $value = get_metadata('user', $u->ID, $field, true);
307
+ $cusers[$u->ID] = $this->prepare_sort_string_value($value);
308
+ }
309
+ }
310
+ break;
311
+
312
+ endswitch;
313
+
314
+ if ( isset($sort_flag) ) {
315
+ $user_query = $this->get_users_query_vars( $user_query, $cusers, $sort_flag );
316
+ }
317
+
318
+ return $user_query;
319
+ }
320
+
321
+ /**
322
+ * Orderby Links column
323
+ *
324
+ * Makes use of filter 'get_bookmarks' from bookmark.php to change the result set of the links
325
+ *
326
+ * @since 1.3.1
327
+ */
328
+ public function handle_requests_orderby_links_column()
329
+ {
330
+ // fire only when we are in the admins link-manager
331
+ if ( $this->request_uri_is('link-manager') )
332
+ add_filter( 'get_bookmarks', array( $this, 'callback_requests_orderby_links_column'), 10, 2);
333
+ }
334
+
335
+ /**
336
+ * Orderby Links column
337
+ *
338
+ * @since 1.3.1
339
+ */
340
+ public function callback_requests_orderby_links_column($results, $vars)
341
+ {
342
+ global $wpdb;
343
+
344
+ // Column
345
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-links' );
346
+
347
+ if ( empty($column) )
348
+ return $results;
349
+
350
+ // id
351
+ $type = $id = key($column);
352
+
353
+ // var
354
+ $length = '';
355
+ switch( $type ) :
356
+
357
+ case 'column-link_id':
358
+ if ( version_compare( get_bloginfo('version'), '3.2', '>' ) )
359
+ $vars['orderby'] = 'link_id';
360
+ else
361
+ $vars['orderby'] = 'id';
362
+ break;
363
+
364
+ case 'column-owner':
365
+ $vars['orderby'] = 'link_owner';
366
+ break;
367
+
368
+ case 'column-length':
369
+ $vars['orderby'] = 'length';
370
+ $length = ", CHAR_LENGTH(link_name) AS length";
371
+ break;
372
+
373
+ case 'column-target':
374
+ $vars['orderby'] = 'link_target';
375
+ break;
376
+
377
+ case 'column-description':
378
+ $vars['orderby'] = 'link_description';
379
+ break;
380
+
381
+ case 'column-notes':
382
+ $vars['orderby'] = 'link_notes';
383
+ break;
384
+
385
+ case 'column-rss':
386
+ $vars['orderby'] = 'link_rss';
387
+ break;
388
+
389
+ /** native WP columns */
390
+
391
+ // Relationship
392
+ case 'rel':
393
+ $vars['orderby'] = 'link_rel';
394
+ break;
395
+
396
+ default:
397
+ $vars['orderby'] = '';
398
+
399
+ endswitch;
400
+
401
+ // get bookmarks by orderby vars
402
+ if ( $vars['orderby'] ) {
403
+ $vars['order'] = mysql_escape_string($vars['order']);
404
+ $sql = "SELECT * {$length} FROM {$wpdb->links} WHERE 1=1 ORDER BY {$vars['orderby']} {$vars['order']}";
405
+ $results = $wpdb->get_results($sql);
406
+
407
+ // check for errors
408
+ if( is_wp_error($results) )
409
+ return false;
410
+ }
411
+
412
+ return $results;
413
+ }
414
+
415
+ /**
416
+ * Orderby Comments column
417
+ *
418
+ * @since 1.3.1
419
+ */
420
+ public function callback_requests_orderby_comments_column($pieces, $ref_comment)
421
+ {
422
+ // get query vars
423
+ $vars = $ref_comment->query_vars;
424
+
425
+ // Column
426
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-comments' );
427
+
428
+ if ( empty($column) )
429
+ return $pieces;
430
+
431
+ // id
432
+ $type = $id = key($column);
433
+
434
+ // var
435
+ switch( $type ) :
436
+
437
+ case 'column-comment_id':
438
+ $pieces['orderby'] = 'comment_ID';
439
+ break;
440
+
441
+ case 'column-author_author':
442
+ $pieces['orderby'] = 'comment_author';
443
+ break;
444
+
445
+ case 'column-author_ip':
446
+ $pieces['orderby'] = 'comment_author_IP';
447
+ break;
448
+
449
+ case 'column-author_url':
450
+ $pieces['orderby'] = 'comment_author_url';
451
+ break;
452
+
453
+ case 'column-author_email':
454
+ $pieces['orderby'] = 'comment_author_email';
455
+ break;
456
+
457
+ case 'column-reply_to':
458
+ break;
459
+
460
+ case 'column-approved':
461
+ $pieces['orderby'] = 'comment_approved';
462
+ break;
463
+
464
+ case 'column-date':
465
+ $pieces['orderby'] = 'comment_date';
466
+ break;
467
+
468
+ case 'column-agent':
469
+ $pieces['orderby'] = 'comment_agent';
470
+ break;
471
+
472
+ case 'column-excerpt':
473
+ $pieces['orderby'] = 'comment_content';
474
+ break;
475
+
476
+ case 'column-date_gmt':
477
+ // is default
478
+ break;
479
+
480
+ /** native WP columns */
481
+
482
+ // Relationship
483
+ case 'comment':
484
+ $pieces['orderby'] = 'comment_content';
485
+ break;
486
+
487
+ default:
488
+ $vars['orderby'] = '';
489
+
490
+ endswitch;
491
+
492
+ return $pieces;
493
+ }
494
+
495
+ /**
496
+ * Orderby Comments column
497
+ *
498
+ * @since 1.3.1
499
+ */
500
+ public function handle_requests_orderby_comments_column()
501
+ {
502
+ // fire only when we are in the admins edit-comments
503
+ if ( $this->request_uri_is('edit-comments') ) {
504
+ add_filter('comments_clauses', array( $this, 'callback_requests_orderby_comments_column'), 10, 2);
505
+ }
506
+ }
507
+
508
+ /**
509
+ * Get sorting vars in User Query Object
510
+ *
511
+ * @since 1.3
512
+ */
513
+ private function get_users_query_vars( $user_query, $sortusers, $sort_flags = SORT_REGULAR )
514
+ {
515
+ global $wpdb;
516
+
517
+ // vars
518
+ $vars = $user_query->query_vars;
519
+
520
+ // sorting
521
+ if ( $vars['order'] == 'ASC' )
522
+ asort($sortusers, $sort_flags);
523
+ else
524
+ arsort($sortusers, $sort_flags);
525
+
526
+ // alter orderby SQL
527
+ if ( ! empty ( $sortusers ) ) {
528
+ $ids = implode(',', array_keys($sortusers));
529
+ $user_query->query_where .= " AND {$wpdb->prefix}users.ID IN ({$ids})";
530
+ $user_query->query_orderby = "ORDER BY FIELD({$wpdb->prefix}users.ID,{$ids})";
531
+ }
532
+
533
+ // cleanup the vars we dont need
534
+ $vars['order'] = '';
535
+ $vars['orderby'] = '';
536
+
537
+ // set query vars
538
+ $user_query->query_vars = $vars;
539
+
540
+ return $user_query;
541
+ }
542
+
543
+ /**
544
+ * Orderby Media column
545
+ *
546
+ * @since 1.3
547
+ */
548
+ private function get_orderby_media_vars($vars)
549
+ {
550
+ // Column
551
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-media' );
552
+
553
+ if ( empty($column) )
554
+ return $vars;
555
+
556
+ // var
557
+ $cposts = array();
558
+ switch( key($column) ) :
559
+
560
+ case 'column-mediaid' :
561
+ $vars['orderby'] = 'ID';
562
+ break;
563
+
564
+ case 'column-width' :
565
+ $sort_flag = SORT_NUMERIC;
566
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
567
+ $meta = wp_get_attachment_metadata($p->ID);
568
+ $width = !empty($meta['width']) ? $meta['width'] : 0;
569
+ if ( $width || $this->show_all_results )
570
+ $cposts[$p->ID] = $width;
571
+ }
572
+ break;
573
+
574
+ case 'column-height' :
575
+ $sort_flag = SORT_NUMERIC;
576
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
577
+ $meta = wp_get_attachment_metadata($p->ID);
578
+ $height = !empty($meta['height']) ? $meta['height'] : 0;
579
+ if ( $height || $this->show_all_results )
580
+ $cposts[$p->ID] = $height;
581
+ }
582
+ break;
583
+
584
+ case 'column-dimensions' :
585
+ $sort_flag = SORT_NUMERIC;
586
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
587
+ $meta = wp_get_attachment_metadata($p->ID);
588
+ $height = !empty($meta['height']) ? $meta['height'] : 0;
589
+ $width = !empty($meta['width']) ? $meta['width'] : 0;
590
+ $surface = $height*$width;
591
+
592
+ if ( $surface || $this->show_all_results )
593
+ $cposts[$p->ID] = $surface;
594
+ }
595
+ break;
596
+
597
+ case 'column-caption' :
598
+ $sort_flag = SORT_STRING;
599
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
600
+ if ( $p->post_excerpt || $this->show_all_results ) {
601
+ $cposts[$p->ID] = $this->prepare_sort_string_value($p->post_excerpt);
602
+ }
603
+ }
604
+ break;
605
+
606
+ case 'column-description' :
607
+ $sort_flag = SORT_STRING;
608
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
609
+ if ( $p->post_content || $this->show_all_results ) {
610
+ $cposts[$p->ID] = $this->prepare_sort_string_value( $p->post_content );
611
+ }
612
+ }
613
+ break;
614
+
615
+ case 'column-mime_type' :
616
+ $sort_flag = SORT_STRING;
617
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
618
+ if ( $p->post_mime_type || $this->show_all_results ) {
619
+ $cposts[$p->ID] = $this->prepare_sort_string_value( $p->post_mime_type );
620
+ }
621
+ }
622
+ break;
623
+
624
+ case 'column-file_name' :
625
+ $sort_flag = SORT_STRING;
626
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
627
+ $meta = get_post_meta($p->ID, '_wp_attached_file', true);
628
+ $file = !empty($meta) ? basename($meta) : '';
629
+ if ( $file || $this->show_all_results ) {
630
+ $cposts[$p->ID] = $file;
631
+ }
632
+ }
633
+ break;
634
+
635
+ case 'column-alternate_text' :
636
+ $sort_flag = SORT_STRING;
637
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
638
+ $alt = get_post_meta($p->ID, '_wp_attachment_image_alt', true);
639
+ if ( $alt || $this->show_all_results ) {
640
+ $cposts[$p->ID] = $this->prepare_sort_string_value( $alt );
641
+ }
642
+ }
643
+ break;
644
+
645
+ endswitch;
646
+
647
+ // we will add the sorted post ids to vars['post__in'] and remove unused vars
648
+ if ( isset($sort_flag) ) {
649
+ $vars = $this->get_vars_post__in( $vars, $cposts, $sort_flag );
650
+ }
651
+
652
+ return $vars;
653
+ }
654
+
655
+ /**
656
+ * Orderby Posts column
657
+ *
658
+ * @since 1.3
659
+ */
660
+ private function get_orderby_posts_vars($vars)
661
+ {
662
+ $post_type = $vars['post_type'];
663
+
664
+ // Column
665
+ $column = $this->get_orderby_type( $vars['orderby'], $post_type );
666
+
667
+ if ( empty($column) )
668
+ return $vars;
669
+
670
+ // id
671
+ $id = key($column);
672
+
673
+ // type
674
+ $type = $id;
675
+
676
+ // Check for taxonomies, such as column-taxonomy-[taxname]
677
+ if ( strpos($type, 'column-taxonomy-') !== false )
678
+ $type = 'column-taxonomy';
679
+
680
+ // custom fields
681
+ if ( Codepress_Admin_Columns::is_column_meta($type) )
682
+ $type = 'column-post-meta';
683
+
684
+ // attachments
685
+ if ( $type == 'column-attachment-count' )
686
+ $type = 'column-attachment';
687
+
688
+ // var
689
+ $cposts = array();
690
+ switch( $type ) :
691
+
692
+ case 'column-postid' :
693
+ $vars['orderby'] = 'ID';
694
+ break;
695
+
696
+ case 'column-order' :
697
+ $vars['orderby'] = 'menu_order';
698
+ break;
699
+
700
+ case 'column-modified' :
701
+ $vars['orderby'] = 'modified';
702
+ break;
703
+
704
+ case 'column-comment-count' :
705
+ $vars['orderby'] = 'comment_count';
706
+ break;
707
+
708
+ case 'column-post-meta' :
709
+ $field = $column[$id]['field'];
710
+
711
+ // orderby type
712
+ $field_type = 'meta_value';
713
+ if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' )
714
+ $field_type = 'meta_value_num';
715
+
716
+ $vars = array_merge($vars, array(
717
+ 'meta_key' => $field,
718
+ 'orderby' => $field_type
719
+ ));
720
+ break;
721
+
722
+ case 'column-excerpt' :
723
+ $sort_flag = SORT_STRING;
724
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
725
+ $cposts[$p->ID] = $this->prepare_sort_string_value($p->post_content);
726
+ }
727
+ break;
728
+
729
+ case 'column-word-count' :
730
+ $sort_flag = SORT_NUMERIC;
731
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
732
+ $cposts[$p->ID] = str_word_count( Codepress_Admin_Columns::strip_trim( $p->post_content ) );
733
+ }
734
+ break;
735
+
736
+ case 'column-page-template' :
737
+ $sort_flag = SORT_STRING;
738
+ $templates = get_page_templates();
739
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
740
+ $page_template = get_post_meta($p->ID, '_wp_page_template', true);
741
+ $cposts[$p->ID] = array_search($page_template, $templates);
742
+ }
743
+ break;
744
+
745
+ case 'column-post_formats' :
746
+ $sort_flag = SORT_REGULAR;
747
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
748
+ $cposts[$p->ID] = get_post_format($p->ID);
749
+ }
750
+ break;
751
+
752
+ case 'column-attachment' :
753
+ $sort_flag = SORT_NUMERIC;
754
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
755
+ $cposts[$p->ID] = count( Codepress_Admin_Columns::get_attachment_ids($p->ID) );
756
+ }
757
+ break;
758
+
759
+ case 'column-page-slug' :
760
+ $sort_flag = SORT_REGULAR;
761
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
762
+ $cposts[$p->ID] = $p->post_name;
763
+ }
764
+ break;
765
+
766
+ case 'column-sticky' :
767
+ $sort_flag = SORT_REGULAR;
768
+ $stickies = get_option('sticky_posts');
769
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
770
+ $cposts[$p->ID] = $p->ID;
771
+ if ( !empty($stickies) && in_array($p->ID, $stickies ) ) {
772
+ $cposts[$p->ID] = 0;
773
+ }
774
+ }
775
+ break;
776
+
777
+ case 'column-featured_image' :
778
+ $sort_flag = SORT_REGULAR;
779
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
780
+ $cposts[$p->ID] = $p->ID;
781
+ $thumb = get_the_post_thumbnail($p->ID);
782
+ if ( !empty($thumb) ) {
783
+ $cposts[$p->ID] = 0;
784
+ }
785
+ }
786
+ break;
787
+
788
+ case 'column-roles' :
789
+ $sort_flag = SORT_STRING;
790
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
791
+ $cposts[$p->ID] = 0;
792
+ $userdata = get_userdata($p->post_author);
793
+ if ( !empty($userdata->roles[0]) ) {
794
+ $cposts[$p->ID] = $userdata->roles[0];
795
+ }
796
+ }
797
+ break;
798
+
799
+ case 'column-status' :
800
+ $sort_flag = SORT_STRING;
801
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
802
+ $cposts[$p->ID] = $p->post_status.strtotime($p->post_date);
803
+ }
804
+ break;
805
+
806
+ case 'column-comment-status' :
807
+ $sort_flag = SORT_STRING;
808
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
809
+ $cposts[$p->ID] = $p->comment_status;
810
+ }
811
+ break;
812
+
813
+ case 'column-ping-status' :
814
+ $sort_flag = SORT_STRING;
815
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
816
+ $cposts[$p->ID] = $p->ping_status;
817
+ }
818
+ break;
819
+
820
+ case 'column-taxonomy' :
821
+ $sort_flag = SORT_STRING;
822
+ $tax = str_replace('column-taxonomy-', '', $id);
823
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
824
+ $cposts[$p->ID] = '';
825
+ $terms = get_the_terms($p->ID, $tax);
826
+ if ( !is_wp_error($terms) && !empty($terms) ) {
827
+ // only use the first term to sort
828
+ $term = array_shift(array_values($terms));
829
+ if ( isset($term->term_id) ) {
830
+ $cposts[$p->ID] = sanitize_term_field('name', $term->name, $term->term_id, $term->taxonomy, 'db');
831
+ }
832
+ }
833
+ }
834
+ break;
835
+
836
+ endswitch;
837
+
838
+ // we will add the sorted post ids to vars['post__in'] and remove unused vars
839
+ if ( isset($sort_flag) ) {
840
+ $vars = $this->get_vars_post__in( $vars, $cposts, $sort_flag );
841
+ }
842
+
843
+ return $vars;
844
+ }
845
+
846
+ /**
847
+ * Set post__in for use in WP_Query
848
+ *
849
+ * This will order the ID's asc or desc and set the appropriate filters.
850
+ *
851
+ * @since 1.2.1
852
+ */
853
+ private function get_vars_post__in( &$vars, $sortposts, $sort_flags = SORT_REGULAR )
854
+ {
855
+ // sort post ids by value
856
+ if ( $vars['order'] == 'asc' )
857
+ asort($sortposts, $sort_flags);
858
+ else
859
+ arsort($sortposts, $sort_flags);
860
+
861
+ // this will make sure WP_Query will use the order of the ids that we have just set in 'post__in'
862
+ // set priority higher then default to prevent conflicts with 3rd party plugins
863
+ add_filter('posts_orderby', array( $this, 'filter_orderby_post__in'), 10, 2 );
864
+
865
+ // cleanup the vars we dont need
866
+ $vars['order'] = '';
867
+ $vars['orderby'] = '';
868
+
869
+ // add the sorted post ids to the query with the use of post__in
870
+ $vars['post__in'] = array_keys($sortposts);
871
+
872
+ return $vars;
873
+ }
874
+
875
+ /**
876
+ * Get orderby type
877
+ *
878
+ * @since 1.1
879
+ */
880
+ private function get_orderby_type($orderby, $type)
881
+ {
882
+ $db_columns = Codepress_Admin_Columns::get_stored_columns($type);
883
+
884
+ if ( $db_columns ) {
885
+ foreach ( $db_columns as $id => $vars ) {
886
+
887
+ // check which custom column was clicked
888
+ if ( isset( $vars['label'] ) && $orderby == $this->sanitize_string( $vars['label'] ) ) {
889
+ $column[$id] = $vars;
890
+ return $column;
891
+ }
892
+ }
893
+ }
894
+ return false;
895
+ }
896
+
897
+ /**
898
+ * Maintain order of ids that are set in the post__in var.
899
+ *
900
+ * This will force the returned posts to use the order of the ID's that
901
+ * have been set in post__in. Without this the ID's will be set in numeric order.
902
+ * See the WP_Query object for more info about the use of post__in.
903
+ *
904
+ * @since 1.2.1
905
+ */
906
+ public function filter_orderby_post__in($orderby, $wp)
907
+ {
908
+ global $wpdb;
909
+
910
+ // we need the query vars
911
+ $vars = $wp->query_vars;
912
+ if ( ! empty ( $vars['post__in'] ) ) {
913
+ // now we can get the ids
914
+ $ids = implode(',', $vars['post__in']);
915
+
916
+ // by adding FIELD to the SQL query we are forcing the order of the ID's
917
+ return "FIELD({$wpdb->prefix}posts.ID,{$ids})";
918
+ }
919
+ }
920
+
921
+ /**
922
+ * Get any posts by post_type
923
+ *
924
+ * @since 1.2.1
925
+ */
926
+ private function get_any_posts_by_posttype( $post_type )
927
+ {
928
+ $allposts = get_posts(array(
929
+ 'numberposts' => -1,
930
+ 'post_status' => 'any',
931
+ 'post_type' => $post_type
932
+ ));
933
+ return (array) $allposts;
934
+ }
935
+
936
+ /**
937
+ * Request URI is
938
+ *
939
+ * @since 1.3.1
940
+ */
941
+ private function request_uri_is( $screen_id = '' )
942
+ {
943
+ if (strpos( $_SERVER['REQUEST_URI'], "/{$screen_id}.php" ) !== false )
944
+ return true;
945
+
946
+ return false;
947
+ }
948
+
949
+ /**
950
+ * Prepare the value for being by sorting
951
+ *
952
+ * @since 1.3
953
+ */
954
+ private function prepare_sort_string_value($string)
955
+ {
956
+ // remove tags and only get the first 20 chars and force lowercase.
957
+ $string = strtolower( substr( Codepress_Admin_Columns::strip_trim($string),0 ,20 ) );
958
+
959
+ return $string;
960
+ }
961
+
962
+ /**
963
+ * Get users data
964
+ *
965
+ * @since 1.3
966
+ */
967
+ function get_users_data()
968
+ {
969
+ $userdatas = array();
970
+ $wp_users = get_users( array(
971
+ 'blog_id' => $GLOBALS['blog_id'],
972
+ ));
973
+ foreach ( $wp_users as $u ) {
974
+ $userdatas[$u->ID] = get_userdata($u->ID);
975
+ }
976
+ return $userdatas;
977
+ }
978
+
979
+ /**
980
+ * Register filtering columns
981
+ *
982
+ * @since 1.4.2
983
+ */
984
+ function register_filtering_columns()
985
+ {
986
+ if ( ! $this->unlocked )
987
+ return false;
988
+
989
+ // hook into wordpress
990
+ add_action('restrict_manage_posts', array($this, 'callback_restrict_posts'));
991
+ }
992
+
993
+ /**
994
+ * Add taxonomy filters to posts
995
+ *
996
+ * @since 1.4.2
997
+ */
998
+ function callback_restrict_posts()
999
+ {
1000
+ global $post_type_object;
1001
+
1002
+ // make a filter foreach taxonomy
1003
+ $taxonomies = get_object_taxonomies($post_type_object->name, 'names');
1004
+
1005
+ if ( $taxonomies ) {
1006
+ foreach ( $taxonomies as $tax ) {
1007
+ if ( !in_array($tax, array('post_tag','category','post_format') ) ) {
1008
+
1009
+ $terms = get_terms($tax);
1010
+ $terms = $this->indent($terms, 0, 'parent', 'term_id');
1011
+ $terms = $this->apply_dropdown_markup($terms);
1012
+
1013
+ $select = "<option value=''>".__('Show all ', CPAC_TEXTDOMAIN)."{$tax}</option>";
1014
+ if (!empty($terms)) {
1015
+ foreach( $terms as $term_slug => $term) {
1016
+ $selected = isset($_GET[$tax]) && $term_slug == $_GET[$tax] ? " selected='selected'" : '';
1017
+ $select .= "<option value='{$term_slug}'{$selected}>{$term}</option>";
1018
+ }
1019
+ }
1020
+ echo "<select class='postform' name='{$tax}'>{$select}</select>";
1021
+ }
1022
+ }
1023
+ }
1024
+ }
1025
+
1026
+ /**
1027
+ * Applies dropdown markup for taxonomy dropdown
1028
+ *
1029
+ * @since 1.4.2
1030
+ */
1031
+ private function apply_dropdown_markup($array, $level = 0, $output = array())
1032
+ {
1033
+ foreach($array as $v) {
1034
+
1035
+ $prefix = '';
1036
+ for($i=0; $i<$level; $i++) {
1037
+ $prefix .= '&nbsp;&nbsp;';
1038
+ }
1039
+
1040
+ $output[$v->slug] = $prefix . htmlentities($v->name, ENT_QUOTES, 'UTF-8');
1041
+
1042
+ if ( !empty($v->children) ) {
1043
+ $output = $this->apply_dropdown_markup($v->children, ($level + 1), $output);
1044
+ }
1045
+ }
1046
+
1047
+ return $output;
1048
+ }
1049
+
1050
+ /**
1051
+ * Indents any object as long as it has a unique id and that of its parent.
1052
+ *
1053
+ * @since 1.4.2
1054
+ */
1055
+ private function indent($array, $parentId = 0, $parentKey = 'post_parent', $selfKey = 'ID', $childrenKey = 'children')
1056
+ {
1057
+ $indent = array();
1058
+
1059
+ // clean counter
1060
+ $i = 0;
1061
+
1062
+ foreach($array as $v) {
1063
+
1064
+ if ($v->$parentKey == $parentId) {
1065
+ $indent[$i] = $v;
1066
+ $indent[$i]->$childrenKey = $this->indent($array, $v->$selfKey, $parentKey, $selfKey);
1067
+
1068
+ $i++;
1069
+ }
1070
+ }
1071
+
1072
+ return $indent;
1073
+ }
1074
+ }
1075
+
1076
+ ?>
classes/values.php ADDED
@@ -0,0 +1,529 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CPAC_Values Class
5
+ *
6
+ * @since 1.4.4
7
+ *
8
+ */
9
+ class CPAC_Values
10
+ {
11
+ protected $excerpt_length;
12
+
13
+ /**
14
+ * Constructor
15
+ *
16
+ * @since 1.0
17
+ */
18
+ function __construct()
19
+ {
20
+ // number of words
21
+ $this->excerpt_length = 20;
22
+ }
23
+
24
+ /**
25
+ * Admin requests for orderby column
26
+ *
27
+ * @since 1.0
28
+ */
29
+ public function get_stored_columns($type)
30
+ {
31
+ return Codepress_Admin_Columns::get_stored_columns($type);
32
+ }
33
+
34
+ /**
35
+ * Checks if column-meta key exists
36
+ *
37
+ * @since 1.0
38
+ */
39
+ public static function is_column_meta( $id = '' )
40
+ {
41
+ return Codepress_Admin_Columns::is_column_meta( $id );
42
+ }
43
+
44
+ /**
45
+ * Returns excerpt
46
+ *
47
+ * @since 1.0
48
+ */
49
+ protected function get_post_excerpt($post_id)
50
+ {
51
+ global $post;
52
+
53
+ $save_post = $post;
54
+ $post = get_post($post_id);
55
+ $excerpt = get_the_excerpt();
56
+ $post = $save_post;
57
+
58
+ $output = $this->get_shortened_string($excerpt, $this->excerpt_length );
59
+
60
+ return $output;
61
+ }
62
+
63
+ /**
64
+ * Returns shortened string
65
+ *
66
+ * @since 1.0
67
+ */
68
+ protected function get_shortened_string($string = '', $num_words = 55, $more = null)
69
+ {
70
+ if (!$string)
71
+ return false;
72
+
73
+ return wp_trim_words( $string, $num_words, $more );
74
+ }
75
+
76
+ /**
77
+ * Get image from assets folder
78
+ *
79
+ * @since 1.3.1
80
+ */
81
+ protected function get_asset_image($name = '', $title = '')
82
+ {
83
+ if ( $name )
84
+ return sprintf("<img alt='' src='%s' title='%s'/>", CPAC_URL."/assets/images/{$name}", $title);
85
+ }
86
+
87
+ /**
88
+ * Shorten URL
89
+ *
90
+ * @since 1.3.1
91
+ */
92
+ protected function get_shorten_url($url = '')
93
+ {
94
+ if ( !$url )
95
+ return false;
96
+
97
+ // shorten url
98
+ $short_url = url_shorten( $url );
99
+
100
+ return "<a title='{$url}' href='{$url}'>{$short_url}</a>";
101
+ }
102
+
103
+ /**
104
+ * Get column value of post attachments
105
+ *
106
+ * @since 1.0
107
+ */
108
+ protected function get_column_value_attachments( $post_id )
109
+ {
110
+ $result = '';
111
+ $attachment_ids = $this->get_attachment_ids($post_id);
112
+ if ( $attachment_ids ) {
113
+ foreach ( $attachment_ids as $attach_id ) {
114
+ if ( wp_get_attachment_image($attach_id) )
115
+ $result .= wp_get_attachment_image( $attach_id, array(80,80), true );
116
+ }
117
+ }
118
+ return $result;
119
+ }
120
+
121
+ /**
122
+ * Get column value of post attachments
123
+ *
124
+ * @since 1.2.1
125
+ */
126
+ protected function get_attachment_ids( $post_id )
127
+ {
128
+ return Codepress_Admin_Columns::get_attachment_ids( $post_id );
129
+ }
130
+
131
+ /**
132
+ * Get the posttype from columnname
133
+ *
134
+ * @since 1.3.1
135
+ */
136
+ protected function get_posttype_by_postcount_column( $id = '' )
137
+ {
138
+ if ( strpos($id, 'column-user_postcount-') !== false )
139
+ return str_replace('column-user_postcount-', '', $id);
140
+
141
+ return false;
142
+ }
143
+
144
+ /**
145
+ * Get a thumbnail
146
+ *
147
+ * @since 1.0
148
+ */
149
+ protected function get_thumbnail( $image = '' )
150
+ {
151
+ if ( empty($image) )
152
+ return false;
153
+
154
+ // get correct image path
155
+ $image_path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $image);
156
+
157
+ // resize image
158
+ if ( file_exists($image_path) && $this->is_image($image_path) ) {
159
+ $resized = image_resize( $image_path, 80, 80, true);
160
+
161
+ if ( ! is_wp_error( $resized ) ) {
162
+ $image = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $resized);
163
+
164
+ return "<img src='{$image}' alt='' width='80' height='80' />";
165
+ }
166
+
167
+ return $resized->get_error_message();
168
+ }
169
+
170
+ return false;
171
+ }
172
+
173
+ /**
174
+ * Checks an URL for image extension
175
+ *
176
+ * @since 1.2
177
+ */
178
+ protected function is_image($url)
179
+ {
180
+ $validExt = array('.jpg', '.jpeg', '.gif', '.png', '.bmp');
181
+ $ext = strrchr($url, '.');
182
+
183
+ return in_array($ext, $validExt);
184
+ }
185
+
186
+ /**
187
+ * Get a thumbnail
188
+ *
189
+ * @since 1.3.1
190
+ */
191
+ protected function get_media_thumbnails($meta)
192
+ {
193
+ $meta = $this->strip_trim( str_replace(' ','', $meta) );
194
+
195
+ // split media ids
196
+ $media_ids = array($meta);
197
+ if ( strpos($meta, ',') !== false )
198
+ $media_ids = explode(',', $meta);
199
+
200
+ // check if media exists
201
+ $thumbs = '';
202
+ foreach ( $media_ids as $media_id )
203
+ if ( is_numeric($media_id) )
204
+ $thumbs .= wp_get_attachment_url($media_id) ? "<span class='cpac-column-value-image'>".wp_get_attachment_image( $media_id, array(80,80), true )."</span>" : '';
205
+
206
+ return $thumbs;
207
+ }
208
+
209
+ /**
210
+ * Get post count
211
+ *
212
+ * @since 1.3.1
213
+ */
214
+ protected function get_post_count( $post_type, $user_id )
215
+ {
216
+ if ( ! post_type_exists($post_type) || ! get_userdata($user_id) )
217
+ return false;
218
+
219
+ $user_posts = get_posts(array(
220
+ 'post_type' => $post_type,
221
+ 'numberposts' => -1,
222
+ 'author' => $user_id,
223
+ 'post_status' => 'publish'
224
+ ));
225
+ return count($user_posts);
226
+ }
227
+
228
+ /**
229
+ * Get column value of Custom Field
230
+ *
231
+ * @since 1.0
232
+ */
233
+ protected function get_column_value_custom_field($object_id, $column_name, $meta_type = 'post')
234
+ {
235
+ /** Users */
236
+ if ( $meta_type == 'user' ) {
237
+ $type = 'wp-users';
238
+ }
239
+
240
+ /** Posts */
241
+ else {
242
+ $type = get_post_type($object_id);
243
+ }
244
+
245
+ // get column
246
+ $columns = $this->get_stored_columns($type);
247
+
248
+ // inputs
249
+ $field = isset($columns[$column_name]['field']) ? $columns[$column_name]['field'] : '';
250
+ $fieldtype = isset($columns[$column_name]['field_type']) ? $columns[$column_name]['field_type'] : '';
251
+ $before = isset($columns[$column_name]['before']) ? $columns[$column_name]['before'] : '';
252
+ $after = isset($columns[$column_name]['after']) ? $columns[$column_name]['after'] : '';
253
+
254
+ // Get meta field value
255
+ $meta = get_metadata($meta_type, $object_id, $field, true);
256
+
257
+ // multiple meta values
258
+ if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
259
+ $meta = get_metadata($meta_type, $object_id, $field, true);
260
+ $meta = $this->recursive_implode(', ', $meta);
261
+ }
262
+
263
+ // make sure there are no serialized arrays or empty meta data
264
+ if ( empty($meta) || !is_string($meta) )
265
+ return false;
266
+
267
+ // handles each field type differently..
268
+ switch ($fieldtype) :
269
+
270
+ // Image
271
+ case "image" :
272
+ $meta = $this->get_thumbnail($meta);
273
+ break;
274
+
275
+ // Media Library ID
276
+ case "library_id" :
277
+ $meta = $this->get_media_thumbnails($meta);
278
+ break;
279
+
280
+ // Excerpt
281
+ case "excerpt" :
282
+ $meta = $this->get_shortened_string($meta, $this->excerpt_length);
283
+ break;
284
+
285
+ // Date
286
+ case "date" :
287
+ $meta = $this->get_date($meta);
288
+ break;
289
+
290
+ // Title
291
+ case "title_by_id" :
292
+ $titles = $this->get_custom_field_value_title($meta);
293
+ if ( $titles )
294
+ $meta = $titles;
295
+ break;
296
+
297
+ endswitch;
298
+
299
+ // add before and after string
300
+ $meta = "{$before}{$meta}{$after}";
301
+
302
+ return $meta;
303
+ }
304
+
305
+ /**
306
+ * Get custom field value 'Title by ID'
307
+ *
308
+ * @since 1.3
309
+ */
310
+ protected function get_custom_field_value_title($meta)
311
+ {
312
+ //remove white spaces and strip tags
313
+ $meta = $this->strip_trim( str_replace(' ','', $meta) );
314
+
315
+ // var
316
+ $ids = $titles = array();
317
+
318
+ // check for multiple id's
319
+ if ( strpos($meta, ',') !== false )
320
+ $ids = explode(',',$meta);
321
+ elseif ( is_numeric($meta) )
322
+ $ids[] = $meta;
323
+
324
+ // display title with link
325
+ if ( $ids && is_array($ids) ) {
326
+ foreach ( $ids as $id ) {
327
+ $title = is_numeric($id) ? get_the_title($id) : '';
328
+ $link = get_edit_post_link($id);
329
+ if ( $title )
330
+ $titles[] = $link ? "<a href='{$link}'>{$title}</a>" : $title;
331
+ }
332
+ }
333
+
334
+ return implode('<span class="cpac-divider"></span>', $titles);
335
+ }
336
+
337
+ /**
338
+ * Get column value of Custom Field
339
+ *
340
+ * @since 1.2
341
+ */
342
+ protected function get_user_column_value_custom_field($user_id, $id)
343
+ {
344
+ $columns = $this->get_stored_columns('wp-users');
345
+
346
+ // inputs
347
+ $field = isset($columns[$id]['field']) ? $columns[$id]['field'] : '';
348
+ $fieldtype = isset($columns[$id]['field_type']) ? $columns[$id]['field_type'] : '';
349
+ $before = isset($columns[$id]['before']) ? $columns[$id]['before'] : '';
350
+ $after = isset($columns[$id]['after']) ? $columns[$id]['after'] : '';
351
+
352
+ // Get meta field value
353
+ $meta = get_user_meta($user_id, $field, true);
354
+
355
+ // multiple meta values
356
+ if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
357
+ $meta = get_user_meta($user_id, $field);
358
+ $meta = $this->recursive_implode(', ', $meta);
359
+ }
360
+
361
+ // make sure there are no serialized arrays or empty meta data
362
+ if ( empty($meta) || !is_string($meta) )
363
+ return false;
364
+
365
+ // handles each field type differently..
366
+ switch ($fieldtype) :
367
+
368
+ // Image
369
+ case "image" :
370
+ $meta = $this->get_thumbnail($meta);
371
+ break;
372
+
373
+ // Media Library ID
374
+ case "library_id" :
375
+ $meta = $this->get_media_thumbnails($meta);
376
+ break;
377
+
378
+ // Excerpt
379
+ case "excerpt" :
380
+ $meta = $this->get_shortened_string($meta, $this->excerpt_length);
381
+ break;
382
+
383
+ endswitch;
384
+
385
+ // add before and after string
386
+ $meta = "{$before}{$meta}{$after}";
387
+
388
+ return $meta;
389
+ }
390
+
391
+ /**
392
+ * Implode for multi dimensional array
393
+ *
394
+ * @since 1.0
395
+ */
396
+ protected function recursive_implode( $glue, $pieces )
397
+ {
398
+ foreach( $pieces as $r_pieces ) {
399
+ if( is_array( $r_pieces ) ) {
400
+ $retVal[] = $this->recursive_implode( $glue, $r_pieces );
401
+ }
402
+ else {
403
+ $retVal[] = $r_pieces;
404
+ }
405
+ }
406
+ if ( isset($retVal) && is_array($retVal) )
407
+ return implode( $glue, $retVal );
408
+
409
+ return false;
410
+ }
411
+
412
+ /**
413
+ * Strip tags and trim
414
+ *
415
+ * @since 1.3
416
+ */
417
+ protected function strip_trim($string)
418
+ {
419
+ return Codepress_Admin_Columns::strip_trim($string);
420
+ }
421
+
422
+ /**
423
+ * Get date
424
+ *
425
+ * @since 1.3.1
426
+ */
427
+ protected function get_date($date)
428
+ {
429
+ if ( ! $date )
430
+ return false;
431
+
432
+ if ( ! is_numeric($date) )
433
+ $date = strtotime($date);
434
+
435
+ return date_i18n( get_option('date_format'), $date );
436
+ }
437
+
438
+ /**
439
+ * Get time
440
+ *
441
+ * @since 1.3.1
442
+ */
443
+ protected function get_time($date)
444
+ {
445
+ if ( ! $date )
446
+ return false;
447
+
448
+ if ( ! is_numeric($date) )
449
+ $date = strtotime($date);
450
+
451
+ return date_i18n( get_option('time_format'), $date );
452
+ }
453
+
454
+ /**
455
+ * Get column value of post actions
456
+ *
457
+ * This part is copied from the Posts List Table class
458
+ *
459
+ * @since 1.4.2
460
+ */
461
+ protected function get_column_value_actions( $id, $type = 'posts' )
462
+ {
463
+ $actions = array();
464
+
465
+ /** Posts */
466
+ if ( $type == 'posts') {
467
+ $post_id = $id;
468
+ $post = get_post($post_id);
469
+ $title = _draft_or_post_title();
470
+ $post_type_object = get_post_type_object( $post->post_type );
471
+ $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
472
+
473
+ if ( $can_edit_post && 'trash' != $post->post_status ) {
474
+ $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
475
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
476
+ }
477
+ if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
478
+ if ( 'trash' == $post->post_status )
479
+ $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
480
+ elseif ( EMPTY_TRASH_DAYS )
481
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
482
+ if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
483
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
484
+ }
485
+ if ( $post_type_object->public ) {
486
+ if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
487
+ if ( $can_edit_post )
488
+ $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
489
+ } elseif ( 'trash' != $post->post_status ) {
490
+ $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
491
+ }
492
+ }
493
+ }
494
+
495
+ /** Users */
496
+ elseif ( $type == 'users' ) {
497
+
498
+ $user_object = new WP_User( $id );
499
+ $screen = get_current_screen();
500
+
501
+ if ( 'site-users-network' == $screen->id )
502
+ $url = "site-users.php?id={$this->site_id}&amp;";
503
+ else
504
+ $url = 'users.php?';
505
+
506
+ if ( get_current_user_id() == $user_object->ID ) {
507
+ $edit_link = 'profile.php';
508
+ } else {
509
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ) );
510
+ }
511
+
512
+ if ( current_user_can( 'edit_user', $user_object->ID ) ) {
513
+ $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
514
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
515
+ } else {
516
+ $edit = "<strong>$user_object->user_login</strong><br />";
517
+ }
518
+
519
+ if ( !is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) )
520
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . "</a>";
521
+ if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) )
522
+ $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>";
523
+ }
524
+
525
+ return implode(' | ', $actions);
526
+ }
527
+ }
528
+
529
+ ?>
classes/values/comments.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CPAC_Comments_Values Class
5
+ *
6
+ * @since 1.4.4
7
+ *
8
+ */
9
+ class CPAC_Comments_Values extends CPAC_Values
10
+ {
11
+ /**
12
+ * Constructor
13
+ *
14
+ * @since 1.4.4
15
+ */
16
+ function __construct()
17
+ {
18
+ parent::__construct();
19
+
20
+ add_action( 'manage_comments_custom_column', array( $this, 'manage_comments_column_value'), 10, 2 );
21
+ }
22
+
23
+ /**
24
+ * Manage custom column for Comments
25
+ *
26
+ * @since 1.3.1
27
+ */
28
+ public function manage_comments_column_value( $column_name, $comment_id )
29
+ {
30
+ $type = $column_name;
31
+
32
+ // comments object
33
+ $comment = get_comment($comment_id);
34
+
35
+ // Check for custom fields, such as column-meta-[customfieldname]
36
+ if ( $this->is_column_meta($type) )
37
+ $type = 'column-comment-meta';
38
+
39
+ // Hook
40
+ do_action('cpac-manage-comments-column', $type, $column_name, $comment_id);
41
+
42
+ $result = '';
43
+ switch ($type) :
44
+
45
+ // comment id
46
+ case "column-comment_id" :
47
+ $result = $comment_id;
48
+ break;
49
+
50
+ // author
51
+ case "column-author_author" :
52
+ $result = $comment->comment_author;
53
+ break;
54
+
55
+ // avatar
56
+ case "column-author_avatar" :
57
+ $result = get_avatar( $comment, 80 );
58
+ break;
59
+
60
+ // url
61
+ case "column-author_url" :
62
+ $result = $this->get_shorten_url($comment->comment_author_url);
63
+ break;
64
+
65
+ // ip
66
+ case "column-author_ip" :
67
+ $result = $comment->comment_author_IP;
68
+ break;
69
+
70
+ // email
71
+ case "column-author_email" :
72
+ $result = $comment->comment_author_email;
73
+ break;
74
+
75
+ // parent
76
+ case "column-reply_to" :
77
+ if ( $comment->comment_approved ) {
78
+ $parent = get_comment( $comment->comment_parent );
79
+ $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
80
+ $name = get_comment_author( $parent->comment_ID );
81
+ $result = sprintf( '<a href="%1$s">%2$s</a>', $parent_link, $name );
82
+ }
83
+ break;
84
+
85
+ // approved
86
+ case "column-approved" :
87
+ $result = $this->get_asset_image('no.png');
88
+ if ( $comment->comment_approved )
89
+ $result = $this->get_asset_image('checkmark.png');
90
+ break;
91
+
92
+ // date
93
+ case "column-date" :
94
+ $comment_url = esc_url( get_comment_link( $comment_id ) );
95
+ $result = sprintf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ),
96
+ $comment_url,
97
+ $this->get_date($comment->comment_date),
98
+ $this->get_time($comment->comment_date)
99
+ );
100
+ $result = "<div class='submitted-on'>{$result}</div>";
101
+ break;
102
+
103
+ // date GMT
104
+ case "column-date_gmt" :
105
+ $comment_url = esc_url( get_comment_link( $comment_id ) );
106
+ $result = sprintf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ),
107
+ $comment_url,
108
+ $this->get_date($comment->comment_date_gmt),
109
+ $this->get_time($comment->comment_date_gmt)
110
+ );
111
+ $result = "<div class='submitted-on'>{$result}</div>";
112
+ break;
113
+
114
+ // custom field
115
+ case "column-comment-meta" :
116
+ $result = $this->get_column_value_custom_field($comment_id, $column_name, 'comment');
117
+ break;
118
+
119
+ // agent
120
+ case "column-agent" :
121
+ $result = $comment->comment_agent;
122
+ break;
123
+
124
+ // excerpt
125
+ case "column-excerpt" :
126
+ $comment = get_comment($comment_id);
127
+ $result = $this->get_shortened_string($comment->comment_content, $this->excerpt_length);
128
+ break;
129
+
130
+ default :
131
+ $result = '';
132
+
133
+ endswitch;
134
+
135
+ echo $result;
136
+ }
137
+ }
138
+
139
+ ?>
classes/values/link.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CPAC_Link_Values Class
5
+ *
6
+ * @since 1.4.4
7
+ *
8
+ */
9
+ class CPAC_Link_Values extends CPAC_Values
10
+ {
11
+ /**
12
+ * Constructor
13
+ *
14
+ * @since 1.4.4
15
+ */
16
+ function __construct()
17
+ {
18
+ parent::__construct();
19
+
20
+ add_action( 'manage_link_custom_column', array( $this, 'manage_link_column_value'), 10, 2 );
21
+ }
22
+
23
+ /**
24
+ * Manage custom column for Links
25
+ *
26
+ * @since 1.3.1
27
+ */
28
+ public function manage_link_column_value( $column_name, $link_id )
29
+ {
30
+ $type = $column_name;
31
+
32
+ // links object... called bookmark
33
+ $bookmark = get_bookmark($link_id);
34
+
35
+ // Hook
36
+ do_action('cpac-manage-link-column', $type, $column_name, $link_id);
37
+
38
+ $result = '';
39
+ switch ($type) :
40
+
41
+ // link id
42
+ case "column-link_id" :
43
+ $result = $link_id;
44
+ break;
45
+
46
+ // description
47
+ case "column-description" :
48
+ $result = $bookmark->link_description;
49
+ break;
50
+
51
+ // target
52
+ case "column-target" :
53
+ $result = $bookmark->link_target;
54
+ break;
55
+
56
+ // notes
57
+ case "column-notes" :
58
+ $result = $this->get_shortened_string($bookmark->link_notes, $this->excerpt_length);
59
+ break;
60
+
61
+ // rss
62
+ case "column-rss" :
63
+ $result = $this->get_shorten_url($bookmark->link_rss);
64
+ break;
65
+
66
+ // image
67
+ case "column-image" :
68
+ $result = $this->get_thumbnail($bookmark->link_image);
69
+ break;
70
+
71
+ // name length
72
+ case "column-length" :
73
+ $result = strlen($bookmark->link_name);
74
+ break;
75
+
76
+ // owner
77
+ case "column-owner" :
78
+ $result = $bookmark->link_owner;
79
+
80
+ // add user link
81
+ $userdata = get_userdata( $bookmark->link_owner );
82
+ if (!empty($userdata->data)) {
83
+ $result = $userdata->data->user_nicename;
84
+ //$result = "<a href='user-edit.php?user_id={$bookmark->link_owner}'>{$result}</a>";
85
+ }
86
+ break;
87
+
88
+ default :
89
+ $result = '';
90
+
91
+ endswitch;
92
+
93
+ echo $result;
94
+ }
95
+ }
96
+
97
+ ?>
classes/values/media.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CPAC_Media_Values Class
5
+ *
6
+ * @since 1.4.4
7
+ *
8
+ */
9
+ class CPAC_Media_Values extends CPAC_Values
10
+ {
11
+ /**
12
+ * Constructor
13
+ *
14
+ * @since 1.4.4
15
+ */
16
+ function __construct()
17
+ {
18
+ parent::__construct();
19
+
20
+ add_action( 'manage_media_custom_column', array( $this, 'manage_media_column_value'), 10, 2 );
21
+ }
22
+
23
+ /**
24
+ * Manage custom column for Media.
25
+ *
26
+ * @since 1.3
27
+ */
28
+ public function manage_media_column_value( $column_name, $media_id )
29
+ {
30
+ $type = $column_name;
31
+
32
+ //$meta = wp_get_attachment_metadata($media_id);
33
+ $meta = get_post_meta( $media_id, '_wp_attachment_metadata', true );
34
+ $p = get_post($media_id);
35
+
36
+ // Check for custom fields, such as column-meta-[customfieldname]
37
+ if ( $this->is_column_meta($type) )
38
+ $type = 'column-meta';
39
+
40
+ // Hook
41
+ do_action('cpac-manage-media-column', $type, $column_name, $media_id);
42
+
43
+ $result = '';
44
+ switch ($type) :
45
+
46
+ // media id
47
+ case "column-mediaid" :
48
+ $result = $media_id;
49
+ break;
50
+
51
+ // dimensions
52
+ case "column-dimensions" :
53
+ if ( !empty($meta['width']) && !empty($meta['height']) )
54
+ $result = "{$meta['width']} x {$meta['height']}";
55
+ break;
56
+
57
+ // width
58
+ case "column-width" :
59
+ $result = !empty($meta['width']) ? $meta['width'] : '';
60
+ break;
61
+
62
+ // height
63
+ case "column-height" :
64
+ $result = !empty($meta['height']) ? $meta['height'] : '';
65
+ break;
66
+
67
+ // description
68
+ case "column-description" :
69
+ $result = $p->post_content;
70
+ break;
71
+
72
+ // caption
73
+ case "column-caption" :
74
+ $result = $p->post_excerpt;
75
+ break;
76
+
77
+ // alternate text
78
+ case "column-alternate_text" :
79
+ $alt = get_post_meta($media_id, '_wp_attachment_image_alt', true);
80
+ $result = $this->strip_trim($alt);
81
+ break;
82
+
83
+ // mime type
84
+ case "column-mime_type" :
85
+ $result = $p->post_mime_type;
86
+ break;
87
+
88
+ // file name
89
+ case "column-file_name" :
90
+ $file = wp_get_attachment_url($p->ID);
91
+ $filename = basename($file);
92
+ $result = "<a title='{$filename}' href='{$file}'>{$filename}</a>";
93
+ break;
94
+
95
+ // file paths
96
+ case "column-file_paths" :
97
+ $sizes = get_intermediate_image_sizes();
98
+ $url = wp_get_attachment_url($p->ID);
99
+ $filename = basename($url);
100
+ $paths[] = "<a title='{$filename}' href='{$url}'>" . __('original', CPAC_TEXTDOMAIN) . "</a>";
101
+ if ( $sizes ) {
102
+ foreach ( $sizes as $size ) {
103
+ $src = wp_get_attachment_image_src( $media_id, $size );
104
+ if (!empty($src[0])) {
105
+ $filename = basename($src[0]);
106
+ $paths[] = "<a title='{$filename}' href='{$src[0]}'>{$size}</a>";
107
+ }
108
+ }
109
+ }
110
+ $result = implode('<span class="cpac-divider"></span>', $paths);
111
+ break;
112
+
113
+ // Custom Field
114
+ case "column-meta" :
115
+ $result = $this->get_column_value_custom_field($post_id, $column_name, 'post');
116
+ break;
117
+
118
+ // Image metadata EXIF or IPTC data
119
+ case "column-image-aperture" :
120
+ $result = !empty( $meta['image_meta']['aperture'] ) ? $meta['image_meta']['aperture'] : '';
121
+ break;
122
+
123
+ case "column-image-credit" :
124
+ $result = !empty( $meta['image_meta']['credit'] ) ? $meta['image_meta']['credit'] : '';
125
+ break;
126
+
127
+ case "column-image-camera" :
128
+ $result = !empty( $meta['image_meta']['camera'] ) ? $meta['image_meta']['camera'] : '';
129
+ break;
130
+
131
+ case "column-image-caption" :
132
+ $result = !empty( $meta['image_meta']['caption'] ) ? $meta['image_meta']['caption'] : '';
133
+ break;
134
+
135
+ case "column-image-created_timestamp" :
136
+ if ( !empty( $meta['image_meta']['created_timestamp'] ) ) {
137
+ $result = date_i18n( get_option('date_format') . ' ' . get_option('time_format') , strtotime($meta['image_meta']['created_timestamp']) );
138
+ }
139
+ break;
140
+
141
+ case "column-image-copyright" :
142
+ $result = !empty( $meta['image_meta']['copyright'] ) ? $meta['image_meta']['copyright'] : '';
143
+ break;
144
+
145
+ case "column-image-focal_length" :
146
+ $result = !empty( $meta['image_meta']['focal_length'] ) ? $meta['image_meta']['focal_length'] : '';
147
+ break;
148
+
149
+ case "column-image-iso" :
150
+ $result = !empty( $meta['image_meta']['iso'] ) ? $meta['image_meta']['iso'] : '';
151
+ break;
152
+
153
+ case "column-image-shutter_speed" :
154
+ $result = !empty( $meta['image_meta']['shutter_speed'] ) ? $meta['image_meta']['shutter_speed'] : '';
155
+ break;
156
+
157
+ case "column-image-title" :
158
+ $result = !empty( $meta['image_meta']['title'] ) ? $meta['image_meta']['title'] : '';
159
+ break;
160
+
161
+ default :
162
+ $result = '';
163
+
164
+ endswitch;
165
+
166
+ echo $result;
167
+ }
168
+ }
169
+
170
+ ?>
classes/values/posts.php ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CPAC_Posts_Values Class
5
+ *
6
+ * @since 1.4.4
7
+ *
8
+ */
9
+ class CPAC_Posts_Values extends CPAC_Values
10
+ {
11
+ /**
12
+ * Constructor
13
+ *
14
+ * @since 1.4.4
15
+ */
16
+ function __construct()
17
+ {
18
+ parent::__construct();
19
+
20
+ add_action( 'manage_pages_custom_column', array( $this, 'manage_posts_column_value'), 10, 2 );
21
+ add_action( 'manage_posts_custom_column', array( $this, 'manage_posts_column_value'), 10, 2 );
22
+ }
23
+
24
+ /**
25
+ * Manage custom column for Post Types.
26
+ *
27
+ * @since 1.0
28
+ */
29
+ public function manage_posts_column_value($column_name, $post_id)
30
+ {
31
+ $type = $column_name;
32
+
33
+ // Check for taxonomies, such as column-taxonomy-[taxname]
34
+ if ( strpos($type, 'column-taxonomy-') !== false )
35
+ $type = 'column-taxonomy';
36
+
37
+ // Check for custom fields, such as column-meta-[customfieldname]
38
+ if ( $this->is_column_meta($type) )
39
+ $type = 'column-post-meta';
40
+
41
+ // Hook
42
+ do_action('cpac-manage-posts-column', $type, $column_name, $post_id);
43
+
44
+ // Switch Types
45
+ $result = '';
46
+ switch ($type) :
47
+
48
+ // Post ID
49
+ case "column-postid" :
50
+ $result = $post_id;
51
+ break;
52
+
53
+ // Excerpt
54
+ case "column-excerpt" :
55
+ $result = $this->get_post_excerpt($post_id);
56
+ break;
57
+
58
+ // Featured Image
59
+ case "column-featured_image" :
60
+ if ( function_exists('has_post_thumbnail') && has_post_thumbnail($post_id) )
61
+ $result = get_the_post_thumbnail($post_id, array(80,80));
62
+ break;
63
+
64
+ // Sticky Post
65
+ case "column-sticky" :
66
+ if ( is_sticky($post_id) )
67
+ $result = $this->get_asset_image('checkmark.png');
68
+ break;
69
+
70
+ // Order
71
+ case "column-order" :
72
+ $result = get_post_field('menu_order', $post_id);
73
+ break;
74
+
75
+ // Post Formats
76
+ case "column-post_formats" :
77
+ $result = get_post_format($post_id);
78
+ break;
79
+
80
+ // Page template
81
+ case "column-page-template" :
82
+ // file name
83
+ $page_template = get_post_meta($post_id, '_wp_page_template', true);
84
+
85
+ // get template nice name
86
+ $result = array_search($page_template, get_page_templates());
87
+ break;
88
+
89
+ // Slug
90
+ case "column-page-slug" :
91
+ $result = get_post($post_id)->post_name;
92
+ break;
93
+
94
+ // Slug
95
+ case "column-word-count" :
96
+ $result = str_word_count( $this->strip_trim( get_post($post_id)->post_content ) );
97
+ break;
98
+
99
+ // Taxonomy
100
+ case "column-taxonomy" :
101
+ $tax = str_replace('column-taxonomy-', '', $column_name);
102
+ $tags = get_the_terms($post_id, $tax);
103
+ $tarr = array();
104
+
105
+ // for post formats we will display standard instead of empty
106
+ if ( $tax == 'post_format' && empty($tags) ) {
107
+ $result = __('Standard');
108
+ }
109
+
110
+ // add name with link
111
+ elseif ( !empty($tags) ) {
112
+ $post_type = get_post_type($post_id);
113
+ foreach($tags as $tag) {
114
+ // sanatize title
115
+ if ( isset($tag->term_id) ) {
116
+ $tax_title = esc_html(sanitize_term_field('name', $tag->name, $tag->term_id, $tag->taxonomy, 'edit'));
117
+ $tarr[] = "<a href='edit.php?post_type={$post_type}&{$tag->taxonomy}={$tag->slug}'>{$tax_title}</a>";
118
+ }
119
+ }
120
+ $result = implode(', ', $tarr);
121
+ }
122
+ break;
123
+
124
+ // Custom Field
125
+ case "column-post-meta" :
126
+ $result = $this->get_column_value_custom_field($post_id, $column_name, 'post');
127
+ break;
128
+
129
+ // Attachment
130
+ case "column-attachment" :
131
+ $result = $this->get_column_value_attachments($post_id);
132
+ break;
133
+
134
+ // Attachment count
135
+ case "column-attachment-count" :
136
+ $result = count($this->get_attachment_ids($post_id));
137
+ break;
138
+
139
+ // Roles
140
+ case "column-roles" :
141
+ $user_id = get_post($post_id)->post_author;
142
+ $userdata = get_userdata( $user_id );
143
+ if ( !empty($userdata->roles[0]) )
144
+ echo implode(', ',$userdata->roles);
145
+ break;
146
+
147
+ // Post status
148
+ case "column-status" :
149
+ $p = get_post($post_id);
150
+ $result = $p->post_status;
151
+ if ( $result == 'future')
152
+ $result = $result . " <p class='description'>" . date_i18n( get_option('date_format') . ' ' . get_option('time_format') , strtotime($p->post_date) ) . "</p>";
153
+ break;
154
+
155
+ // Post comment status
156
+ case "column-comment-status" :
157
+ $p = get_post($post_id);
158
+ $result = $this->get_asset_image('no.png', $p->comment_status);
159
+ if ( $p->comment_status == 'open' )
160
+ $result = $this->get_asset_image('checkmark.png', $p->comment_status);
161
+ break;
162
+
163
+ // Post ping status
164
+ case "column-ping-status" :
165
+ $p = get_post($post_id);
166
+ $result = $this->get_asset_image('no.png', $p->ping_status);
167
+ if ( $p->ping_status == 'open' )
168
+ $result = $this->get_asset_image('checkmark.png', $p->ping_status);
169
+ break;
170
+
171
+ // Post actions ( delete, edit etc. )
172
+ case "column-actions" :
173
+ $result = $this->get_column_value_actions($post_id, 'posts');
174
+ break;
175
+
176
+ // Post Last modified
177
+ case "column-modified" :
178
+ $p = get_post($post_id);
179
+ $result = $this->get_date($p->post_modified) . ' ' . $this->get_time($p->post_modified);
180
+ break;
181
+
182
+ // Post Comment count
183
+ case "column-comment-count" :
184
+ $result = WP_List_Table::comments_bubble( $post_id, get_pending_comments_num( $post_id ) );
185
+ $result .= $this->get_comment_count_details( $post_id );
186
+
187
+ break;
188
+
189
+ default :
190
+ $result = '';
191
+
192
+ endswitch;
193
+
194
+ echo $result;
195
+ }
196
+
197
+ /**
198
+ * Comment count extended
199
+ *
200
+ * @since 1.4.4
201
+ */
202
+ private function get_comment_count_details( $post_id )
203
+ {
204
+ $c = wp_count_comments($post_id);
205
+
206
+ $details = '';
207
+ if ( $c->approved ) {
208
+ $url = esc_url( add_query_arg( array('p' => $post_id, 'comment_status' => 'approved'), admin_url( 'edit-comments.php' ) ) );
209
+ $details .= "<a href='{$url}' class='cp-approved' title='".__('approved', CPAC_TEXTDOMAIN) . "'>{$c->approved}</a>";
210
+ }
211
+ if ( $c->moderated ) {
212
+ $url = esc_url( add_query_arg( array('p' => $post_id, 'comment_status' => 'moderated'), admin_url( 'edit-comments.php' ) ) );
213
+ $details .= "<a href='{$url}' class='cp-moderated' title='".__('pending', CPAC_TEXTDOMAIN) . "'>{$c->moderated}</a>";
214
+ }
215
+ if ( $c->spam ) {
216
+ $url = esc_url( add_query_arg( array('p' => $post_id, 'comment_status' => 'spam'), admin_url( 'edit-comments.php' ) ) );
217
+ $details .= "<a href='{$url}' class='cp-spam' title='".__('spam', CPAC_TEXTDOMAIN) . "'>{$c->spam}</a>";
218
+ }
219
+ if ( $c->trash ) {
220
+ $url = esc_url( add_query_arg( array('p' => $post_id, 'comment_status' => 'trash'), admin_url( 'edit-comments.php' ) ) );
221
+ $details .= "<a href='{$url}' class='cp-trash' title='".__('trash', CPAC_TEXTDOMAIN) . "'>{$c->trash}</a>";
222
+ }
223
+
224
+ if ( $details )
225
+ return "<p class='description row-actions'>{$details}</p>";
226
+
227
+ return false;
228
+ }
229
+ }
230
+
231
+ ?>
classes/values/users.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CPAC_Users_Values Class
5
+ *
6
+ * @since 1.4.4
7
+ *
8
+ */
9
+ class CPAC_Users_Values extends CPAC_Values
10
+ {
11
+ /**
12
+ * Constructor
13
+ *
14
+ * @since 1.4.4
15
+ */
16
+ function __construct()
17
+ {
18
+ parent::__construct();
19
+
20
+ add_filter( 'manage_users_custom_column', array( $this, 'manage_users_column_value'), 10, 3 );
21
+ }
22
+
23
+ /**
24
+ * Manage custom column for Users.
25
+ *
26
+ * @since 1.1
27
+ */
28
+ public function manage_users_column_value( $value, $column_name, $user_id )
29
+ {
30
+ $type = $column_name;
31
+
32
+ $userdata = get_userdata( $user_id );
33
+
34
+ if ( ! $userdata )
35
+ return false;
36
+
37
+ // Check for user custom fields: column-meta-[customfieldname]
38
+ if ( $this->is_column_meta($type) )
39
+ $type = 'column-user-meta';
40
+
41
+ // Check for post count: column-user_postcount-[posttype]
42
+ if ( $this->get_posttype_by_postcount_column($type) )
43
+ $type = 'column-user_postcount';
44
+
45
+ // Hook
46
+ do_action('cpac-manage-users-column', $type, $column_name, $user_id);
47
+
48
+ $result = '';
49
+ switch ($type) :
50
+
51
+ // user id
52
+ case "column-user_id" :
53
+ $result = $user_id;
54
+ break;
55
+
56
+ // first name
57
+ case "column-nickname" :
58
+ $result = $userdata->nickname;
59
+ break;
60
+
61
+ // first name
62
+ case "column-first_name" :
63
+ $result = $userdata->first_name;
64
+ break;
65
+
66
+ // last name
67
+ case "column-last_name" :
68
+ $result = $userdata->last_name;
69
+ break;
70
+
71
+ // user url
72
+ case "column-user_url" :
73
+ $result = $userdata->user_url;
74
+ break;
75
+
76
+ // user registration date
77
+ case "column-user_registered" :
78
+ $result = $userdata->user_registered;
79
+ break;
80
+
81
+ // user description
82
+ case "column-user_description" :
83
+ $result = $this->get_shortened_string( get_the_author_meta('user_description', $user_id), $this->excerpt_length );
84
+ break;
85
+
86
+ // user description
87
+ case "column-user_postcount" :
88
+ $post_type = $this->get_posttype_by_postcount_column($column_name);
89
+
90
+ // get post count
91
+ $count = $this->get_post_count( $post_type, $user_id );
92
+
93
+ // set result
94
+ $result = $count > 0 ? "<a href='edit.php?post_type={$post_type}&author={$user_id}'>{$count}</a>" : (string) $count;
95
+ break;
96
+
97
+ // user actions
98
+ case "column-actions" :
99
+ $result = $this->get_column_value_actions($user_id, 'users');
100
+ break;
101
+
102
+ // user meta data ( custom field )
103
+ case "column-user-meta" :
104
+ $result = $this->get_column_value_custom_field($user_id, $column_name, 'user');
105
+ break;
106
+
107
+ default :
108
+ $result = '';
109
+
110
+ endswitch;
111
+
112
+ return $result;
113
+ }
114
+ }
115
+
116
+ ?>
codepress-admin-columns.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /*
3
  Plugin Name: Codepress Admin Columns
4
- Version: 1.1.3
5
- Description: This plugin makes it easy to Manage Custom Columns for your Posts, Pages and Custom Post Type Screens.
6
  Author: Codepress
7
  Author URI: http://www.codepress.nl
8
  Plugin URI: http://www.codepress.nl/plugins/codepress-admin-columns/
@@ -26,73 +26,95 @@ 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.1.3' );
 
 
 
 
 
 
 
30
 
31
  /**
32
- * Init Class
33
  *
34
- * @since 1.0
35
  */
36
- new Codepress_Admin_Columns();
 
 
 
 
 
 
37
 
38
  /**
39
- * Advanced Admin Columns Class
40
  *
41
  * @since 1.0
42
  *
43
  */
44
  class Codepress_Admin_Columns
45
  {
46
- private $post_types,
47
- $options,
48
- $options_default,
49
- $slug,
50
- $textdomain;
51
 
52
  /**
53
- * Construct
54
  *
55
  * @since 1.0
56
  */
57
  function __construct()
58
- {
59
- add_action( 'wp_loaded', array( &$this, 'init') );
 
 
 
60
  }
61
 
62
  /**
63
- * Initilize plugin.
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
- $this->handle_requests();
74
- $this->options = get_option('cpac_options');
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
- // actions and hooks
85
- add_action( 'admin_menu', array( &$this, 'settings_menu') );
86
- add_action( 'admin_init', array( &$this, 'register_settings') );
87
- add_action( 'admin_init', array( &$this, 'register_columns' ) );
88
- add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts') );
89
- add_action( 'manage_pages_custom_column', array( &$this, 'manage_posts_column_value'), 10, 2 );
90
- add_action( 'manage_posts_custom_column', array( &$this, 'manage_posts_column_value'), 10, 2 );
91
- add_action( 'manage_users_custom_column', array( &$this, 'manage_users_column_value'), 10, 3 );
92
- add_action( 'admin_print_styles' , array( &$this, 'column_styles') );
93
- add_filter( 'request', array( &$this, 'handle_requests_orderby_column') );
94
- add_filter( 'plugin_action_links', array( &$this, 'add_settings_link'), 10, 2);
95
- }
 
 
 
 
 
 
 
 
 
 
96
 
97
  /**
98
  * Admin Menu.
@@ -105,20 +127,27 @@ class Codepress_Admin_Columns
105
  {
106
  $page = add_options_page(
107
  // Page title
108
- esc_html__( 'Admin Columns Settings', $this->textdomain ),
109
  // Menu Title
110
- esc_html__( 'Admin Columns', $this->textdomain ),
111
  // Capability
112
  'manage_options',
113
  // Menu slug
114
- $this->slug,
115
  // Callback
116
- array( &$this, 'plugin_settings_page')
117
  );
118
 
119
- // css scripts
120
- add_action( "admin_print_styles-$page", array( &$this, 'admin_styles') );
121
- }
 
 
 
 
 
 
 
122
 
123
  /**
124
  * Add Settings link to plugin page
@@ -130,30 +159,53 @@ class Codepress_Admin_Columns
130
  if ( $file != plugin_basename( __FILE__ ))
131
  return $links;
132
 
133
- array_unshift($links, '<a href="' . admin_url("admin.php") . '?page=' . $this->slug . '">' . __( 'Settings' ) . '</a>');
134
  return $links;
135
  }
136
 
137
  /**
138
- * Register Columns
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  *
140
  * @since 1.0
141
  */
142
- public function register_columns()
143
  {
144
- /** Posts */
145
- foreach ( $this->post_types as $post_type ) {
146
-
147
  // register column per post type
148
- add_filter("manage_edit-{$post_type}_columns", array(&$this, 'callback_add_posts_column'));
149
-
150
- // register column as sortable
151
- add_filter( "manage_edit-{$post_type}_sortable_columns", array(&$this, 'callback_add_sortable_posts_column'));
152
- }
153
 
154
  /** Users */
155
- add_filter( "manage_users_columns", array(&$this, 'callback_add_users_column'));
156
- add_filter( "manage_users_sortable_columns", array(&$this, 'callback_add_sortable_users_column') );
 
 
 
 
 
 
 
 
 
157
  }
158
 
159
  /**
@@ -161,21 +213,51 @@ class Codepress_Admin_Columns
161
  *
162
  * @since 1.0
163
  */
164
- public function callback_add_posts_column($columns)
165
- {
166
- global $post_type;
167
-
168
- return $this->add_managed_columns($post_type, $columns);
169
- }
170
 
171
  /**
172
  * Callback add Users column
173
  *
174
  * @since 1.1
175
  */
176
- public function callback_add_users_column($columns)
177
- {
178
- return $this->add_managed_columns('wp-users', $columns);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  }
180
 
181
  /**
@@ -183,19 +265,19 @@ class Codepress_Admin_Columns
183
  *
184
  * @since 1.1
185
  */
186
- private function add_managed_columns( $type = 'post', $columns )
187
- {
188
- $db_columns = $this->get_stored_columns($type);
189
-
 
190
  if ( !$db_columns )
191
  return $columns;
 
 
 
192
 
193
- // set already loaded columns by plugins
194
- $set_columns = $this->filter_preset_columns($columns, $type);
195
-
196
  // loop through columns
197
- foreach ( $db_columns as $id => $values ) {
198
-
199
  // is active
200
  if ( isset($values['state']) && $values['state'] == 'on' ){
201
 
@@ -208,47 +290,32 @@ class Codepress_Admin_Columns
208
  }
209
 
210
  /**
211
- * Callback add Posts sortable column
212
- *
213
- * @since 1.0
214
- */
215
- public function callback_add_sortable_posts_column($columns)
216
- {
217
- global $post_type;
218
-
219
- return $this->add_managed_sortable_columns($post_type, $columns);
220
- }
221
-
222
- /**
223
- * Callback add Users sortable column
224
  *
225
- * @since 1.1
226
  */
227
- public function callback_add_sortable_users_column($columns)
228
  {
229
- return $this->add_managed_sortable_columns('wp-users', $columns);
230
- }
231
-
232
- /**
233
- * Add managed sortable columns by Type
234
- *
235
- * @since 1.1
236
- */
237
- private function add_managed_sortable_columns( $type = 'post', $columns )
238
- {
239
- $display_columns = $this->get_merged_columns($type);
240
-
241
- if ( ! $display_columns )
242
  return $columns;
243
 
244
- foreach ( $display_columns as $id => $vars ) {
245
- if ( isset($vars['options']['sortorder']) && $vars['options']['sortorder'] == 'on' ){
246
-
247
- // register format
248
- $columns[$id] = $this->sanitize_string($vars['label']);
 
 
 
 
 
 
249
  }
250
- }
251
- return $columns;
 
252
  }
253
 
254
  /**
@@ -276,8 +343,8 @@ class Codepress_Admin_Columns
276
 
277
  // custom field button
278
  $button_add_column = '';
279
- if ( $this->get_postmeta_by_posttype($type) )
280
- $button_add_column = "<a href='javacript:;' class='cpac-add-customfield-column button'>+ " . __('Add Custom Field Column') . "</a>";
281
 
282
  return "
283
  <div class='cpac-box'>
@@ -285,7 +352,7 @@ class Codepress_Admin_Columns
285
  {$list}
286
  </ul>
287
  {$button_add_column}
288
- <div class='cpac-reorder-msg'></div>
289
  </div>
290
  ";
291
  }
@@ -295,28 +362,62 @@ class Codepress_Admin_Columns
295
  *
296
  * @since 1.0
297
  */
298
- private function get_merged_columns( $type )
299
- {
300
- //get saved database columns
301
- $db_columns = $this->get_stored_columns($type);
 
 
 
 
 
 
 
 
 
302
 
303
  /** Users */
304
- if ( $type == 'wp-users' ) {
305
  $wp_default_columns = $this->get_wp_default_users_columns();
306
  $wp_custom_columns = $this->get_custom_users_columns();
307
  }
308
 
 
 
 
 
 
 
309
  /** Posts */
310
  else {
311
  $wp_default_columns = $this->get_wp_default_posts_columns($type);
312
  $wp_custom_columns = $this->get_custom_posts_columns($type);
313
  }
 
 
 
 
 
 
314
 
 
 
 
 
 
 
 
315
  // merge columns
316
- $posts_columns = wp_parse_args($wp_custom_columns, $wp_default_columns);
317
-
318
- // loop throught the active columns
 
319
  if ( $db_columns ) {
 
 
 
 
 
320
  foreach ( $db_columns as $id => $values ) {
321
 
322
  // get column meta options from custom columns
@@ -324,17 +425,40 @@ class Codepress_Admin_Columns
324
  $db_columns[$id]['options'] = $wp_custom_columns['column-meta-1']['options'];
325
 
326
  // add static options
327
- else
328
- $db_columns[$id]['options'] = $posts_columns[$id]['options'];
329
 
330
- unset($posts_columns[$id]);
331
  }
332
  }
333
 
334
  // merge all
335
- $display_columns = wp_parse_args($db_columns, $posts_columns);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
 
337
- return $display_columns;
338
  }
339
 
340
  /**
@@ -342,7 +466,7 @@ class Codepress_Admin_Columns
342
  *
343
  * @since 1.0
344
  */
345
- private function get_box($post_type, $id, $values)
346
  {
347
  $classes = array();
348
 
@@ -358,30 +482,44 @@ class Codepress_Admin_Columns
358
  $class = implode(' ', $classes);
359
 
360
  // more box options
361
- $more_options = $this->get_additional_box_options($post_type, $id, $values);
362
  $action = "<a class='cpac-action' href='#open'>open</a>";
 
 
 
 
 
 
 
 
 
 
363
 
364
  // hide box options
365
- if ( ! empty($values['options']['hide_options']) ) {
366
- $action = $more_options = '';
 
367
  }
368
 
369
  $list = "
370
  <li class='{$class}'>
371
- <div class='cpac-sort-handle'></div>
372
- <div class='cpac-type-options'>
373
-
374
  <div class='cpac-checkbox'></div>
375
- <input type='hidden' class='cpac-state' name='cpac_options[columns][{$post_type}][{$id}][state]' value='{$state}'/>
376
- <label class='main-label'>{$values['label']}</label>
377
  </div>
378
  <div class='cpac-meta-title'>
379
  {$action}
380
- <span>{$values['options']['type_label']}</span>
381
  </div>
382
  <div class='cpac-type-inside'>
383
- <label for='cpac_options[columns][{$post_type}][{$id}][label]'>Label: </label>
384
- <input type='text' name='cpac_options[columns][{$post_type}][{$id}][label]' value='{$values['label']}' class='text'/>
 
 
 
 
385
  <br/>
386
  {$more_options}
387
  </div>
@@ -396,13 +534,13 @@ class Codepress_Admin_Columns
396
  *
397
  * @since 1.0
398
  */
399
- private function get_additional_box_options($post_type, $id, $values)
400
  {
401
  $fields = '';
402
 
403
- // Custom Fields
404
  if ( $this->is_column_meta($id) )
405
- $fields .= $this->get_box_options_customfields($post_type, $id, $values);
406
 
407
  return $fields;
408
  }
@@ -412,10 +550,10 @@ class Codepress_Admin_Columns
412
  *
413
  * @since 1.0
414
  */
415
- private function get_box_options_customfields($post_type, $id, $values)
416
  {
417
  // get post meta fields
418
- $fields = $this->get_postmeta_by_posttype($post_type);
419
 
420
  if ( empty($fields) )
421
  return false;
@@ -439,10 +577,12 @@ class Codepress_Admin_Columns
439
  $fieldtypes = array(
440
  '' => __('Default'),
441
  'image' => __('Image'),
442
- 'library_id' => __('Media Library Icon', $this->textdomain),
443
  'excerpt' => __('Excerpt'),
444
- 'array' => __('Multiple Values', $this->textdomain),
445
- 'numeric' => __('Numeric', $this->textdomain),
 
 
446
  );
447
 
448
  // add filter
@@ -467,7 +607,7 @@ class Codepress_Admin_Columns
467
  return false;
468
 
469
  // add remove button
470
- $remove = '<p class="remove-description description">'.__('This field can not be removed', $this->textdomain).'</p>';
471
  if ( $id != 'column-meta-1') {
472
  $remove = "
473
  <p>
@@ -477,17 +617,17 @@ class Codepress_Admin_Columns
477
  }
478
 
479
  $inside = "
480
- <label for='cpac_options[columns][{$post_type}][{$id}][field]'>Custom Field: </label>
481
- <select name='cpac_options[columns][{$post_type}][{$id}][field]'>{$field_options}</select>
482
  <br/>
483
- <label for='cpac_options[columns][{$post_type}][{$id}][field_type]'>Field Type: </label>
484
- <select name='cpac_options[columns][{$post_type}][{$id}][field_type]'>{$fieldtype_options}</select>
485
  <br/>
486
- <label for='cpac_options[columns][{$post_type}][{$id}][before]'>Before: </label>
487
- <input type='text' class='cpac-before' name='cpac_options[columns][{$post_type}][{$id}][before]' value='{$before}'/>
488
  <br/>
489
- <label for='cpac_options[columns][{$post_type}][{$id}][before]'>After: </label>
490
- <input type='text' class='cpac-after' name='cpac_options[columns][{$post_type}][{$id}][after]' value='{$after}'/>
491
  <br/>
492
  {$remove}
493
  ";
@@ -496,17 +636,37 @@ class Codepress_Admin_Columns
496
  }
497
 
498
  /**
499
- * Get post meta fields by post type
500
  *
501
  * @since 1.0
502
  */
503
- private function get_postmeta_by_posttype($post_type)
504
  {
505
  global $wpdb;
506
- // get mata fields
507
- $sql = 'SELECT DISTINCT meta_key FROM '.$wpdb->postmeta.' pm JOIN '.$wpdb->posts.' p ON pm.post_id = p.ID WHERE p.post_type = "' . mysql_real_escape_string($post_type) . '" ORDER BY 1';
508
- $fields = $wpdb->get_results($sql, ARRAY_N);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
 
 
 
 
510
  // postmeta
511
  if ( $fields ) {
512
  $meta_fields = array();
@@ -516,9 +676,8 @@ class Codepress_Admin_Columns
516
  $meta_fields[] = $field[0];
517
  }
518
  }
519
-
520
  return $meta_fields;
521
- }
522
 
523
  return false;
524
  }
@@ -528,11 +687,11 @@ class Codepress_Admin_Columns
528
  *
529
  * @since 1.0
530
  */
531
- public function admin_enqueue_scripts()
532
  {
533
- wp_enqueue_script( 'dashboard' );
534
- wp_enqueue_script( 'jquery-ui-sortable' );
535
- wp_enqueue_script( 'cpac-admin', $this->plugin_url('/assets/js/admin-column.js'), array('jquery', 'jquery-ui-sortable'), CPAC_VERSION );
536
  }
537
 
538
  /**
@@ -542,8 +701,11 @@ class Codepress_Admin_Columns
542
  */
543
  private function get_types()
544
  {
545
- $types = $this->post_types;
546
- $types['wp-users'] = 'wp-users';
 
 
 
547
 
548
  return $types;
549
  }
@@ -553,7 +715,7 @@ class Codepress_Admin_Columns
553
  *
554
  * @since 1.0
555
  */
556
- private function get_post_types()
557
  {
558
  $post_types = get_post_types(array(
559
  '_builtin' => false
@@ -561,7 +723,7 @@ class Codepress_Admin_Columns
561
  $post_types['post'] = 'post';
562
  $post_types['page'] = 'page';
563
 
564
- return $post_types;
565
  }
566
 
567
  /**
@@ -571,7 +733,8 @@ class Codepress_Admin_Columns
571
  */
572
  public function admin_styles()
573
  {
574
- wp_enqueue_style( 'cpac-admin', $this->plugin_url('/assets/css/admin-column.css'), array(), CPAC_VERSION, 'all' );
 
575
  }
576
 
577
  /**
@@ -581,7 +744,7 @@ class Codepress_Admin_Columns
581
  */
582
  public function column_styles()
583
  {
584
- wp_enqueue_style( 'cpac-columns', $this->plugin_url('/assets/css/column.css'), array(), CPAC_VERSION, 'all' );
585
  }
586
 
587
  /**
@@ -592,10 +755,10 @@ class Codepress_Admin_Columns
592
  public function register_settings()
593
  {
594
  // If we have no options in the database, let's add them now.
595
- if ( false === $this->options )
596
- add_option( 'cpac_options', array(&$this, 'get_default_plugin_options') );
597
 
598
- register_setting( 'cpac-settings-group', 'cpac_options', array(&$this, 'options_callback') );
599
  }
600
 
601
  /**
@@ -627,29 +790,48 @@ class Codepress_Admin_Columns
627
  *
628
  * @since 1.0
629
  */
630
- private function handle_requests()
631
  {
632
  // settings updated
633
- if ( ! empty($_REQUEST['settings-updated']) ) {
634
-
635
- // stores the default columns that are set by WP or set in the theme.
636
- $wp_default_columns = array();
637
-
638
- // Posts
639
- foreach ( $this->post_types as $post_type ) {
640
- $wp_default_columns[$post_type] = $this->get_wp_default_posts_columns($post_type);
641
- }
642
-
643
- // Users
644
- $wp_default_columns['wp-users'] = $this->get_wp_default_users_columns();
645
-
646
- update_option( 'cpac_options_default', $wp_default_columns );
647
- }
648
 
649
  // restore defaults
650
- if ( ! empty($_REQUEST['cpac-restore-defaults']) ) {
651
  $this->restore_defaults();
652
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
653
  }
654
 
655
  /**
@@ -660,403 +842,222 @@ class Codepress_Admin_Columns
660
  private function restore_defaults()
661
  {
662
  delete_option( 'cpac_options' );
663
- delete_option( 'cpac_options_default' );
664
- }
665
-
666
  /**
667
- * Returns excerpt
668
  *
669
- * @since 1.0
670
  */
671
- private function get_post_excerpt($post_id, $charlength = 100)
672
  {
673
- global $post;
674
- $save_post = $post;
675
- $post = get_post($post_id);
676
- $excerpt = get_the_excerpt();
677
- $post = $save_post;
678
 
679
- $output = $this->get_shortened_string($excerpt, $charlength );
 
 
 
 
 
 
 
 
 
 
 
 
680
 
681
- return $output;
682
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
683
 
 
 
 
 
 
 
684
  /**
685
- * Returns shortened string
686
  *
687
- * @since 1.0
688
  */
689
- private function get_shortened_string($string = '', $charlength = 100)
690
  {
691
- if (!$string)
692
- return false;
 
 
 
 
 
693
 
694
- $output = '';
695
- if ( strlen($string) > $charlength ) {
696
- $subex = substr($string,0,$charlength-5);
697
- $exwords = explode(" ",$subex);
698
- $excut = -(strlen($exwords[count($exwords)-1]));
699
- $output .= $excut < 0 ? substr($subex,0,$excut) : $subex;
700
- $output .= "[...]";
701
- } else {
702
- $output = $string;
 
 
 
 
 
 
 
 
 
 
 
 
 
703
  }
704
- return $output;
705
  }
706
-
707
  /**
708
- * Manage custom column for Post Types.
709
  *
710
- * @since 1.0
711
  */
712
- public function manage_posts_column_value($column_name, $post_id)
713
  {
714
- $type = $column_name;
715
-
716
- // Check for taxonomies, such as column-taxonomy-[taxname]
717
- if ( strpos($type, 'column-taxonomy-') !== false )
718
- $type = 'column-taxonomy';
719
-
720
- // Check for custom fields, such as column-meta-[customfieldname]
721
- if ( $this->is_column_meta($type) )
722
- $type = 'column-meta';
723
 
724
- // Hook
725
- do_action('cpac-manage-column', $type, $column_name, $post_id);
726
-
727
- // Switch Types
728
- $result = '';
729
- switch ($type) :
730
-
731
- // Post ID
732
- case "column-postid" :
733
- $result = $post_id;
734
- break;
735
-
736
- // Excerpt
737
- case "column-excerpt" :
738
- $result = $this->get_post_excerpt($post_id);
739
- break;
740
-
741
- // Featured Image
742
- case "column-featured_image" :
743
- $result = get_the_post_thumbnail($post_id, array(80,80));
744
- break;
745
-
746
- // Sticky Post
747
- case "column-sticky" :
748
- if ( is_sticky($post_id) ) {
749
- $src = $this->plugin_url('assets/images/checkmark.png');
750
- $result = "<img alt='sticky' src='{$src}' />";
751
- }
752
- break;
753
-
754
- // Order
755
- case "column-order" :
756
- $result = get_post_field('menu_order', $post_id);
757
- break;
758
-
759
- // Post Formats
760
- case "column-post_formats" :
761
- $result = get_post_format($post_id);
762
- break;
763
-
764
- // Page template
765
- case "column-page-template" :
766
- // file name
767
- $page_template = get_post_meta($post_id, '_wp_page_template', true);
768
- // all page templates
769
- $templates = get_page_templates();
770
- // template name
771
- $result = array_search($page_template, $templates);
772
- break;
773
-
774
- // Slug
775
- case "column-page-slug" :
776
- $result = get_post($post_id)->post_name;
777
- break;
778
-
779
- // Slug
780
- case "column-word-count" :
781
- $result = str_word_count( strip_tags( get_post($post_id)->post_content ) );
782
- break;
783
-
784
- // Taxonomy
785
- case "column-taxonomy" :
786
- $tax = str_replace('column-taxonomy-', '', $column_name);
787
- $tags = get_the_terms($post_id, $tax);
788
- $tarr = array();
789
- if ( $tax == 'post_format' && empty($tags) ) {
790
- $result = __('Standard');
791
- }
792
- elseif ( !empty($tags) ) {
793
- foreach($tags as $tag) {
794
- $tarr[] = $tag->name;
795
- }
796
- $result = implode(', ', $tarr);
797
- }
798
- break;
799
-
800
- // Custom Field
801
- case "column-meta" :
802
- $result = $this->get_column_value_custom_field($post_id, $column_name);
803
- break;
804
-
805
- // Attachment
806
- case "column-attachment" :
807
- $result = $this->get_column_value_attachments($post_id);
808
- break;
809
-
810
- default :
811
- $result = get_post_meta( $post_id, $column_name, true );
812
-
813
- endswitch;
814
-
815
- if ( empty($result) )
816
- echo '&nbsp;';
817
 
818
- echo $result;
819
- }
820
-
821
- /**
822
- * Manage custom column for Users.
823
- *
824
- * @since 1.1
825
- */
826
- public function manage_users_column_value( $val, $column_name, $user_id )
827
- {
828
- $type = $column_name;
829
 
830
- $userdata = get_userdata( $user_id );
831
-
832
- if ( ! $userdata )
833
- return false;
834
 
835
- $result = '';
836
- switch ($type) :
837
-
838
- // user id
839
- case "column-user_id" :
840
- $result = $user_id;
841
- break;
842
-
843
- // first name
844
- case "column-first_name" :
845
- $result = $userdata->first_name;
846
- break;
847
-
848
- // last name
849
- case "column-last_name" :
850
- $result = $userdata->last_name;
851
- break;
852
-
853
- // user url
854
- case "column-user_url" :
855
- $result = $userdata->user_url;
856
- break;
857
-
858
- // user url
859
- case "column-user_registered" :
860
- $result = $userdata->user_registered;
861
- break;
862
-
863
- default :
864
- $result = get_user_meta( $user_id, $column_name, true );
865
-
866
- endswitch;
867
 
868
- if ( empty($result) )
869
- $result = '&nbsp;';
870
 
871
- return $result;
872
- }
873
-
874
- /**
875
- * Get column value of post attachments
876
- *
877
- * @since 1.0
878
- */
879
- private function get_column_value_attachments( $post_id )
880
- {
881
- $result = '';
882
- $attachments = get_posts(array(
883
- 'post_type' => 'attachment',
884
- 'numberposts' => -1,
885
- 'post_status' => null,
886
- 'post_parent' => $post_id
887
- ));
888
- if ( $attachments ) {
889
- foreach ( $attachments as $attach ) {
890
- $result .= wp_get_attachment_image( $attach->ID, array(80,80), true );
891
- }
892
- }
893
- return $result;
894
  }
895
 
896
  /**
897
- * Get column value of Custom Field
898
  *
899
- * @since 1.0
900
  */
901
- private function get_column_value_custom_field($post_id, $id)
902
  {
903
- $columns = $this->get_stored_columns( get_post_type($post_id) );
904
-
905
- // inputs
906
- $field = isset($columns[$id]['field']) ? $columns[$id]['field'] : '';
907
- $fieldtype = isset($columns[$id]['field_type']) ? $columns[$id]['field_type'] : '';
908
- $before = isset($columns[$id]['before']) ? $columns[$id]['before'] : '';
909
- $after = isset($columns[$id]['after']) ? $columns[$id]['after'] : '';
910
-
911
- // Get meta field value
912
- $meta = get_post_meta($post_id, $field, true);
913
-
914
- // multiple meta values
915
- if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
916
- $meta = get_post_meta($post_id, $field);
917
- $meta = $this->recursive_implode(', ', $meta);
918
- }
919
-
920
- // make sure there are no serialized arrays or empty meta data
921
- if ( empty($meta) || !is_string($meta) )
922
- return false;
923
-
924
- // handles each field type differently..
925
- switch ($fieldtype) :
926
 
927
- // Image
928
- case "image" :
929
- $meta = $this->get_thumbnail($meta);
930
- break;
931
-
932
- // Media Library ID
933
- case "library_id" :
934
- // check if media exists
935
- $meta = wp_get_attachment_url($meta) ? wp_get_attachment_image( $meta, array(80,80), true ) : '';
936
- break;
937
-
938
- // Excerpt
939
- case "excerpt" :
940
- $meta = $this->get_shortened_string($meta, 100);
941
- break;
942
-
943
- endswitch;
944
 
945
- // add before and after string
946
- $meta = "{$before}{$meta}{$after}";
947
 
948
- return $meta;
949
  }
950
-
951
- /**
952
- * Implode for multi dimensional array
953
- *
954
- * @since 1.0
955
- */
956
- private function recursive_implode( $glue, $pieces )
957
- {
958
- foreach( $pieces as $r_pieces ) {
959
- if( is_array( $r_pieces ) ) {
960
- $retVal[] = $this->recursive_implode( $glue, $r_pieces );
961
- }
962
- else {
963
- $retVal[] = $r_pieces;
964
- }
965
- }
966
- if ( isset($retVal) && is_array($retVal) )
967
- return implode( $glue, $retVal );
968
-
969
- return false;
970
- }
971
-
972
  /**
973
- * Set columns. These columns apply either for every post or set by a plugin.
974
  *
975
- * @since 1.0
976
  */
977
- private function filter_preset_columns($columns, $type = 'post')
978
  {
979
- $options = $this->options_default;
980
-
981
- if ( !$options )
982
- return $columns;
983
-
984
- // we use the wp default columns for filtering...
985
- $db_columns = $options[$type];
986
-
987
- // ... the ones that are set by plugins, theme functions and such.
988
- $dif_columns = array_diff(array_keys($columns), array_keys($db_columns));
989
-
990
- // we add those to the columns
991
- $pre_columns = array();
992
- if ( $dif_columns ) {
993
- foreach ( $dif_columns as $column ) {
994
- $pre_columns[$column] = $columns[$column];
995
- }
996
  }
997
-
998
- return $pre_columns;
999
- }
1000
-
1001
  /**
1002
- * Get WP default supported admin columns per post type.
1003
  *
1004
- * @since 1.0
1005
  */
1006
- private function get_wp_default_posts_columns($post_type = 'post')
1007
  {
1008
- // load some dependencies
1009
- if ( file_exists(ABSPATH . 'wp-admin/includes/template.php') )
1010
- require_once(ABSPATH . 'wp-admin/includes/template.php');
1011
- if ( file_exists(ABSPATH . 'wp-admin/includes/screen.php') )
1012
- require_once(ABSPATH . 'wp-admin/includes/screen.php');
1013
  if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
1014
  require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
1015
- if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php') )
1016
- require_once(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php');
1017
 
1018
- // we need to change the current screen
1019
  global $current_screen;
1020
  $org_current_screen = $current_screen;
1021
 
1022
- // overwrite current_screen global with our post type of choose...
1023
- $current_screen->post_type = $post_type;
1024
-
1025
- // ...so we can get its columns
1026
- $columns = WP_Posts_List_Table::get_columns();
1027
 
1028
- if ( empty ( $columns ) )
1029
- return false;
1030
 
1031
- // change to uniform format
1032
- $posts_columns = $this->get_uniform_format($columns);
1033
 
1034
  // reset current screen
1035
  $current_screen = $org_current_screen;
1036
 
1037
- return $posts_columns;
 
 
 
 
 
 
1038
  }
1039
 
1040
  /**
1041
- * Get WP default users columns per post type.
1042
  *
1043
- * @since 1.0
1044
  */
1045
- private function get_wp_default_users_columns()
1046
  {
1047
- require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
1048
- require_once(ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php');
1049
-
1050
- // turn off site users
1051
- $this->is_site_users = false;
1052
-
1053
- // get users columns
1054
- $columns = WP_Users_List_Table::get_columns();
1055
-
1056
- // change to uniform format
1057
- $users_columns = $this->get_uniform_format($columns);
1058
-
1059
- return $users_columns;
1060
  }
1061
 
1062
  /**
@@ -1067,7 +1068,8 @@ class Codepress_Admin_Columns
1067
  private function get_uniform_format($columns)
1068
  {
1069
  // we remove the checkbox column as an option...
1070
- unset($columns['cb']);
 
1071
 
1072
  // change to uniform format
1073
  $uniform_columns = array();
@@ -1077,13 +1079,18 @@ class Codepress_Admin_Columns
1077
 
1078
  // comment exception
1079
  if ( strpos( $label, 'comment-grey-bubble.png') ) {
1080
- $type_label = __('Comments', $this->textdomain);
1081
  $hide_options = true;
1082
  }
1083
 
 
 
 
 
 
1084
  $uniform_colums[$id] = array(
1085
  'label' => $label,
1086
- 'state' => 'on',
1087
  'options' => array(
1088
  'type_label' => $type_label,
1089
  'hide_options' => $hide_options,
@@ -1101,45 +1108,77 @@ class Codepress_Admin_Columns
1101
  */
1102
  private function get_custom_posts_columns($post_type)
1103
  {
1104
- $custom_columns = array();
1105
-
1106
- // Thumbnail support
1107
- if ( post_type_supports($post_type, 'thumbnail') ) {
1108
- $custom_columns['column-featured_image'] = array(
1109
- 'label' => __('Featured Image', $this->textdomain),
1110
- 'options' => array(
1111
- 'type_label' => __('Image', $this->textdomain)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1112
  )
1113
- );
1114
- }
 
 
 
 
 
 
1115
 
1116
- // Excerpt support
1117
  if ( post_type_supports($post_type, 'editor') ) {
1118
- $custom_columns['column-excerpt'] = array(
1119
- 'label' => __('Excerpt', $this->textdomain),
1120
- 'options' => array(
1121
- 'type_label' => __('Excerpt', $this->textdomain)
1122
- )
1123
  );
1124
  }
1125
 
1126
  // Sticky support
1127
  if ( $post_type == 'post' ) {
1128
  $custom_columns['column-sticky'] = array(
1129
- 'label' => __('Sticky', $this->textdomain),
1130
- 'options' => array(
1131
- 'type_label' => __('Sticky', $this->textdomain)
1132
- )
1133
  );
1134
  }
1135
 
1136
  // Order support
1137
  if ( post_type_supports($post_type, 'page-attributes') ) {
1138
  $custom_columns['column-order'] = array(
1139
- 'label' => __('Page Order', $this->textdomain),
1140
  'options' => array(
1141
- 'type_label' => __('Order', $this->textdomain),
1142
- 'sortorder' => 'on',
1143
  )
1144
  );
1145
  }
@@ -1147,21 +1186,14 @@ class Codepress_Admin_Columns
1147
  // Page Template
1148
  if ( $post_type == 'page' ) {
1149
  $custom_columns['column-page-template'] = array(
1150
- 'label' => __('Page Template', $this->textdomain),
1151
- 'options' => array(
1152
- 'type_label' => __('Page Template', $this->textdomain),
1153
- 'sortorder' => 'on',
1154
- )
1155
  );
1156
  }
1157
 
1158
  // Post Formats
1159
  if ( post_type_supports($post_type, 'post-formats') ) {
1160
  $custom_columns['column-post_formats'] = array(
1161
- 'label' => __('Post Format', $this->textdomain),
1162
- 'options' => array(
1163
- 'type_label' => __('Post Format', $this->textdomain)
1164
- )
1165
  );
1166
  }
1167
 
@@ -1172,61 +1204,26 @@ class Codepress_Admin_Columns
1172
  if ( $tax_slug != 'post_tag' && $tax_slug != 'category' && $tax_slug != 'post_format' ) {
1173
  $custom_columns['column-taxonomy-'.$tax->name] = array(
1174
  'label' => $tax->label,
 
1175
  'options' => array(
1176
- 'type_label' => __('Taxonomy', $this->textdomain)
1177
  )
1178
  );
1179
  }
1180
  }
1181
  }
1182
 
1183
- // Post ID support
1184
- $custom_columns['column-postid'] = array(
1185
- 'label' => 'ID',
1186
- 'options' => array(
1187
- 'type_label' => 'ID',
1188
- 'sortorder' => 'on',
1189
- )
1190
- );
1191
-
1192
- // Slug support
1193
- $custom_columns['column-page-slug'] = array(
1194
- 'label' => __('Slug', $this->textdomain),
1195
- 'options' => array(
1196
- 'type_label' => __('Slug', $this->textdomain),
1197
- 'sortorder' => 'on',
1198
- )
1199
- );
1200
-
1201
- // Word count support
1202
- $custom_columns['column-word-count'] = array(
1203
- 'label' => __('Word count', $this->textdomain),
1204
- 'options' => array(
1205
- 'type_label' => __('Word count', $this->textdomain),
1206
- )
1207
- );
1208
-
1209
- // Attachment support
1210
- $custom_columns['column-attachment'] = array(
1211
- 'label' => __('Attachment', $this->textdomain),
1212
- 'options' => array(
1213
- 'type_label' => __('Attachment', $this->textdomain),
1214
- 'sortorder' => 'on',
1215
- )
1216
- );
1217
-
1218
  // Custom Field support
1219
- if ( $this->get_postmeta_by_posttype($post_type) ) {
1220
  $custom_columns['column-meta-1'] = array(
1221
- 'label' => __('Custom Field', $this->textdomain),
1222
  'field' => '',
1223
  'field_type' => '',
1224
  'before' => '',
1225
  'after' => '',
1226
  'options' => array(
1227
- 'type_label' => __('Field', $this->textdomain),
1228
- 'class' => 'cpac-box-metafield',
1229
- 'sortorder' => 'on',
1230
  )
1231
  );
1232
  }
@@ -1244,48 +1241,59 @@ class Codepress_Admin_Columns
1244
  */
1245
  private function get_custom_users_columns()
1246
  {
1247
- $custom_columns = array();
1248
-
1249
- // User ID
1250
- $custom_columns['column-user_id'] = array(
1251
- 'label' => __('User ID', $this->textdomain),
1252
- 'options' => array(
1253
- 'type_label' => __('User ID', $this->textdomain),
1254
- 'sortorder' => 'on'
1255
- )
1256
- );
1257
-
1258
- // First name
1259
- $custom_columns['column-first_name'] = array(
1260
- 'label' => __('First name', $this->textdomain),
1261
- 'options' => array(
1262
- 'type_label' => __('First name', $this->textdomain),
1263
- )
1264
- );
1265
-
1266
- // Last name
1267
- $custom_columns['column-last_name'] = array(
1268
- 'label' => __('Last name', $this->textdomain),
1269
- 'options' => array(
1270
- 'type_label' => __('Last name', $this->textdomain),
1271
- )
 
 
 
1272
  );
1273
 
1274
- // User url
1275
- $custom_columns['column-user_url'] = array(
1276
- 'label' => __('Url', $this->textdomain),
1277
- 'options' => array(
1278
- 'type_label' => __('Url', $this->textdomain),
1279
- )
1280
- );
 
 
 
1281
 
1282
- // User url
1283
- $custom_columns['column-user_registered'] = array(
1284
- 'label' => __('Registered', $this->textdomain),
 
 
 
 
1285
  'options' => array(
1286
- 'type_label' => __('Registered', $this->textdomain),
1287
- )
1288
- );
 
1289
 
1290
  // merge with defaults
1291
  $custom_columns = $this->parse_defaults($custom_columns);
@@ -1294,67 +1302,319 @@ class Codepress_Admin_Columns
1294
  }
1295
 
1296
  /**
1297
- * Parse defaults
1298
  *
1299
- * @since 1.1
1300
  */
1301
- private function parse_defaults($columns)
1302
  {
1303
- // default arguments
1304
- $defaults = array(
1305
-
1306
- // stored values
1307
- 'label' => '',
1308
- 'state' => '',
1309
-
1310
- // static values
1311
- 'options' => array(
1312
- 'type_label' => __('Custom', $this->textdomain),
1313
- 'hide_options' => false,
1314
- 'class' => 'cpac-box-custom',
1315
- 'sortorder' => '',
1316
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1317
  );
1318
 
1319
- foreach ( $columns as $k => $column ) {
1320
- $c[$k] = wp_parse_args( $column, $defaults);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1321
  }
1322
 
1323
- return $c;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1324
  }
1325
-
1326
  /**
1327
- * Admin requests for orderby column
1328
  *
1329
- * @since 1.0
1330
  */
1331
- private function get_stored_columns($type)
1332
- {
1333
- // get plugin options
1334
- $options = $this->options;
1335
-
1336
- // get saved columns
1337
- if ( isset($options['columns'][$type]) )
1338
- return $options['columns'][$type];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1339
 
1340
- return false;
 
 
 
1341
  }
1342
-
1343
  /**
1344
- * Post Type Menu
1345
  *
1346
- * @since 1.0
1347
  */
1348
- private function get_menu()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1349
  {
1350
  // set
1351
  $menu = '';
1352
  $count = 1;
1353
 
1354
  // referer
1355
- $referer = '';
1356
- if ( isset($_REQUEST['cpac_type']) && $_REQUEST['cpac_type'] )
1357
- $referer = $_REQUEST['cpac_type'];
1358
 
1359
  // loop
1360
  foreach ( $this->get_types() as $type ) {
@@ -1374,12 +1634,20 @@ class Codepress_Admin_Columns
1374
  <li>{$divider}<a{$current} href='#cpac-box-{$clean_label}'>{$label}</a></li>
1375
  ";
1376
  }
1377
-
 
 
 
 
 
 
 
1378
  return "
1379
  <div class='cpac-menu'>
1380
  <ul class='subsubsub'>
1381
  {$menu}
1382
  </ul>
 
1383
  </div>
1384
  ";
1385
  }
@@ -1389,19 +1657,16 @@ class Codepress_Admin_Columns
1389
  *
1390
  * @since 1.0
1391
  */
1392
- private function is_menu_type_current( $post_type )
1393
  {
1394
  // referer
1395
- $referer = '';
1396
- if ( ! empty($_REQUEST['cpac_type']) )
1397
- $referer = $_REQUEST['cpac_type'];
1398
 
1399
  // get label
1400
- $label = $this->get_singular_name($post_type);
1401
- $clean_label = $this->sanitize_string($post_type);
1402
 
1403
  // get first element from post-types
1404
- $first = array_shift(array_values($this->post_types));
1405
 
1406
  // display the page that was being viewed before saving
1407
  if ( $referer ) {
@@ -1410,7 +1675,7 @@ class Codepress_Admin_Columns
1410
  }
1411
 
1412
  // settings page has not yet been saved
1413
- } elseif ( $first == $post_type ) {
1414
  return true;
1415
  }
1416
 
@@ -1424,10 +1689,22 @@ class Codepress_Admin_Columns
1424
  */
1425
  private function get_singular_name( $type )
1426
  {
 
 
 
 
 
 
 
 
1427
  // Users
1428
- if ( $type == 'wp-users' )
1429
  $label = 'Users';
1430
-
 
 
 
 
1431
  // Posts
1432
  else {
1433
  $posttype_obj = get_post_type_object($type);
@@ -1436,67 +1713,51 @@ class Codepress_Admin_Columns
1436
 
1437
  return $label;
1438
  }
1439
-
1440
  /**
1441
- * Admin requests for orderby column
1442
  *
1443
- * @since 1.0
1444
  */
1445
- public function handle_requests_orderby_column( $vars )
1446
  {
1447
- if ( isset( $vars['orderby'] ) ) {
1448
- $column = $this->get_orderby_type( $vars['orderby'], $vars['post_type'] );
1449
-
1450
- if ( $column ) {
1451
- $id = key($column);
1452
-
1453
- // Page Order
1454
- if ( $id == 'column-order' ) {
1455
- $vars['orderby'] = 'menu_order';
1456
- }
1457
-
1458
- // Custom Fields
1459
- if ( $this->is_column_meta($id) ) {
1460
- $field = $column[$id]['field'];
1461
-
1462
- // orderby type
1463
- $field_type = 'meta_value';
1464
- if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' )
1465
- $field_type = 'meta_value_num';
1466
-
1467
- // set vars
1468
- $vars = array_merge( $vars, array(
1469
- 'meta_key' => $field,
1470
- 'orderby' => $field_type
1471
- ) );
1472
- }
1473
- }
1474
- }
1475
- return $vars;
1476
- }
1477
-
1478
  /**
1479
- * Get orderby type
1480
  *
1481
- * @since 1.1
1482
  */
1483
- private function get_orderby_type($orderby, $post_type)
1484
- {
1485
- $db_columns = $this->get_stored_columns($post_type);
1486
-
1487
- if ( $db_columns ) {
1488
- foreach ( $db_columns as $id => $vars ) {
1489
 
1490
- // check which custom column was clicked
1491
- if ( isset( $vars['label'] ) && $orderby == $this->sanitize_string( $vars['label'] ) ) {
1492
- $column[$id] = $vars;
1493
- return $column;
1494
- }
1495
- }
1496
- }
1497
- return false;
 
 
 
 
 
 
 
 
 
1498
  }
1499
-
1500
  /**
1501
  * Sanitize label
1502
  *
@@ -1504,52 +1765,426 @@ class Codepress_Admin_Columns
1504
  *
1505
  * @since 1.0
1506
  */
1507
- private function sanitize_string($string)
1508
  {
1509
  $string = esc_url($string);
1510
- return str_replace('http://','', $string);
 
 
 
1511
  }
1512
 
1513
  /**
1514
- * Get plugin url.
1515
  *
1516
  * @since 1.0
1517
  */
1518
- private function plugin_url( $file = '' )
1519
- {
1520
- return plugins_url($file, __FILE__);
 
 
 
1521
  }
1522
 
1523
  /**
1524
- * Checks if column-meta key exists
1525
  *
1526
- * @since 1.0
1527
  */
1528
- private function is_column_meta( $id = '' )
1529
  {
1530
- if ( strpos($id, 'column-meta-') !== false )
1531
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1532
 
 
 
 
 
 
 
 
 
 
 
 
 
1533
  return false;
1534
  }
1535
 
1536
  /**
1537
- * Get a thumbnail
1538
  *
1539
- * @since 1.0
1540
  */
1541
- private function get_thumbnail( $image = '' )
1542
- {
1543
- if ( empty($image) )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1544
  return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1545
 
1546
- $image_path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $image);
1547
- $new = image_resize( $image_path, 120, 80, true);
1548
 
1549
- if ( ! is_wp_error( $new ) )
1550
- $image = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $new);
1551
 
1552
- return "<img src='{$image}' alt='' width='120' height='80' />";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1553
  }
1554
 
1555
  /**
@@ -1563,51 +2198,116 @@ class Codepress_Admin_Columns
1563
  */
1564
  public function plugin_settings_page()
1565
  {
 
1566
  // loop through post types
1567
  $rows = '';
1568
  foreach ( $this->get_types() as $type ) {
1569
 
1570
  // post type label
1571
- $label = $this->get_singular_name($type);
1572
-
 
 
 
 
 
1573
  // id
1574
  $id = $this->sanitize_string($type);
1575
 
1576
  // build draggable boxes
1577
  $boxes = $this->get_column_boxes($type);
1578
-
1579
  // class
1580
  $class = $this->is_menu_type_current($type) ? ' current' : ' hidden';
1581
 
1582
  $rows .= "
1583
  <tr id='cpac-box-{$id}' valign='top' class='cpac-box-row{$class}'>
1584
  <th class='cpac_post_type' scope='row'>
1585
- {$label}
1586
  </th>
1587
  <td>
1588
  <h3 class='cpac_post_type hidden'>{$label}</h3>
1589
- {$boxes}
1590
  </td>
1591
  </tr>
1592
  ";
1593
  }
1594
 
 
 
 
1595
  // Post Type Menu
1596
  $menu = $this->get_menu();
1597
 
 
 
 
 
 
 
 
 
1598
  ?>
1599
  <div id="cpac" class="wrap">
1600
- <?php screen_icon($this->slug) ?>
1601
- <h2><?php _e('Codepress Admin Columns', $this->textdomain); ?></h2>
1602
  <?php echo $menu ?>
1603
- <div class="postbox-container" style="width:70%;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1604
  <div class="metabox-holder">
1605
  <div class="meta-box-sortables">
1606
 
1607
  <div id="general-cpac-settings" class="postbox">
1608
  <div title="Click to toggle" class="handlediv"><br></div>
1609
  <h3 class="hndle">
1610
- <span><?php _e('Admin Columns', $this->textdomain ); ?></span>
1611
  </h3>
1612
  <div class="inside">
1613
  <form method="post" action="options.php">
@@ -1615,8 +2315,11 @@ class Codepress_Admin_Columns
1615
  <?php settings_fields( 'cpac-settings-group' ); ?>
1616
 
1617
  <table class="form-table">
1618
-
1619
- <?php echo $rows ?>
 
 
 
1620
 
1621
  <tr class="bottom" valign="top">
1622
  <th scope="row"></th>
@@ -1634,56 +2337,37 @@ class Codepress_Admin_Columns
1634
  <div id="restore-cpac-settings" class="postbox">
1635
  <div title="Click to toggle" class="handlediv"><br></div>
1636
  <h3 class="hndle">
1637
- <span><?php _e('Restore defaults', $this->textdomain) ?></span>
1638
  </h3>
1639
  <div class="inside">
1640
  <form method="post" action="">
1641
- <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); ?>');" />
1642
  </form>
1643
- <p class="description"><?php _e('This will delete all column settings and restore the default settings.', $this->textdomain); ?></p>
1644
  </div>
1645
  </div><!-- restore-cpac-settings -->
1646
 
1647
  </div>
1648
  </div>
1649
- </div><!-- .postbox-container -->
1650
-
1651
- <div class="postbox-container" style="width:20%;">
1652
- <div class="metabox-holder">
1653
- <div class="meta-box-sortables">
1654
-
1655
- <div id="likethisplugin-cpac-settings" class="postbox">
1656
- <div title="Click to toggle" class="handlediv"><br></div>
1657
- <h3 class="hndle">
1658
- <span><?php _e('Like this plugin?', $this->textdomain) ?></span>
1659
- </h3>
1660
- <div class="inside">
1661
- <p><?php _e('Why not do any or all of the following', $this->textdomain) ?>:</p>
1662
- <ul>
1663
- <li><a href="http://www.codepress.nl/plugins/codepress-admin-columns/"><?php _e('Link to it so other folks can find out about it.', $this->textdomain) ?></a></li>
1664
- <li><a href="http://wordpress.org/extend/plugins/codepress-admin-columns/"><?php _e('Give it a 5 star rating on WordPress.org.', $this->textdomain) ?></a></li>
1665
- <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>
1666
- </ul>
1667
- </div>
1668
- </div><!-- likethisplugin-cpac-settings -->
1669
-
1670
- <div id="side-cpac-settings" class="postbox">
1671
- <div title="Click to toggle" class="handlediv"><br></div>
1672
- <h3 class="hndle">
1673
- <span><?php _e('Need support?', $this->textdomain) ?></span>
1674
- </h3>
1675
- <div class="inside">
1676
- <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>
1677
- <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), 'http://www.codepress.nl/plugins/codepress-admin-columns#feedback');?></p>
1678
- </div>
1679
- </div><!-- side-cpac-settings -->
1680
-
1681
- </div>
1682
- </div>
1683
- </div><!-- .postbox-container -->
1684
-
1685
  </div>
1686
  <?php
1687
  }
1688
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1689
  ?>
1
  <?php
2
  /*
3
  Plugin Name: Codepress Admin Columns
4
+ Version: 1.4.4
5
+ Description: Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
6
  Author: Codepress
7
  Author URI: http://www.codepress.nl
8
  Plugin URI: http://www.codepress.nl/plugins/codepress-admin-columns/
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
 
29
+ define( 'CPAC_VERSION', '1.4.4' );
30
+ define( 'CPAC_TEXTDOMAIN', 'codepress-admin-columns' );
31
+ define( 'CPAC_SLUG', 'codepress-admin-columns' );
32
+ define( 'CPAC_URL', plugins_url('', __FILE__) );
33
+
34
+ // only run plugin in the admin interface
35
+ if ( !is_admin() )
36
+ return false;
37
 
38
  /**
39
+ * Dependencies
40
  *
41
+ * @since 1.3
42
  */
43
+ require_once dirname( __FILE__ ) . '/classes/sortable.php';
44
+ require_once dirname( __FILE__ ) . '/classes/values.php';
45
+ require_once dirname( __FILE__ ) . '/classes/values/posts.php';
46
+ require_once dirname( __FILE__ ) . '/classes/values/users.php';
47
+ require_once dirname( __FILE__ ) . '/classes/values/media.php';
48
+ require_once dirname( __FILE__ ) . '/classes/values/link.php';
49
+ require_once dirname( __FILE__ ) . '/classes/values/comments.php';
50
 
51
  /**
52
+ * Codepress Admin Columns Class
53
  *
54
  * @since 1.0
55
  *
56
  */
57
  class Codepress_Admin_Columns
58
  {
59
+ private $post_types,
60
+ $codepress_url,
61
+ $wordpress_url,
62
+ $api_url;
 
63
 
64
  /**
65
+ * Constructor
66
  *
67
  * @since 1.0
68
  */
69
  function __construct()
70
+ {
71
+ $this->api_url = 'http://www.codepress.nl/';
72
+
73
+ // wp is loaded
74
+ add_action( 'wp_loaded', array( $this, 'init') );
75
  }
76
 
77
  /**
78
+ * Initialize plugin.
79
  *
80
  * Loading sequence is determined and intialized.
81
  *
82
  * @since 1.0
83
  */
84
+ public function init()
85
  {
86
  // vars
87
+ $this->post_types = self::get_post_types();
 
 
 
88
 
89
+ // set
90
+ $this->codepress_url = 'http://www.codepress.nl/plugins/codepress-admin-columns';
91
+ $this->wordpress_url = 'http://wordpress.org/tags/codepress-admin-columns';
92
 
93
  // translations
94
+ load_plugin_textdomain( CPAC_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
95
+
96
+ // register settings
97
+ add_action( 'admin_menu', array( $this, 'settings_menu') );
98
+ add_action( 'admin_init', array( $this, 'register_settings') );
99
+
100
+ // styling & scripts
101
+ add_action( 'admin_enqueue_scripts' , array( $this, 'column_styles') );
102
+ add_filter( 'admin_body_class', array( $this, 'admin_class' ) );
103
+ add_action( 'admin_head', array( $this, 'admin_css') );
104
+
105
+ // register columns
106
+ add_action( 'admin_init', array( $this, 'register_columns_headings' ) );
107
+ add_action( 'admin_init', array( $this, 'register_columns_values' ) );
108
+
109
+ // action ajax
110
+ add_action( 'wp_ajax_cpac_addon_activation', array( $this, 'ajax_activation'));
111
+
112
+ // handle requests gets a low priority so it will trigger when all other plugins have loaded their columns
113
+ add_action( 'admin_init', array( $this, 'handle_requests' ), 1000 );
114
+
115
+ // filters
116
+ add_filter( 'plugin_action_links', array( $this, 'add_settings_link'), 1, 2);
117
+ }
118
 
119
  /**
120
  * Admin Menu.
127
  {
128
  $page = add_options_page(
129
  // Page title
130
+ esc_html__( 'Admin Columns Settings', CPAC_TEXTDOMAIN ),
131
  // Menu Title
132
+ esc_html__( 'Admin Columns', CPAC_TEXTDOMAIN ),
133
  // Capability
134
  'manage_options',
135
  // Menu slug
136
+ CPAC_SLUG,
137
  // Callback
138
+ array( $this, 'plugin_settings_page')
139
  );
140
 
141
+ // set admin page
142
+ $this->admin_page = $page;
143
+
144
+ // settings page specific styles and scripts
145
+ add_action( "admin_print_styles-$page", array( $this, 'admin_styles') );
146
+ add_action( "admin_print_scripts-$page", array( $this, 'admin_scripts') );
147
+
148
+ // add help tabs
149
+ add_action("load-$page", array( $this, 'help_tabs'));
150
+ }
151
 
152
  /**
153
  * Add Settings link to plugin page
159
  if ( $file != plugin_basename( __FILE__ ))
160
  return $links;
161
 
162
+ array_unshift($links, '<a href="' . admin_url("admin.php") . '?page=' . CPAC_SLUG . '">' . __( 'Settings' ) . '</a>');
163
  return $links;
164
  }
165
 
166
  /**
167
+ * Register Column Values
168
+ *
169
+ * apply_filters location in includes/screen.php
170
+ *
171
+ * @since 1.0
172
+ */
173
+ public function register_columns_values()
174
+ {
175
+ new CPAC_Posts_Values();
176
+ new CPAC_Link_Values();
177
+ new CPAC_Media_Values();
178
+ new CPAC_Users_Values();
179
+ new CPAC_Comments_Values();
180
+ }
181
+ /**
182
+ * Register Columns Headings
183
+ *
184
+ * apply_filters location in includes/screen.php
185
  *
186
  * @since 1.0
187
  */
188
+ public function register_columns_headings()
189
  {
190
+ /** Posts */
191
+ foreach ( $this->post_types as $post_type ) {
192
+
193
  // register column per post type
194
+ add_filter("manage_edit-{$post_type}_columns", array($this, 'callback_add_posts_column_headings'));
195
+ }
 
 
 
196
 
197
  /** Users */
198
+ add_filter( "manage_users_columns", array($this, 'callback_add_users_column_headings'), 9);
199
+ // give higher priority, so it will load just before other plugins to prevent conflicts
200
+
201
+ /** Media */
202
+ add_filter( "manage_upload_columns", array($this, 'callback_add_media_column_headings'));
203
+
204
+ /** Links */
205
+ add_filter( "manage_link-manager_columns", array($this, 'callback_add_links_column_headings'));
206
+
207
+ /** Comments */
208
+ add_filter( "manage_edit-comments_columns", array($this, 'callback_add_comments_column_headings'));
209
  }
210
 
211
  /**
213
  *
214
  * @since 1.0
215
  */
216
+ public function callback_add_posts_column_headings($columns)
217
+ {
218
+ global $post;
219
+
220
+ return $this->add_columns_headings($post->post_type, $columns);
221
+ }
222
 
223
  /**
224
  * Callback add Users column
225
  *
226
  * @since 1.1
227
  */
228
+ public function callback_add_users_column_headings($columns)
229
+ {
230
+ return $this->add_columns_headings('wp-users', $columns);
231
+ }
232
+
233
+ /**
234
+ * Callback add Media column
235
+ *
236
+ * @since 1.3
237
+ */
238
+ public function callback_add_media_column_headings($columns)
239
+ {
240
+ return $this->add_columns_headings('wp-media', $columns);
241
+ }
242
+
243
+ /**
244
+ * Callback add Links column
245
+ *
246
+ * @since 1.3.1
247
+ */
248
+ public function callback_add_links_column_headings($columns)
249
+ {
250
+ return $this->add_columns_headings('wp-links', $columns);
251
+ }
252
+
253
+ /**
254
+ * Callback add Comments column
255
+ *
256
+ * @since 1.3.1
257
+ */
258
+ public function callback_add_comments_column_headings($columns)
259
+ {
260
+ return $this->add_columns_headings('wp-comments', $columns);
261
  }
262
 
263
  /**
265
  *
266
  * @since 1.1
267
  */
268
+ protected function add_columns_headings( $type, $columns )
269
+ {
270
+ // only get stored columns.. the rest we don't need
271
+ $db_columns = self::get_stored_columns($type);
272
+
273
  if ( !$db_columns )
274
  return $columns;
275
+
276
+ // filter already loaded columns by plugins
277
+ $set_columns = $this->filter_preset_columns( $type, $columns );
278
 
 
 
 
279
  // loop through columns
280
+ foreach ( $db_columns as $id => $values ) {
 
281
  // is active
282
  if ( isset($values['state']) && $values['state'] == 'on' ){
283
 
290
  }
291
 
292
  /**
293
+ * Filter preset columns. These columns apply either for every post or set by a plugin.
 
 
 
 
 
 
 
 
 
 
 
 
294
  *
295
+ * @since 1.0
296
  */
297
+ private function filter_preset_columns( $type, $columns )
298
  {
299
+ $options = get_option('cpac_options_default');
300
+
301
+ if ( !$options )
 
 
 
 
 
 
 
 
 
 
302
  return $columns;
303
 
304
+ // we use the wp default columns for filtering...
305
+ $stored_wp_default_columns = $options[$type];
306
+
307
+ // ... the ones that are set by plugins, theme functions and such.
308
+ $dif_columns = array_diff(array_keys($columns), array_keys($stored_wp_default_columns));
309
+
310
+ // we add those to the columns
311
+ $pre_columns = array();
312
+ if ( $dif_columns ) {
313
+ foreach ( $dif_columns as $column ) {
314
+ $pre_columns[$column] = $columns[$column];
315
  }
316
+ }
317
+
318
+ return $pre_columns;
319
  }
320
 
321
  /**
343
 
344
  // custom field button
345
  $button_add_column = '';
346
+ if ( $this->get_meta_by_type($type) )
347
+ $button_add_column = "<a href='javacript:;' class='cpac-add-customfield-column button'>+ " . __('Add Custom Field Column', CPAC_TEXTDOMAIN) . "</a>";
348
 
349
  return "
350
  <div class='cpac-box'>
352
  {$list}
353
  </ul>
354
  {$button_add_column}
355
+ <div class='cpac-reorder-msg'>" . __('drag and drop to reorder', CPAC_TEXTDOMAIN) . "</div>
356
  </div>
357
  ";
358
  }
362
  *
363
  * @since 1.0
364
  */
365
+ protected function get_merged_columns( $type )
366
+ {
367
+ /** Comments */
368
+ if ( $type == 'wp-comments' ) {
369
+ $wp_default_columns = $this->get_wp_default_comments_columns();
370
+ $wp_custom_columns = $this->get_custom_comments_columns();
371
+ }
372
+
373
+ /** Links */
374
+ elseif ( $type == 'wp-links' ) {
375
+ $wp_default_columns = $this->get_wp_default_links_columns();
376
+ $wp_custom_columns = $this->get_custom_links_columns();
377
+ }
378
 
379
  /** Users */
380
+ elseif ( $type == 'wp-users' ) {
381
  $wp_default_columns = $this->get_wp_default_users_columns();
382
  $wp_custom_columns = $this->get_custom_users_columns();
383
  }
384
 
385
+ /** Media */
386
+ elseif ( $type == 'wp-media' ) {
387
+ $wp_default_columns = $this->get_wp_default_media_columns();
388
+ $wp_custom_columns = $this->get_custom_media_columns();
389
+ }
390
+
391
  /** Posts */
392
  else {
393
  $wp_default_columns = $this->get_wp_default_posts_columns($type);
394
  $wp_custom_columns = $this->get_custom_posts_columns($type);
395
  }
396
+
397
+ // merge columns
398
+ $display_columns = $this->parse_columns($wp_custom_columns, $wp_default_columns, $type);
399
+
400
+ return $display_columns;
401
+ }
402
 
403
+ /**
404
+ * Merge the default columns (set by WordPress) and the added custom columns (set by plugins, theme etc.)
405
+ *
406
+ * @since 1.3.3
407
+ */
408
+ function parse_columns($wp_custom_columns, $wp_default_columns, $type)
409
+ {
410
  // merge columns
411
+ $default_columns = wp_parse_args($wp_custom_columns, $wp_default_columns);
412
+
413
+ //get saved database columns
414
+ $db_columns = self::get_stored_columns($type);
415
  if ( $db_columns ) {
416
+
417
+ // let's remove any unavailable columns.. such as disabled plugins
418
+ $db_columns = $this->remove_unavailable_columns($db_columns, $default_columns);
419
+
420
+ // loop throught the active columns
421
  foreach ( $db_columns as $id => $values ) {
422
 
423
  // get column meta options from custom columns
425
  $db_columns[$id]['options'] = $wp_custom_columns['column-meta-1']['options'];
426
 
427
  // add static options
428
+ elseif ( isset($default_columns[$id]['options']) )
429
+ $db_columns[$id]['options'] = $default_columns[$id]['options'];
430
 
431
+ unset($default_columns[$id]);
432
  }
433
  }
434
 
435
  // merge all
436
+ return wp_parse_args($db_columns, $default_columns);
437
+ }
438
+
439
+ /**
440
+ * Remove deactivated (plugin) columns
441
+ *
442
+ * This will remove any columns that have been stored, but are no longer available. This happends
443
+ * when plugins are deactivated or when they are removed from the theme functions.
444
+ *
445
+ * @since 1.2
446
+ */
447
+ private function remove_unavailable_columns( array $db_columns, array $default_columns)
448
+ {
449
+ // check or differences
450
+ $diff = array_diff( array_keys($db_columns), array_keys($default_columns) );
451
+
452
+ if ( ! empty($diff) && is_array($diff) ) {
453
+ foreach ( $diff as $column_name ){
454
+ // make an exception for column-meta-xxx
455
+ if ( ! $this->is_column_meta($column_name) ) {
456
+ unset($db_columns[$column_name]);
457
+ }
458
+ }
459
+ }
460
 
461
+ return $db_columns;
462
  }
463
 
464
  /**
466
  *
467
  * @since 1.0
468
  */
469
+ private function get_box($type, $id, $values)
470
  {
471
  $classes = array();
472
 
482
  $class = implode(' ', $classes);
483
 
484
  // more box options
485
+ $more_options = $this->get_additional_box_options($type, $id, $values);
486
  $action = "<a class='cpac-action' href='#open'>open</a>";
487
+
488
+ // type label
489
+ $type_label = isset($values['options']['type_label']) ? $values['options']['type_label'] : '';
490
+
491
+ // label
492
+ $label = isset($values['label']) ? str_replace("'", '"', $values['label']) : '';
493
+
494
+ // width
495
+ $width = isset($values['width']) ? $values['width'] : 0;
496
+ $width_descr = isset($values['width']) && $values['width'] > 0 ? $values['width'] . '%' : __('default', CPAC_TEXTDOMAIN);
497
 
498
  // hide box options
499
+ $label_hidden = '';
500
+ if ( ! empty($values['options']['hide_options']) || strpos($label, '<img') !== false ) {
501
+ $label_hidden = ' style="display:none"';
502
  }
503
 
504
  $list = "
505
  <li class='{$class}'>
506
+ <div class='cpac-sort-handle'></div>
507
+ <div class='cpac-type-options'>
 
508
  <div class='cpac-checkbox'></div>
509
+ <input type='hidden' class='cpac-state' name='cpac_options[columns][{$type}][{$id}][state]' value='{$state}'/>
510
+ <label class='main-label'>{$values['label']}</label>
511
  </div>
512
  <div class='cpac-meta-title'>
513
  {$action}
514
+ <span>{$type_label}</span>
515
  </div>
516
  <div class='cpac-type-inside'>
517
+ <label for='cpac_options-{$type}-{$id}-label'{$label_hidden}>Label: </label>
518
+ <input type='text' name='cpac_options[columns][{$type}][{$id}][label]' id='cpac_options-{$type}-{$id}-label' value='{$label}' class='text'{$label_hidden}/>
519
+ <label for='cpac_options-{$type}-{$id}-width'>".__('Width', CPAC_TEXTDOMAIN).":</label>
520
+ <input type='hidden' maxlength='4' class='input-width' name='cpac_options[columns][{$type}][{$id}][width]' id='cpac_options-{$type}-{$id}-width' value='{$width}' />
521
+ <div class='description width-decription' title='".__('default', CPAC_TEXTDOMAIN)."'>{$width_descr}</div>
522
+ <div class='input-width-range'></div>
523
  <br/>
524
  {$more_options}
525
  </div>
534
  *
535
  * @since 1.0
536
  */
537
+ private function get_additional_box_options($type, $id, $values)
538
  {
539
  $fields = '';
540
 
541
+ // Custom Fields
542
  if ( $this->is_column_meta($id) )
543
+ $fields = $this->get_box_options_customfields($type, $id, $values);
544
 
545
  return $fields;
546
  }
550
  *
551
  * @since 1.0
552
  */
553
+ private function get_box_options_customfields($type, $id, $values)
554
  {
555
  // get post meta fields
556
+ $fields = $this->get_meta_by_type($type);
557
 
558
  if ( empty($fields) )
559
  return false;
577
  $fieldtypes = array(
578
  '' => __('Default'),
579
  'image' => __('Image'),
580
+ 'library_id' => __('Media Library Icon', CPAC_TEXTDOMAIN),
581
  'excerpt' => __('Excerpt'),
582
+ 'array' => __('Multiple Values', CPAC_TEXTDOMAIN),
583
+ 'numeric' => __('Numeric', CPAC_TEXTDOMAIN),
584
+ 'date' => __('Date', CPAC_TEXTDOMAIN),
585
+ 'title_by_id' => __('Post Title (Post ID\'s)', CPAC_TEXTDOMAIN),
586
  );
587
 
588
  // add filter
607
  return false;
608
 
609
  // add remove button
610
+ $remove = '<p class="remove-description description">'.__('This field can not be removed', CPAC_TEXTDOMAIN).'</p>';
611
  if ( $id != 'column-meta-1') {
612
  $remove = "
613
  <p>
617
  }
618
 
619
  $inside = "
620
+ <label for='cpac-{$type}-{$id}-field'>Custom Field: </label>
621
+ <select name='cpac_options[columns][{$type}][{$id}][field]' id='cpac-{$type}-{$id}-field'>{$field_options}</select>
622
  <br/>
623
+ <label for='cpac-{$type}-{$id}-field_type'>Field Type: </label>
624
+ <select name='cpac_options[columns][{$type}][{$id}][field_type]' id='cpac-{$type}-{$id}-field_type'>{$fieldtype_options}</select>
625
  <br/>
626
+ <label for='cpac-{$type}-{$id}-before'>Before: </label>
627
+ <input type='text' class='cpac-before' name='cpac_options[columns][{$type}][{$id}][before]' id='cpac-{$type}-{$id}-before' value='{$before}'/>
628
  <br/>
629
+ <label for='cpac-{$type}-{$id}-after'>After: </label>
630
+ <input type='text' class='cpac-after' name='cpac_options[columns][{$type}][{$id}][after]' id='cpac-{$type}-{$id}-after' value='{$after}'/>
631
  <br/>
632
  {$remove}
633
  ";
636
  }
637
 
638
  /**
639
+ * Get post meta fields by type; post(types) or users.
640
  *
641
  * @since 1.0
642
  */
643
+ private function get_meta_by_type($type = 'post')
644
  {
645
  global $wpdb;
646
+
647
+ /** Comments */
648
+ if ( $type == 'wp-comments') {
649
+ $sql = "SELECT DISTINCT meta_key FROM {$wpdb->commentmeta} ORDER BY 1";
650
+ }
651
+
652
+ /** Users */
653
+ elseif ( $type == 'wp-users') {
654
+ $sql = "SELECT DISTINCT meta_key FROM {$wpdb->usermeta} ORDER BY 1";
655
+ }
656
+
657
+ /** Media */
658
+ elseif ( $type == 'wp-media') {
659
+ $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 = 'attachment' ORDER BY 1");
660
+ }
661
+
662
+ /** Posts */
663
+ else {
664
+ $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);
665
+ }
666
 
667
+ // run sql
668
+ $fields = $wpdb->get_results($sql, ARRAY_N);
669
+
670
  // postmeta
671
  if ( $fields ) {
672
  $meta_fields = array();
676
  $meta_fields[] = $field[0];
677
  }
678
  }
 
679
  return $meta_fields;
680
+ }
681
 
682
  return false;
683
  }
687
  *
688
  * @since 1.0
689
  */
690
+ public function admin_scripts()
691
  {
692
+ wp_enqueue_script( 'jquery-ui-slider' );
693
+ wp_enqueue_script( 'cpac-qtip2', CPAC_URL.'/assets/js/jquery.qtip.js', array('jquery'), CPAC_VERSION );
694
+ wp_enqueue_script( 'cpac-admin', CPAC_URL.'/assets/js/admin-column.js', array('jquery', 'dashboard', 'jquery-ui-sortable'), CPAC_VERSION );
695
  }
696
 
697
  /**
701
  */
702
  private function get_types()
703
  {
704
+ $types = $this->post_types;
705
+ $types['wp-users'] = 'wp-users';
706
+ $types['wp-media'] = 'wp-media';
707
+ $types['wp-links'] = 'wp-links';
708
+ $types['wp-comments'] = 'wp-comments';
709
 
710
  return $types;
711
  }
715
  *
716
  * @since 1.0
717
  */
718
+ public static function get_post_types()
719
  {
720
  $post_types = get_post_types(array(
721
  '_builtin' => false
723
  $post_types['post'] = 'post';
724
  $post_types['page'] = 'page';
725
 
726
+ return apply_filters('cpac-get-post-types', $post_types);
727
  }
728
 
729
  /**
733
  */
734
  public function admin_styles()
735
  {
736
+ wp_enqueue_style( 'jquery-ui-lightness', CPAC_URL.'/assets/ui-theme/jquery-ui-1.8.18.custom.css', array(), CPAC_VERSION, 'all' );
737
+ wp_enqueue_style( 'cpac-admin', CPAC_URL.'/assets/css/admin-column.css', array(), CPAC_VERSION, 'all' );
738
  }
739
 
740
  /**
744
  */
745
  public function column_styles()
746
  {
747
+ wp_enqueue_style( 'cpac-columns', CPAC_URL.'/assets/css/column.css', array(), CPAC_VERSION, 'all' );
748
  }
749
 
750
  /**
755
  public function register_settings()
756
  {
757
  // If we have no options in the database, let's add them now.
758
+ if ( false === get_option('cpac_options') )
759
+ add_option( 'cpac_options', array($this, 'get_default_plugin_options') );
760
 
761
+ register_setting( 'cpac-settings-group', 'cpac_options', array($this, 'options_callback') );
762
  }
763
 
764
  /**
790
  *
791
  * @since 1.0
792
  */
793
+ public function handle_requests()
794
  {
795
  // settings updated
796
+ if ( ! empty($_REQUEST['settings-updated']) )
797
+ $this->store_wp_default_columns();
 
 
 
 
 
 
 
 
 
 
 
 
 
798
 
799
  // restore defaults
800
+ if ( ! empty($_REQUEST['cpac-restore-defaults']) )
801
  $this->restore_defaults();
802
+
803
+ }
804
+
805
+ /**
806
+ * Stores WP default columns
807
+ *
808
+ * This will store columns that are set by WordPress core or theme
809
+ *
810
+ * @since 1.2
811
+ */
812
+ private function store_wp_default_columns()
813
+ {
814
+ // stores the default columns that are set by WP or theme.
815
+ $wp_default_columns = array();
816
+
817
+ // Posts
818
+ foreach ( $this->post_types as $post_type ) {
819
+ $wp_default_columns[$post_type] = $this->get_wp_default_posts_columns($post_type);
820
+ }
821
+
822
+ // Users
823
+ $wp_default_columns['wp-users'] = $this->get_wp_default_users_columns();
824
+
825
+ // Media
826
+ $wp_default_columns['wp-media'] = $this->get_wp_default_media_columns();
827
+
828
+ // Links
829
+ $wp_default_columns['wp-links'] = $this->get_wp_default_links_columns();
830
+
831
+ // Comments
832
+ $wp_default_columns['wp-comments'] = $this->get_wp_default_comments_columns();
833
+
834
+ update_option( 'cpac_options_default', $wp_default_columns );
835
  }
836
 
837
  /**
842
  private function restore_defaults()
843
  {
844
  delete_option( 'cpac_options' );
845
+ delete_option( 'cpac_options_default' );
846
+ }
847
+
848
  /**
849
+ * Get WP default supported admin columns per post type.
850
  *
851
+ * @since 1.0
852
  */
853
+ private function get_wp_default_posts_columns($post_type = 'post')
854
  {
855
+ // load dependencies
 
 
 
 
856
 
857
+ // deprecated as of wp3.3
858
+ if ( file_exists(ABSPATH . 'wp-admin/includes/template.php') )
859
+ require_once(ABSPATH . 'wp-admin/includes/template.php');
860
+
861
+ // introduced since wp3.3
862
+ if ( file_exists(ABSPATH . 'wp-admin/includes/screen.php') )
863
+ require_once(ABSPATH . 'wp-admin/includes/screen.php');
864
+
865
+ // used for getting columns
866
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
867
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
868
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php') )
869
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php');
870
 
871
+ // some plugins depend on settings the $_GET['post_type'] variable such as ALL in One SEO
872
+ $_GET['post_type'] = $post_type;
873
+
874
+ // for 3rd party plugin support we will call load-edit.php so all the
875
+ // additional columns that are set by them will be avaible for us
876
+ do_action('load-edit.php');
877
+
878
+ // we need to change the current screen
879
+ global $current_screen;
880
+ $org_current_screen = $current_screen;
881
+
882
+ // overwrite current_screen global with our post type of choose...
883
+ $current_screen->post_type = $post_type;
884
+
885
+ // ...so we can get its columns
886
+ $columns = WP_Posts_List_Table::get_columns();
887
+
888
+ if ( empty ( $columns ) )
889
+ return false;
890
+
891
+ // change to uniform format
892
+ $posts_columns = $this->get_uniform_format($columns);
893
 
894
+ // reset current screen
895
+ $current_screen = $org_current_screen;
896
+
897
+ return $posts_columns;
898
+ }
899
+
900
  /**
901
+ * Get WP default users columns per post type.
902
  *
903
+ * @since 1.1
904
  */
905
+ private function get_wp_default_users_columns()
906
  {
907
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
908
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
909
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php') )
910
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php');
911
+
912
+ // turn off site users
913
+ $this->is_site_users = false;
914
 
915
+ // get users columns
916
+ $columns = WP_Users_List_Table::get_columns();
917
+
918
+ // change to uniform format
919
+ $columns = $this->get_uniform_format($columns);
920
+
921
+ // add sorting to some of the default links columns
922
+ $columns = $this->set_sorting_to_default_users_columns($columns);
923
+
924
+ return apply_filters('cpac-default-users-columns', $columns);
925
+ }
926
+
927
+ /**
928
+ * Add Sorting to WP default Users columns
929
+ *
930
+ * @since 1.4
931
+ */
932
+ private function set_sorting_to_default_users_columns($columns)
933
+ {
934
+ // Comment
935
+ if ( !empty($columns['role']) ) {
936
+ $columns['role']['options']['sortorder'] = 'on';
937
  }
938
+ return $columns;
939
  }
940
+
941
  /**
942
+ * Get WP default media columns.
943
  *
944
+ * @since 1.2.1
945
  */
946
+ private function get_wp_default_media_columns()
947
  {
948
+ // could use _get_list_table('WP_Media_List_Table') ?
949
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
950
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
951
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php') )
952
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php');
 
 
 
 
953
 
954
+ global $current_screen;
955
+ $org_current_screen = $current_screen;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
956
 
957
+ // overwrite current_screen global with our media id...
958
+ $current_screen->id = 'upload';
 
 
 
 
 
 
 
 
 
959
 
960
+ // init media class
961
+ $wp_media = new WP_Media_List_Table;
 
 
962
 
963
+ // get media columns
964
+ $columns = $wp_media->get_columns();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
965
 
966
+ // reset current screen
967
+ $current_screen = $org_current_screen;
968
 
969
+ // change to uniform format
970
+ return $this->get_uniform_format($columns);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
971
  }
972
 
973
  /**
974
+ * Get WP default links columns.
975
  *
976
+ * @since 1.3.1
977
  */
978
+ private function get_wp_default_links_columns()
979
  {
980
+ // dependencies
981
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
982
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
983
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-links-list-table.php') )
984
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-links-list-table.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
985
 
986
+ // get links columns
987
+ $columns = WP_Links_List_Table::get_columns();
988
+
989
+ // change to uniform format
990
+ $columns = $this->get_uniform_format($columns);
 
 
 
 
 
 
 
 
 
 
 
 
991
 
992
+ // add sorting to some of the default links columns
993
+ $columns = $this->set_sorting_to_default_links_columns($columns);
994
 
995
+ return apply_filters('cpac-default-links-columns', $columns);
996
  }
997
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
998
  /**
999
+ * Add Sorting to WP default links columns
1000
  *
1001
+ * @since 1.4
1002
  */
1003
+ private function set_sorting_to_default_links_columns($columns)
1004
  {
1005
+ // Relationship
1006
+ if ( !empty($columns['rel']) ) {
1007
+ $columns['rel']['options']['sortorder'] = 'on';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1008
  }
1009
+ return $columns;
1010
+ }
1011
+
 
1012
  /**
1013
+ * Get WP default links columns.
1014
  *
1015
+ * @since 1.3.1
1016
  */
1017
+ private function get_wp_default_comments_columns()
1018
  {
1019
+ // dependencies
 
 
 
 
1020
  if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
1021
  require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
1022
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php') )
1023
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php');
1024
 
 
1025
  global $current_screen;
1026
  $org_current_screen = $current_screen;
1027
 
1028
+ // overwrite current_screen global with our media id...
1029
+ $current_screen->id = 'edit-comments';
 
 
 
1030
 
1031
+ // init table object
1032
+ $wp_comment = new WP_Comments_List_Table;
1033
 
1034
+ // get comments
1035
+ $columns = $wp_comment->get_columns();
1036
 
1037
  // reset current screen
1038
  $current_screen = $org_current_screen;
1039
 
1040
+ // change to uniform format
1041
+ $columns = $this->get_uniform_format($columns);
1042
+
1043
+ // add sorting to some of the default links columns
1044
+ $columns = $this->set_sorting_to_default_comments_columns($columns);
1045
+
1046
+ return apply_filters('cpac-default-comments-columns', $columns);
1047
  }
1048
 
1049
  /**
1050
+ * Add Sorting to WP default comments columns
1051
  *
1052
+ * @since 1.4
1053
  */
1054
+ private function set_sorting_to_default_comments_columns($columns)
1055
  {
1056
+ // Comment
1057
+ if ( !empty($columns['comment']) ) {
1058
+ $columns['comment']['options']['sortorder'] = 'on';
1059
+ }
1060
+ return $columns;
 
 
 
 
 
 
 
 
1061
  }
1062
 
1063
  /**
1068
  private function get_uniform_format($columns)
1069
  {
1070
  // we remove the checkbox column as an option...
1071
+ if ( isset($columns['cb']) )
1072
+ unset($columns['cb']);
1073
 
1074
  // change to uniform format
1075
  $uniform_columns = array();
1079
 
1080
  // comment exception
1081
  if ( strpos( $label, 'comment-grey-bubble.png') ) {
1082
+ $type_label = __('Comments', CPAC_TEXTDOMAIN);
1083
  $hide_options = true;
1084
  }
1085
 
1086
+ // user icon excerption
1087
+ if ( $id == 'icon' ) {
1088
+ $type_label = __('Icon', CPAC_TEXTDOMAIN);
1089
+ }
1090
+
1091
  $uniform_colums[$id] = array(
1092
  'label' => $label,
1093
+ 'state' => 'on',
1094
  'options' => array(
1095
  'type_label' => $type_label,
1096
  'hide_options' => $hide_options,
1108
  */
1109
  private function get_custom_posts_columns($post_type)
1110
  {
1111
+ $custom_columns = array(
1112
+ 'column-featured_image' => array(
1113
+ 'label' => __('Featured Image', CPAC_TEXTDOMAIN)
1114
+ ),
1115
+ 'column-excerpt' => array(
1116
+ 'label' => __('Excerpt', CPAC_TEXTDOMAIN)
1117
+ ),
1118
+ 'column-order' => array(
1119
+ 'label' => __('Page Order', CPAC_TEXTDOMAIN)
1120
+ ),
1121
+ 'column-post_formats' => array(
1122
+ 'label' => __('Post Format', CPAC_TEXTDOMAIN)
1123
+ ),
1124
+ 'column-postid' => array(
1125
+ 'label' => __('ID', CPAC_TEXTDOMAIN)
1126
+ ),
1127
+ 'column-page-slug' => array(
1128
+ 'label' => __('Slug', CPAC_TEXTDOMAIN)
1129
+ ),
1130
+ 'column-attachment' => array(
1131
+ 'label' => __('Attachment', CPAC_TEXTDOMAIN)
1132
+ ),
1133
+ 'column-attachment-count' => array(
1134
+ 'label' => __('No. of Attachments', CPAC_TEXTDOMAIN)
1135
+ ),
1136
+ 'column-roles' => array(
1137
+ 'label' => __('Roles', CPAC_TEXTDOMAIN)
1138
+ ),
1139
+ 'column-status' => array(
1140
+ 'label' => __('Status', CPAC_TEXTDOMAIN)
1141
+ ),
1142
+ 'column-comment-status' => array(
1143
+ 'label' => __('Comment status', CPAC_TEXTDOMAIN)
1144
+ ),
1145
+ 'column-ping-status' => array(
1146
+ 'label' => __('Ping status', CPAC_TEXTDOMAIN)
1147
+ ),
1148
+ 'column-actions' => array(
1149
+ 'label' => __('Actions', CPAC_TEXTDOMAIN),
1150
+ 'options' => array(
1151
+ 'sortorder' => false
1152
  )
1153
+ ),
1154
+ 'column-modified' => array(
1155
+ 'label' => __('Last modified', CPAC_TEXTDOMAIN)
1156
+ ),
1157
+ 'column-comment-count' => array(
1158
+ 'label' => __('Comment count', CPAC_TEXTDOMAIN)
1159
+ )
1160
+ );
1161
 
1162
+ // Word count support
1163
  if ( post_type_supports($post_type, 'editor') ) {
1164
+ $custom_columns['column-word-count'] = array(
1165
+ 'label' => __('Word count', CPAC_TEXTDOMAIN)
 
 
 
1166
  );
1167
  }
1168
 
1169
  // Sticky support
1170
  if ( $post_type == 'post' ) {
1171
  $custom_columns['column-sticky'] = array(
1172
+ 'label' => __('Sticky', CPAC_TEXTDOMAIN)
 
 
 
1173
  );
1174
  }
1175
 
1176
  // Order support
1177
  if ( post_type_supports($post_type, 'page-attributes') ) {
1178
  $custom_columns['column-order'] = array(
1179
+ 'label' => __('Page Order', CPAC_TEXTDOMAIN),
1180
  'options' => array(
1181
+ 'type_label' => __('Order', CPAC_TEXTDOMAIN)
 
1182
  )
1183
  );
1184
  }
1186
  // Page Template
1187
  if ( $post_type == 'page' ) {
1188
  $custom_columns['column-page-template'] = array(
1189
+ 'label' => __('Page Template', CPAC_TEXTDOMAIN)
 
 
 
 
1190
  );
1191
  }
1192
 
1193
  // Post Formats
1194
  if ( post_type_supports($post_type, 'post-formats') ) {
1195
  $custom_columns['column-post_formats'] = array(
1196
+ 'label' => __('Post Format', CPAC_TEXTDOMAIN)
 
 
 
1197
  );
1198
  }
1199
 
1204
  if ( $tax_slug != 'post_tag' && $tax_slug != 'category' && $tax_slug != 'post_format' ) {
1205
  $custom_columns['column-taxonomy-'.$tax->name] = array(
1206
  'label' => $tax->label,
1207
+ 'show_filter' => true,
1208
  'options' => array(
1209
+ 'type_label' => __('Taxonomy', CPAC_TEXTDOMAIN)
1210
  )
1211
  );
1212
  }
1213
  }
1214
  }
1215
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1216
  // Custom Field support
1217
+ if ( $this->get_meta_by_type($post_type) ) {
1218
  $custom_columns['column-meta-1'] = array(
1219
+ 'label' => __('Custom Field', CPAC_TEXTDOMAIN),
1220
  'field' => '',
1221
  'field_type' => '',
1222
  'before' => '',
1223
  'after' => '',
1224
  'options' => array(
1225
+ 'type_label' => __('Field', CPAC_TEXTDOMAIN),
1226
+ 'class' => 'cpac-box-metafield'
 
1227
  )
1228
  );
1229
  }
1241
  */
1242
  private function get_custom_users_columns()
1243
  {
1244
+ $custom_columns = array(
1245
+ 'column-user_id' => array(
1246
+ 'label' => __('User ID', CPAC_TEXTDOMAIN)
1247
+ ),
1248
+ 'column-nickname' => array(
1249
+ 'label' => __('Nickname', CPAC_TEXTDOMAIN)
1250
+ ),
1251
+ 'column-first_name' => array(
1252
+ 'label' => __('First name', CPAC_TEXTDOMAIN)
1253
+ ),
1254
+ 'column-last_name' => array(
1255
+ 'label' => __('Last name', CPAC_TEXTDOMAIN)
1256
+ ),
1257
+ 'column-user_url' => array(
1258
+ 'label' => __('Url', CPAC_TEXTDOMAIN)
1259
+ ),
1260
+ 'column-user_registered' => array(
1261
+ 'label' => __('Registered', CPAC_TEXTDOMAIN)
1262
+ ),
1263
+ 'column-user_description' => array(
1264
+ 'label' => __('Description', CPAC_TEXTDOMAIN)
1265
+ ),
1266
+ 'column-actions' => array(
1267
+ 'label' => __('Actions', CPAC_TEXTDOMAIN),
1268
+ 'options' => array(
1269
+ 'sortorder' => false
1270
+ )
1271
+ ),
1272
  );
1273
 
1274
+ // User total number of posts
1275
+ foreach ( self::get_post_types() as $post_type ) {
1276
+ $label = $this->get_plural_name($post_type);
1277
+ $custom_columns['column-user_postcount-'.$post_type] = array(
1278
+ 'label' => __( sprintf('No. of %s',$label), CPAC_TEXTDOMAIN),
1279
+ 'options' => array(
1280
+ 'type_label' => __('Postcount', CPAC_TEXTDOMAIN)
1281
+ )
1282
+ );
1283
+ }
1284
 
1285
+ // Custom Field support
1286
+ $custom_columns['column-meta-1'] = array(
1287
+ 'label' => __('Custom Field', CPAC_TEXTDOMAIN),
1288
+ 'field' => '',
1289
+ 'field_type' => '',
1290
+ 'before' => '',
1291
+ 'after' => '',
1292
  'options' => array(
1293
+ 'type_label' => __('Field', CPAC_TEXTDOMAIN),
1294
+ 'class' => 'cpac-box-metafield'
1295
+ )
1296
+ );
1297
 
1298
  // merge with defaults
1299
  $custom_columns = $this->parse_defaults($custom_columns);
1302
  }
1303
 
1304
  /**
1305
+ * Custom media columns
1306
  *
1307
+ * @since 1.3
1308
  */
1309
+ private function get_custom_media_columns()
1310
  {
1311
+ $custom_columns = array(
1312
+ 'column-mediaid' => array(
1313
+ 'label' => __('ID', CPAC_TEXTDOMAIN)
1314
+ ),
1315
+ 'column-mime_type' => array(
1316
+ 'label' => __('Mime type', CPAC_TEXTDOMAIN)
1317
+ ),
1318
+ 'column-file_name' => array(
1319
+ 'label' => __('File name', CPAC_TEXTDOMAIN)
1320
+ ),
1321
+ 'column-dimensions' => array(
1322
+ 'label' => __('Dimensions', CPAC_TEXTDOMAIN)
1323
+ ),
1324
+ 'column-height' => array(
1325
+ 'label' => __('Height', CPAC_TEXTDOMAIN)
1326
+ ),
1327
+ 'column-width' => array(
1328
+ 'label' => __('Width', CPAC_TEXTDOMAIN)
1329
+ ),
1330
+ 'column-caption' => array(
1331
+ 'label' => __('Caption', CPAC_TEXTDOMAIN)
1332
+ ),
1333
+ 'column-description' => array(
1334
+ 'label' => __('Description', CPAC_TEXTDOMAIN)
1335
+ ),
1336
+ 'column-alternate_text' => array(
1337
+ 'label' => __('Alt', CPAC_TEXTDOMAIN)
1338
+ ),
1339
+ 'column-file_paths' => array(
1340
+ 'label' => __('Upload paths', CPAC_TEXTDOMAIN),
1341
+ 'options' => array(
1342
+ 'sortorder' => false
1343
+ )
1344
+ )
1345
  );
1346
 
1347
+ // Get extended image metadata, exif or iptc as available.
1348
+ // uses exif_read_data()
1349
+ if ( function_exists('exif_read_data') ) {
1350
+ $custom_columns = array_merge( $custom_columns, array(
1351
+ 'column-image-aperture' => array(
1352
+ 'label' => __('Aperture', CPAC_TEXTDOMAIN),
1353
+ 'options' => array(
1354
+ 'type_label' => __('Aperture EXIF', CPAC_TEXTDOMAIN)
1355
+ )
1356
+ ),
1357
+ 'column-image-credit' => array(
1358
+ 'label' => __('Credit', CPAC_TEXTDOMAIN),
1359
+ 'options' => array(
1360
+ 'type_label' => __('Credit EXIF', CPAC_TEXTDOMAIN)
1361
+ )
1362
+ ),
1363
+ 'column-image-camera' => array(
1364
+ 'label' => __('Camera', CPAC_TEXTDOMAIN),
1365
+ 'options' => array(
1366
+ 'type_label' => __('Camera EXIF', CPAC_TEXTDOMAIN)
1367
+ )
1368
+ ),
1369
+ 'column-image-caption' => array(
1370
+ 'label' => __('Caption', CPAC_TEXTDOMAIN),
1371
+ 'options' => array(
1372
+ 'type_label' => __('Caption EXIF', CPAC_TEXTDOMAIN)
1373
+ )
1374
+ ),
1375
+ 'column-image-created_timestamp' => array(
1376
+ 'label' => __('Timestamp', CPAC_TEXTDOMAIN),
1377
+ 'options' => array(
1378
+ 'type_label' => __('Timestamp EXIF', CPAC_TEXTDOMAIN)
1379
+ )
1380
+ ),
1381
+ 'column-image-copyright' => array(
1382
+ 'label' => __('Copyright', CPAC_TEXTDOMAIN),
1383
+ 'options' => array(
1384
+ 'type_label' => __('Copyright EXIF', CPAC_TEXTDOMAIN)
1385
+ )
1386
+ ),
1387
+ 'column-image-focal_length' => array(
1388
+ 'label' => __('Focal Length', CPAC_TEXTDOMAIN),
1389
+ 'options' => array(
1390
+ 'type_label' => __('Focal Length EXIF', CPAC_TEXTDOMAIN)
1391
+ )
1392
+ ),
1393
+ 'column-image-iso' => array(
1394
+ 'label' => __('ISO', CPAC_TEXTDOMAIN),
1395
+ 'options' => array(
1396
+ 'type_label' => __('ISO EXIF', CPAC_TEXTDOMAIN)
1397
+ )
1398
+ ),
1399
+ 'column-image-shutter_speed' => array(
1400
+ 'label' => __('Shutter Speed', CPAC_TEXTDOMAIN),
1401
+ 'options' => array(
1402
+ 'type_label' => __('Shutter Speed EXIF', CPAC_TEXTDOMAIN)
1403
+ )
1404
+ ),
1405
+ 'column-image-title' => array(
1406
+ 'label' => __('Title', CPAC_TEXTDOMAIN),
1407
+ 'options' => array(
1408
+ 'type_label' => __('Title EXIF', CPAC_TEXTDOMAIN)
1409
+ )
1410
+ )
1411
+ ));
1412
  }
1413
 
1414
+ // Custom Field support
1415
+ if ( $this->get_meta_by_type('wp-media') ) {
1416
+ $custom_columns['column-meta-1'] = array(
1417
+ 'label' => __('Custom Field', CPAC_TEXTDOMAIN),
1418
+ 'field' => '',
1419
+ 'field_type' => '',
1420
+ 'before' => '',
1421
+ 'after' => '',
1422
+ 'options' => array(
1423
+ 'type_label' => __('Field', CPAC_TEXTDOMAIN),
1424
+ 'class' => 'cpac-box-metafield'
1425
+ )
1426
+ );
1427
+ }
1428
+
1429
+ // merge with defaults
1430
+ $custom_columns = $this->parse_defaults($custom_columns);
1431
+
1432
+ return apply_filters('cpac-custom-media-columns', $custom_columns);
1433
  }
1434
+
1435
  /**
1436
+ * Custom links columns
1437
  *
1438
+ * @since 1.3.1
1439
  */
1440
+ private function get_custom_links_columns()
1441
+ {
1442
+ $custom_columns = array(
1443
+ 'column-link_id' => array (
1444
+ 'label' => __('ID', CPAC_TEXTDOMAIN)
1445
+ ),
1446
+ 'column-description' => array (
1447
+ 'label' => __('Description', CPAC_TEXTDOMAIN)
1448
+ ),
1449
+ 'column-image' => array(
1450
+ 'label' => __('Image', CPAC_TEXTDOMAIN)
1451
+ ),
1452
+ 'column-target' => array(
1453
+ 'label' => __('Target', CPAC_TEXTDOMAIN)
1454
+ ),
1455
+ 'column-owner' => array(
1456
+ 'label' => __('Owner', CPAC_TEXTDOMAIN)
1457
+ ),
1458
+ 'column-notes' => array(
1459
+ 'label' => __('Notes', CPAC_TEXTDOMAIN)
1460
+ ),
1461
+ 'column-rss' => array(
1462
+ 'label' => __('Rss', CPAC_TEXTDOMAIN)
1463
+ ),
1464
+ 'column-length' => array(
1465
+ 'label' => __('Length', CPAC_TEXTDOMAIN)
1466
+ )
1467
+ );
1468
 
1469
+ // merge with defaults
1470
+ $custom_columns = $this->parse_defaults($custom_columns);
1471
+
1472
+ return apply_filters('cpac-custom-links-columns', $custom_columns);
1473
  }
1474
+
1475
  /**
1476
+ * Custom comments columns
1477
  *
1478
+ * @since 1.3.1
1479
  */
1480
+ private function get_custom_comments_columns()
1481
+ {
1482
+ $custom_columns = array(
1483
+ 'column-comment_id' => array(
1484
+ 'label' => __('ID', CPAC_TEXTDOMAIN)
1485
+ ),
1486
+ 'column-author_author' => array(
1487
+ 'label' => __('Author Name', CPAC_TEXTDOMAIN)
1488
+ ),
1489
+ 'column-author_avatar' => array(
1490
+ 'label' => __('Avatar', CPAC_TEXTDOMAIN)
1491
+ ),
1492
+ 'column-author_url' => array(
1493
+ 'label' => __('Author url', CPAC_TEXTDOMAIN)
1494
+ ),
1495
+ 'column-author_ip' => array(
1496
+ 'label' => __('Author IP', CPAC_TEXTDOMAIN)
1497
+ ),
1498
+ 'column-author_email' => array(
1499
+ 'label' => __('Author email', CPAC_TEXTDOMAIN)
1500
+ ),
1501
+ 'column-reply_to' => array(
1502
+ 'label' => __('In Reply To', CPAC_TEXTDOMAIN),
1503
+
1504
+ // options
1505
+ 'options' => array(
1506
+ 'sortorder' => false
1507
+ )
1508
+ ),
1509
+ 'column-approved' => array(
1510
+ 'label' => __('Approved', CPAC_TEXTDOMAIN)
1511
+ ),
1512
+ 'column-date' => array(
1513
+ 'label' => __('Date', CPAC_TEXTDOMAIN)
1514
+ ),
1515
+ 'column-date_gmt' => array(
1516
+ 'label' => __('Date GMT', CPAC_TEXTDOMAIN)
1517
+ ),
1518
+ 'column-agent' => array(
1519
+ 'label' => __('Agent', CPAC_TEXTDOMAIN)
1520
+ ),
1521
+ 'column-excerpt' => array(
1522
+ 'label' => __('Excerpt', CPAC_TEXTDOMAIN)
1523
+ )
1524
+ );
1525
+
1526
+ // Custom Field support
1527
+ if ( $this->get_meta_by_type('wp-comments') ) {
1528
+ $custom_columns['column-meta-1'] = array(
1529
+ 'label' => __('Custom Field', CPAC_TEXTDOMAIN),
1530
+ 'field' => '',
1531
+ 'field_type' => '',
1532
+ 'before' => '',
1533
+ 'after' => '',
1534
+ 'options' => array(
1535
+ 'type_label' => __('Field', CPAC_TEXTDOMAIN),
1536
+ 'class' => 'cpac-box-metafield',
1537
+ 'sortorder' => false,
1538
+ )
1539
+ );
1540
+ }
1541
+
1542
+ // merge with defaults
1543
+ $custom_columns = $this->parse_defaults($custom_columns);
1544
+
1545
+ return apply_filters('cpac-custom-comments-columns', $custom_columns);
1546
+ }
1547
+
1548
+ /**
1549
+ * Parse defaults
1550
+ *
1551
+ * @since 1.1
1552
+ */
1553
+ private function parse_defaults($columns)
1554
+ {
1555
+ // default arguments
1556
+ $defaults = array(
1557
+
1558
+ // stored values
1559
+ 'label' => '',
1560
+ 'state' => '',
1561
+ 'width' => '',
1562
+
1563
+ // static values
1564
+ 'options' => array(
1565
+ 'type_label' => __('Custom', CPAC_TEXTDOMAIN),
1566
+ 'hide_options' => false,
1567
+ 'class' => 'cpac-box-custom',
1568
+ 'sortorder' => 'on',
1569
+ )
1570
+ );
1571
+
1572
+ // parse args
1573
+ foreach ( $columns as $k => $column ) {
1574
+ $c[$k] = wp_parse_args( $column, $defaults);
1575
+
1576
+ // parse options args
1577
+ if ( isset($column['options']) )
1578
+ $c[$k]['options'] = wp_parse_args( $column['options'], $defaults['options']);
1579
+
1580
+ // set type label
1581
+ if ( empty($column['options']['type_label']) && !empty($column['label']) )
1582
+ $c[$k]['options']['type_label'] = $column['label'];
1583
+ }
1584
+
1585
+ return $c;
1586
+ }
1587
+
1588
+ /**
1589
+ * Admin requests for orderby column
1590
+ *
1591
+ * @since 1.0
1592
+ */
1593
+ public static function get_stored_columns($type)
1594
+ {
1595
+ // get plugin options
1596
+ $options = get_option('cpac_options');
1597
+
1598
+ // get saved columns
1599
+ if ( isset($options['columns'][$type]) )
1600
+ return $options['columns'][$type];
1601
+
1602
+ return false;
1603
+ }
1604
+
1605
+ /**
1606
+ * Post Type Menu
1607
+ *
1608
+ * @since 1.0
1609
+ */
1610
+ private function get_menu()
1611
  {
1612
  // set
1613
  $menu = '';
1614
  $count = 1;
1615
 
1616
  // referer
1617
+ $referer = ! empty($_REQUEST['cpac_type']) ? $_REQUEST['cpac_type'] : '';
 
 
1618
 
1619
  // loop
1620
  foreach ( $this->get_types() as $type ) {
1634
  <li>{$divider}<a{$current} href='#cpac-box-{$clean_label}'>{$label}</a></li>
1635
  ";
1636
  }
1637
+
1638
+ // settings url
1639
+ $class_current_settings = $this->is_menu_type_current('plugin_settings') ? ' current': '';
1640
+
1641
+ // options button
1642
+ $options_btn = "<a href='#cpac-box-plugin_settings' class='cpac-settings-link{$class_current_settings}'>".__('Addons')."</a>";
1643
+ //$options_btn = '';
1644
+
1645
  return "
1646
  <div class='cpac-menu'>
1647
  <ul class='subsubsub'>
1648
  {$menu}
1649
  </ul>
1650
+ {$options_btn}
1651
  </div>
1652
  ";
1653
  }
1657
  *
1658
  * @since 1.0
1659
  */
1660
+ private function is_menu_type_current( $type )
1661
  {
1662
  // referer
1663
+ $referer = ! empty($_REQUEST['cpac_type']) ? $_REQUEST['cpac_type'] : '';
 
 
1664
 
1665
  // get label
1666
+ $clean_label = $this->sanitize_string($type);
 
1667
 
1668
  // get first element from post-types
1669
+ $first = array_shift( array_values($this->post_types) );
1670
 
1671
  // display the page that was being viewed before saving
1672
  if ( $referer ) {
1675
  }
1676
 
1677
  // settings page has not yet been saved
1678
+ } elseif ( $first == $type ) {
1679
  return true;
1680
  }
1681
 
1689
  */
1690
  private function get_singular_name( $type )
1691
  {
1692
+ // Links
1693
+ if ( $type == 'wp-links' )
1694
+ $label = 'Links';
1695
+
1696
+ // Comments
1697
+ elseif ( $type == 'wp-comments' )
1698
+ $label = 'Comments';
1699
+
1700
  // Users
1701
+ elseif ( $type == 'wp-users' )
1702
  $label = 'Users';
1703
+
1704
+ // Media
1705
+ elseif ( $type == 'wp-media' )
1706
+ $label = 'Media Library';
1707
+
1708
  // Posts
1709
  else {
1710
  $posttype_obj = get_post_type_object($type);
1713
 
1714
  return $label;
1715
  }
1716
+
1717
  /**
1718
+ * Get plural name of post type
1719
  *
1720
+ * @since 1.3.1
1721
  */
1722
+ private function get_plural_name( $type )
1723
  {
1724
+ $posttype_obj = get_post_type_object($type);
1725
+ if ( $posttype_obj )
1726
+ return $posttype_obj->labels->name;
1727
+
1728
+ return false;
1729
+ }
1730
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1731
  /**
1732
+ * Get screen link to overview screen
1733
  *
1734
+ * @since 1.3.1
1735
  */
1736
+ private function get_type_screen_link( $type )
1737
+ {
1738
+ // Links
1739
+ if ( $type == 'wp-comments' )
1740
+ $link = get_admin_url() . 'edit-comments.php';
 
1741
 
1742
+ // Links
1743
+ if ( $type == 'wp-links' )
1744
+ $link = get_admin_url() . 'link-manager.php';
1745
+
1746
+ // Users
1747
+ if ( $type == 'wp-users' )
1748
+ $link = get_admin_url() . 'users.php';
1749
+
1750
+ // Media
1751
+ elseif ( $type == 'wp-media' )
1752
+ $link = get_admin_url() . 'upload.php';
1753
+
1754
+ // Posts
1755
+ else
1756
+ $link = get_admin_url() . "edit.php?post_type={$type}";
1757
+
1758
+ return $link;
1759
  }
1760
+
1761
  /**
1762
  * Sanitize label
1763
  *
1765
  *
1766
  * @since 1.0
1767
  */
1768
+ protected function sanitize_string($string)
1769
  {
1770
  $string = esc_url($string);
1771
+ $string = str_replace('http://','', $string);
1772
+ $string = str_replace('https://','', $string);
1773
+
1774
+ return $string;
1775
  }
1776
 
1777
  /**
1778
+ * Checks if column-meta key exists
1779
  *
1780
  * @since 1.0
1781
  */
1782
+ public static function is_column_meta( $id = '' )
1783
+ {
1784
+ if ( strpos($id, 'column-meta-') !== false )
1785
+ return true;
1786
+
1787
+ return false;
1788
  }
1789
 
1790
  /**
1791
+ * Get column value of post attachments
1792
  *
1793
+ * @since 1.2.1
1794
  */
1795
+ public static function get_attachment_ids( $post_id )
1796
  {
1797
+ return get_posts(array(
1798
+ 'post_type' => 'attachment',
1799
+ 'numberposts' => -1,
1800
+ 'post_status' => null,
1801
+ 'post_parent' => $post_id,
1802
+ 'fields' => 'ids'
1803
+ ));
1804
+ }
1805
+
1806
+ /**
1807
+ * Strip tags and trim
1808
+ *
1809
+ * @since 1.3
1810
+ */
1811
+ public static function strip_trim($string)
1812
+ {
1813
+ return trim(strip_tags($string));
1814
+ }
1815
+
1816
+ /**
1817
+ * Admin body class
1818
+ *
1819
+ * @since 1.4
1820
+ */
1821
+ function admin_class()
1822
+ {
1823
+ global $current_screen;
1824
+
1825
+ // we dont need the 'edit-' part
1826
+ $screen = str_replace('edit-', '', $current_screen->id);
1827
+
1828
+ // media library exception
1829
+ if ( $current_screen->base == 'upload' && $current_screen->id == 'upload' ) {
1830
+ $screen = 'media';
1831
+ }
1832
 
1833
+ // link exception
1834
+ if ( $current_screen->base == 'link-manager' && $current_screen->id == 'link-manager' ) {
1835
+ $screen = 'links';
1836
+ }
1837
+
1838
+ // loop the available types
1839
+ foreach ( $this->get_types() as $type => $label ) {
1840
+
1841
+ // match against screen or wp-screen
1842
+ if ( $type == $screen || $type == "wp-{$screen}" )
1843
+ return "cp-{$type}";
1844
+ }
1845
  return false;
1846
  }
1847
 
1848
  /**
1849
+ * Admin CSS for Column width
1850
  *
1851
+ * @since 1.4
1852
  */
1853
+ function admin_css()
1854
+ {
1855
+ $css = '';
1856
+
1857
+ // loop throug the available types...
1858
+ foreach ( $this->get_types() as $type ) {
1859
+ $cols = self::get_stored_columns($type);
1860
+ if ( $cols ) {
1861
+
1862
+ // loop through each available column...
1863
+ foreach ( $cols as $col_name => $col ) {
1864
+
1865
+ // and check for stored width and add it to the css
1866
+ if (!empty($col['width']) && is_numeric($col['width']) && $col['width'] > 0 ) {
1867
+ $css .= ".cp-{$type} .wrap table th.column-{$col_name} { width: {$col['width']}% !important; }";
1868
+ }
1869
+ }
1870
+ }
1871
+ }
1872
+
1873
+ echo "<style type='text/css'>{$css}</style>";
1874
+ }
1875
+
1876
+ /**
1877
+ * Unlocks
1878
+ *
1879
+ * @since 1.3
1880
+ */
1881
+ protected function is_unlocked($type)
1882
+ {
1883
+ return preg_match('/^[a-f0-9]{40}$/i', $this->get_license_key($type));
1884
+ }
1885
+
1886
+ /**
1887
+ * Check license key with API
1888
+ *
1889
+ * @since 1.3.3
1890
+ */
1891
+ private function check_remote_key($type, $key)
1892
+ {
1893
+ if ( empty($type) || empty($key) )
1894
  return false;
1895
+
1896
+ // check key with remote API
1897
+ $response = wp_remote_post( $this->api_url, array(
1898
+ 'body' => array(
1899
+ 'api' => 'addon',
1900
+ 'key' => $key,
1901
+ 'type' => $type
1902
+ )
1903
+ ));
1904
+
1905
+ // license will be valid in case of WP error or succes
1906
+ if ( is_wp_error($response) || ( isset($response['body']) && json_decode($response['body']) == 'valid' ) )
1907
+ return true;
1908
+
1909
+ return false;
1910
+ }
1911
+
1912
+ /**
1913
+ * Set masked license key
1914
+ *
1915
+ * @since 1.3.1
1916
+ */
1917
+ private function get_masked_license_key($type)
1918
+ {
1919
+ return '**************************'.substr( $this->get_license_key($type), -4 );
1920
+ }
1921
+
1922
+ /**
1923
+ * Ajax activation
1924
+ *
1925
+ * @since 1.3.1
1926
+ */
1927
+ public function ajax_activation()
1928
+ {
1929
+ // keys
1930
+ $key = $_POST['key'];
1931
+ $type = $_POST['type'];
1932
+
1933
+ // update key
1934
+ if ( $key == 'remove' ) {
1935
+ $this->remove_license_key($type);
1936
+ }
1937
 
1938
+ // set license key
1939
+ elseif ( $this->check_remote_key($type, $key) ) {
1940
 
1941
+ // set key
1942
+ $this->set_license_key($type, $key);
1943
 
1944
+ // returned masked key
1945
+ echo json_encode( $this->get_masked_license_key($type) );
1946
+ }
1947
+
1948
+ exit;
1949
+ }
1950
+
1951
+ /**
1952
+ * Get license key
1953
+ *
1954
+ * @since 1.3
1955
+ */
1956
+ private function get_license_key($type)
1957
+ {
1958
+ return get_option("cpac_{$type}_ac");
1959
+ }
1960
+
1961
+ /**
1962
+ * Set license key
1963
+ *
1964
+ * @since 1.3
1965
+ */
1966
+ private function set_license_key($type, $key)
1967
+ {
1968
+ update_option( "cpac_{$type}_ac", $key);
1969
+ }
1970
+
1971
+ /**
1972
+ * Remove license key
1973
+ *
1974
+ * @since 1.3.1
1975
+ */
1976
+ private function remove_license_key($type)
1977
+ {
1978
+ delete_option( "cpac_{$type}_ac" );
1979
+ delete_transient("cpac_{$type}_trnsnt");
1980
+ }
1981
+
1982
+ /**
1983
+ * Add help tabs
1984
+ *
1985
+ * @since 1.3
1986
+ */
1987
+ public function help_tabs($page)
1988
+ {
1989
+ $screen = get_current_screen();
1990
+
1991
+ if ( $screen->id != $this->admin_page || ! method_exists($screen,'add_help_tab') )
1992
+ return;
1993
+
1994
+ $admin_url = get_admin_url();
1995
+
1996
+ // add help content
1997
+ $tabs = array(
1998
+ array(
1999
+ 'title' => 'Overview',
2000
+ 'content' => "
2001
+ <h5>Codepress Admin Columns</h5>
2002
+ <p>
2003
+ 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.
2004
+ </p>
2005
+
2006
+ "
2007
+ ),
2008
+ array(
2009
+ 'title' => 'Basics',
2010
+ 'content' => "
2011
+ <h5>Show / Hide</h5>
2012
+ <p>
2013
+ You can switch columns on or off by cliking on the checkbox. This will show or hide each column heading.
2014
+ </p>
2015
+ <h5>Change order</h5>
2016
+ <p>
2017
+ By dragging the columns you can change the order which they will appear in.
2018
+ </p>
2019
+ <h5>Change label</h5>
2020
+ <p>
2021
+ By clicking on the triangle you will see the column options. Here you can change each label of the columns heading.
2022
+ </p>
2023
+ <h5>Change coluimn width</h5>
2024
+ <p>
2025
+ 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.
2026
+ </p>
2027
+ "
2028
+ ),
2029
+ array(
2030
+ 'title' => 'Custom Field',
2031
+ 'content' => "
2032
+ <h5>'Custom Field' column</h5>
2033
+ <p>
2034
+ The custom field colum uses the custom fields from posts and users. There are 8 types which you can set.
2035
+ </p>
2036
+ <ul>
2037
+ <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>
2038
+ <li><strong>Image</strong><br/>Value: should only contain an image URL.</li>
2039
+ <li><strong>Media Library Icon</strong><br/>Value: should only contain Attachment IDs ( seperated by ',' ).</li>
2040
+ <li><strong>Excerpt</strong><br/>Value: This will show the first 20 words of the Post content.</li>
2041
+ <li><strong>Multiple Values</strong><br/>Value: should be an array. This will flatten any ( multi dimensional ) array.</li>
2042
+ <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>
2043
+ <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>
2044
+ <li><strong>Post Titles</strong><br/>Value: can be one or more Post ID's (seperated by ',').</li>
2045
+ </ul>
2046
+ "
2047
+ )
2048
+ );
2049
+
2050
+ foreach ( $tabs as $k => $tab ) {
2051
+ $screen->add_help_tab(array(
2052
+ 'id' => 'cpac-tab-'.$k, // unique id
2053
+ 'title' => $tab['title'], // label
2054
+ 'content' => $tab['content'], // body
2055
+ ));
2056
+ }
2057
+ }
2058
+
2059
+ /**
2060
+ * Activation settings
2061
+ *
2062
+ * @since 1.3.1
2063
+ */
2064
+ private function activation_settings()
2065
+ {
2066
+ $class_current_settings = $this->is_menu_type_current('plugin_settings') ? ' current' : ' hidden'; '';
2067
+
2068
+ /** Sortable */
2069
+ $masked_key = '';
2070
+ $class_sortorder_activate = '';
2071
+ $class_sortorder_deactivate = ' hidden';
2072
+
2073
+ // is unlocked
2074
+ if ( $this->is_unlocked('sortable') ) {
2075
+ $masked_key = $this->get_masked_license_key('sortable');
2076
+ $class_sortorder_activate = ' hidden';
2077
+ $class_sortorder_deactivate = '';
2078
+ }
2079
+
2080
+ // find out more
2081
+ $find_out_more = "<a href='{$this->codepress_url}/sortorder-addon/' class='button-primary alignright' target='_blank'>".__('find out more', CPAC_TEXTDOMAIN)." &raquo</a>";
2082
+
2083
+ // info box
2084
+ $sortable_tooltip = "
2085
+ <p>".__('This will make all of the new columns support sorting', CPAC_TEXTDOMAIN).".</p>
2086
+ <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>', CPAC_TEXTDOMAIN)."</p>
2087
+ <p>".__('Perfect for sorting your articles, media files, comments, links and users', CPAC_TEXTDOMAIN).".</p>
2088
+ <img src='" . CPAC_URL.'/assets/images/addon_sortable_1.png' . "' alt='' />
2089
+ {$find_out_more}
2090
+ ";
2091
+
2092
+ // markup
2093
+ $sortable = "
2094
+ <tr id='cpac-activation-sortable' class='last'>
2095
+ <td class='activation_type'>
2096
+ <span>" . __('Sortorder', CPAC_TEXTDOMAIN) . "</span>
2097
+ <div class='cpac-tooltip hidden'>
2098
+ <div class='qtip_title'>" . __('Sortorder', CPAC_TEXTDOMAIN) . "</div>
2099
+ <div class='qtip_content'>
2100
+ <p>" . __($sortable_tooltip, CPAC_TEXTDOMAIN) . "</p>
2101
+ </div>
2102
+ </div>
2103
+ </td>
2104
+ <td class='activation_status'>
2105
+ <div class='activate{$class_sortorder_activate}'>
2106
+ " . __('Inactive', CPAC_TEXTDOMAIN) . "
2107
+ </div>
2108
+ <div class='deactivate{$class_sortorder_deactivate}'>
2109
+ " . __('Active', CPAC_TEXTDOMAIN) . "
2110
+ </div>
2111
+ </td>
2112
+ <td class='activation_code'>
2113
+ <div class='activate{$class_sortorder_activate}'>
2114
+ <input type='text' value='" . __('Fill in your activation code', CPAC_TEXTDOMAIN) . "' name='cpac-sortable-key'>
2115
+ <a href='javascript:;' class='button'>" . __('Activate', CPAC_TEXTDOMAIN) . "<span></span></a>
2116
+ </div>
2117
+ <div class='deactivate{$class_sortorder_deactivate}'>
2118
+ <span class='masked_key'>{$masked_key}</span>
2119
+ <a href='javascript:;' class='button'>" . __('Deactivate', CPAC_TEXTDOMAIN) . "<span></span></a>
2120
+ </div>
2121
+ <div class='activation-error-msg'></div>
2122
+ </td>
2123
+ <td class='activation_more'>{$find_out_more}</td>
2124
+ </tr><!-- #cpac-activation-sortable -->
2125
+ ";
2126
+
2127
+ // settings
2128
+ $row = "
2129
+ <tr id='cpac-box-plugin_settings' valign='top' class='cpac-box-row {$class_current_settings}'>
2130
+ <td colspan='2'>
2131
+ <table class='nopadding'>
2132
+ <tr class='last'>
2133
+ <td>
2134
+ <h2>".__('Activate Add-ons', CPAC_TEXTDOMAIN)."</h2>
2135
+ <p>".__('Add-ons can be unlocked by purchasing a license key. Each key can be used on multiple sites', CPAC_TEXTDOMAIN)." <a target='_blank' href='{$this->codepress_url}/sortorder-addon/'>Visit the Plugin Store</a>.</p>
2136
+ <table class='widefat addons'>
2137
+ <thead>
2138
+ <tr>
2139
+ <th class='activation_type'>".__('Addon', CPAC_TEXTDOMAIN)."</th>
2140
+ <th class='activation_status'>".__('Status', CPAC_TEXTDOMAIN)."</th>
2141
+ <th class='activation_code'>".__('Activation Code', CPAC_TEXTDOMAIN)."</th>
2142
+ <th class='activation_more'></th>
2143
+ </tr>
2144
+ </thead>
2145
+ <tbody>
2146
+ {$sortable}
2147
+ </tbody>
2148
+ </table>
2149
+ <div class='addon-translation-string hidden'>
2150
+ <span class='tstring-fill-in'>" . __('Enter your activation code', CPAC_TEXTDOMAIN) . "</span>
2151
+ <span class='tstring-unrecognised'>" . __('Activation code unrecognised', CPAC_TEXTDOMAIN) . "</span>
2152
+ </div>
2153
+ </td>
2154
+ </tr>
2155
+ <!--
2156
+ <tr class='last'>
2157
+ <td colspan='2'>
2158
+ <h2>Options</h2>
2159
+ <ul class='cpac-options'>
2160
+ <li>
2161
+ <div class='cpac-option-label'>Thumbnail size</div>
2162
+ <div class='cpac-option-inputs'>
2163
+ <input type='text' id='thumbnail_size_w' class='small-text' name='cpac_options[settings][thumb_width]' value='80'/>
2164
+ <label for='thumbnail_size_w'>Width</label>
2165
+ <br/>
2166
+ <input type='text' id='thumbnail_size_h' class='small-text' name='cpac_options[settings][thumb_height]' value='80'/>
2167
+ <label for='thumbnail_size_h'>Height</label>
2168
+ </div>
2169
+ </li>
2170
+ <li>
2171
+ <div class='cpac-option-label'>Excerpt length</div>
2172
+ <div class='cpac-option-inputs'>
2173
+
2174
+ <input type='text' id='excerpt_length' class='small-text' name='cpac_options[settings][excerpt_length]' value='15'/>
2175
+ <label for='excerpt_length'>Number of words</label>
2176
+ </div>
2177
+ </li>
2178
+ </ul>
2179
+ </td>
2180
+ </tr>
2181
+ -->
2182
+ </table>
2183
+ </td>
2184
+ </tr><!-- #cpac-box-plugin_settings -->
2185
+ ";
2186
+
2187
+ return $row;
2188
  }
2189
 
2190
  /**
2198
  */
2199
  public function plugin_settings_page()
2200
  {
2201
+
2202
  // loop through post types
2203
  $rows = '';
2204
  foreach ( $this->get_types() as $type ) {
2205
 
2206
  // post type label
2207
+ $label = $this->get_singular_name($type);
2208
+
2209
+ // screen link
2210
+ $screen_link = '';
2211
+ //$screen_link = $this->get_type_screen_link($type);
2212
+ //$screen_link = "<a href='{$screen_link}' class='go-to-screen'>" . sprintf( __('go to %s screen'), strtolower($label) ) . "</a>";
2213
+
2214
  // id
2215
  $id = $this->sanitize_string($type);
2216
 
2217
  // build draggable boxes
2218
  $boxes = $this->get_column_boxes($type);
2219
+
2220
  // class
2221
  $class = $this->is_menu_type_current($type) ? ' current' : ' hidden';
2222
 
2223
  $rows .= "
2224
  <tr id='cpac-box-{$id}' valign='top' class='cpac-box-row{$class}'>
2225
  <th class='cpac_post_type' scope='row'>
2226
+ {$label}{$screen_link}
2227
  </th>
2228
  <td>
2229
  <h3 class='cpac_post_type hidden'>{$label}</h3>
2230
+ {$boxes}
2231
  </td>
2232
  </tr>
2233
  ";
2234
  }
2235
 
2236
+ // Activation
2237
+ $activation_settings = $this->activation_settings();
2238
+
2239
  // Post Type Menu
2240
  $menu = $this->get_menu();
2241
 
2242
+ // Help screen message
2243
+ $help_text = '';
2244
+ if ( version_compare( get_bloginfo('version'), '3.2', '>' ) )
2245
+ $help_text = '<p>'.__('You will find a short overview at the <strong>Help</strong> section in the top-right screen.', CPAC_TEXTDOMAIN).'</p>';
2246
+
2247
+ // find out more
2248
+ $find_out_more = "<a href='{$this->codepress_url}/sortorder-addon/' class='alignright green' target='_blank'>".__('find out more', CPAC_TEXTDOMAIN)." &raquo</a>";
2249
+
2250
  ?>
2251
  <div id="cpac" class="wrap">
2252
+ <?php screen_icon(CPAC_SLUG) ?>
2253
+ <h2><?php _e('Codepress Admin Columns', CPAC_TEXTDOMAIN); ?></h2>
2254
  <?php echo $menu ?>
2255
+
2256
+ <div class="postbox-container cpac-col-right">
2257
+ <div class="metabox-holder">
2258
+ <div class="meta-box-sortables">
2259
+
2260
+ <div id="addons-cpac-settings" class="postbox">
2261
+ <div title="Click to toggle" class="handlediv"><br></div>
2262
+ <h3 class="hndle">
2263
+ <span><?php _e('Addons', CPAC_TEXTDOMAIN) ?></span>
2264
+ </h3>
2265
+ <div class="inside">
2266
+ <p><?php _e('By default WordPress let\'s you only sort by title, date, comments and author.', CPAC_TEXTDOMAIN) ?></p>
2267
+ <p><?php _e('Make <strong>all columns</strong> of <strong>all types</strong> support sorting &#8212; with the sorting addon.', CPAC_TEXTDOMAIN) ?></p>
2268
+ <?php echo $find_out_more ?>
2269
+ </div>
2270
+ </div><!-- addons-cpac-settings -->
2271
+
2272
+ <div id="likethisplugin-cpac-settings" class="postbox">
2273
+ <div title="Click to toggle" class="handlediv"><br></div>
2274
+ <h3 class="hndle">
2275
+ <span><?php _e('Like this plugin?', CPAC_TEXTDOMAIN) ?></span>
2276
+ </h3>
2277
+ <div class="inside">
2278
+ <p><?php _e('Why not do any or all of the following', CPAC_TEXTDOMAIN) ?>:</p>
2279
+ <ul>
2280
+ <li><a href="<?php echo $this->codepress_url ?>/"><?php _e('Link to it so other folks can find out about it.', CPAC_TEXTDOMAIN) ?></a></li>
2281
+ <li><a href="<?php echo $this->wordpress_url ?>"><?php _e('Give it a 5 star rating on WordPress.org.', CPAC_TEXTDOMAIN) ?></a></li>
2282
+ <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.', CPAC_TEXTDOMAIN) ?></a></li>
2283
+ </ul>
2284
+ </div>
2285
+ </div><!-- likethisplugin-cpac-settings -->
2286
+
2287
+ <div id="side-cpac-settings" class="postbox">
2288
+ <div title="Click to toggle" class="handlediv"><br></div>
2289
+ <h3 class="hndle">
2290
+ <span><?php _e('Need support?', CPAC_TEXTDOMAIN) ?></span>
2291
+ </h3>
2292
+ <div class="inside">
2293
+ <?php echo $help_text ?>
2294
+ <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.', CPAC_TEXTDOMAIN), 'http://wordpress.org/tags/codepress-admin-columns', '<a href="mailto:info@codepress.nl">info@codepress.nl</a>' );?></p>
2295
+ <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>.", CPAC_TEXTDOMAIN), "{$this->codepress_url}/feedback");?></p>
2296
+ </div>
2297
+ </div><!-- side-cpac-settings -->
2298
+
2299
+ </div>
2300
+ </div>
2301
+ </div><!-- .postbox-container -->
2302
+
2303
+ <div class="postbox-container cpac-col-left">
2304
  <div class="metabox-holder">
2305
  <div class="meta-box-sortables">
2306
 
2307
  <div id="general-cpac-settings" class="postbox">
2308
  <div title="Click to toggle" class="handlediv"><br></div>
2309
  <h3 class="hndle">
2310
+ <span><?php _e('Admin Columns', CPAC_TEXTDOMAIN ); ?></span>
2311
  </h3>
2312
  <div class="inside">
2313
  <form method="post" action="options.php">
2315
  <?php settings_fields( 'cpac-settings-group' ); ?>
2316
 
2317
  <table class="form-table">
2318
+ <!-- columns -->
2319
+ <?php echo $rows; ?>
2320
+
2321
+ <!-- activation -->
2322
+ <?php echo $activation_settings; ?>
2323
 
2324
  <tr class="bottom" valign="top">
2325
  <th scope="row"></th>
2337
  <div id="restore-cpac-settings" class="postbox">
2338
  <div title="Click to toggle" class="handlediv"><br></div>
2339
  <h3 class="hndle">
2340
+ <span><?php _e('Restore defaults', CPAC_TEXTDOMAIN) ?></span>
2341
  </h3>
2342
  <div class="inside">
2343
  <form method="post" action="">
2344
+ <input type="submit" class="button" name="cpac-restore-defaults" value="<?php _e('Restore default settings', CPAC_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", CPAC_TEXTDOMAIN); ?>');" />
2345
  </form>
2346
+ <p class="description"><?php _e('This will delete all column settings and restore the default settings.', CPAC_TEXTDOMAIN); ?></p>
2347
  </div>
2348
  </div><!-- restore-cpac-settings -->
2349
 
2350
  </div>
2351
  </div>
2352
+ </div><!-- .postbox-container -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2353
  </div>
2354
  <?php
2355
  }
2356
  }
2357
+
2358
+ /**
2359
+ * Init Class Codepress_Admin_Columns
2360
+ *
2361
+ * @since 1.0
2362
+ */
2363
+ new Codepress_Admin_Columns();
2364
+
2365
+
2366
+ /**
2367
+ * Init Class Codepress_Sortable_Columns
2368
+ *
2369
+ * @since 1.3
2370
+ */
2371
+ new Codepress_Sortable_Columns();
2372
+
2373
  ?>
languages/codepress-admin-columns-nl_NL.mo CHANGED
Binary file
languages/codepress-admin-columns-nl_NL.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Codepress Admin Columns\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-11-29 15:16+0100\n"
6
- "PO-Revision-Date: 2012-04-20 21:11+0100\n"
7
  "Last-Translator: Codepress <info@codepress.nl>\n"
8
  "Language-Team: Codepress <info@codepress.nl>\n"
9
  "MIME-Version: 1.0\n"
@@ -17,225 +17,442 @@ msgstr ""
17
  "X-Poedit-SearchPath-0: .\n"
18
  "X-Poedit-SearchPath-1: ..\n"
19
 
20
- #: ../codepress-admin-columns.php:133
21
- #: ../_codepress-admin-columns.php:132
22
  msgid "Settings"
23
  msgstr "Instellingen"
24
 
25
- #: ../codepress-admin-columns.php:280
26
- #: ../_codepress-admin-columns.php:325
27
  msgid "Add Custom Field Column"
28
  msgstr "Voeg custom field kolom toe"
29
 
30
- #: ../codepress-admin-columns.php:440
31
- #: ../_codepress-admin-columns.php:480
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  msgid "Default"
33
  msgstr ""
34
 
35
- #: ../codepress-admin-columns.php:441
36
- #: ../codepress-admin-columns.php:1106
37
- #: ../_codepress-admin-columns.php:481
38
- #: ../_codepress-admin-columns.php:1131
39
  msgid "Image"
40
  msgstr "Afbeelding"
41
 
42
- #: ../codepress-admin-columns.php:442
43
- #: ../_codepress-admin-columns.php:482
44
  msgid "Media Library Icon"
45
  msgstr "Media bibliotheek Icoon"
46
 
47
- #: ../codepress-admin-columns.php:443
48
- #: ../codepress-admin-columns.php:1114
49
- #: ../codepress-admin-columns.php:1116
50
- #: ../_codepress-admin-columns.php:483
51
- #: ../_codepress-admin-columns.php:1139
52
- #: ../_codepress-admin-columns.php:1141
53
  msgid "Excerpt"
54
  msgstr "Samenvatting"
55
 
56
- #: ../codepress-admin-columns.php:444
57
- #: ../_codepress-admin-columns.php:484
58
  msgid "Multiple Values"
59
  msgstr "Meerdere waarden"
60
 
61
- #: ../codepress-admin-columns.php:445
62
- #: ../_codepress-admin-columns.php:485
63
  msgid "Numeric"
64
  msgstr "Numerieke"
65
 
66
- #: ../codepress-admin-columns.php:470
67
- #: ../_codepress-admin-columns.php:510
 
 
 
 
 
 
 
 
68
  msgid "This field can not be removed"
69
  msgstr "Dit veld kan niet worden verwijderd"
70
 
71
- #: ../codepress-admin-columns.php:474
72
- #: ../_codepress-admin-columns.php:514
73
  msgid "Remove"
74
  msgstr "Verwijder"
75
 
76
- #: ../codepress-admin-columns.php:790
77
- #: ../_codepress-admin-columns.php:806
78
  msgid "Standard"
79
  msgstr "Standaard"
80
 
81
- #: ../codepress-admin-columns.php:1075
82
- #: ../_codepress-admin-columns.php:1086
 
 
 
 
 
 
 
 
 
83
  msgid "Comments"
84
  msgstr "Reacties"
85
 
86
- #: ../codepress-admin-columns.php:1104
87
- #: ../_codepress-admin-columns.php:1129
 
 
 
88
  msgid "Featured Image"
89
  msgstr "Uitgelichte afbeelding"
90
 
91
- #: ../codepress-admin-columns.php:1124
92
- #: ../codepress-admin-columns.php:1126
93
- #: ../_codepress-admin-columns.php:1149
94
- #: ../_codepress-admin-columns.php:1151
95
- msgid "Sticky"
96
- msgstr "Sticky"
97
-
98
- #: ../codepress-admin-columns.php:1134
99
- #: ../_codepress-admin-columns.php:1159
100
  msgid "Page Order"
101
  msgstr "Pagina Volgorde"
102
 
103
- #: ../codepress-admin-columns.php:1136
104
- #: ../_codepress-admin-columns.php:1161
105
- msgid "Order"
106
- msgstr "Volgorde"
107
-
108
- #: ../codepress-admin-columns.php:1145
109
- #: ../codepress-admin-columns.php:1147
110
- #: ../_codepress-admin-columns.php:1170
111
- #: ../_codepress-admin-columns.php:1172
112
- msgid "Page Template"
113
- msgstr "Pagina Template"
114
-
115
- #: ../codepress-admin-columns.php:1156
116
- #: ../codepress-admin-columns.php:1158
117
- #: ../_codepress-admin-columns.php:1181
118
- #: ../_codepress-admin-columns.php:1183
119
  msgid "Post Format"
120
  msgstr ""
121
 
122
- #: ../codepress-admin-columns.php:1171
123
- #: ../_codepress-admin-columns.php:1196
124
- msgid "Taxonomy"
125
- msgstr ""
 
 
126
 
127
- #: ../codepress-admin-columns.php:1189
128
- #: ../codepress-admin-columns.php:1191
129
- #: ../_codepress-admin-columns.php:1214
130
- #: ../_codepress-admin-columns.php:1216
131
  msgid "Slug"
132
  msgstr ""
133
 
134
- #: ../codepress-admin-columns.php:1198
135
- #: ../codepress-admin-columns.php:1200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  msgid "Word count"
137
  msgstr "Aantal woorden"
138
 
139
- #: ../codepress-admin-columns.php:1206
140
- #: ../codepress-admin-columns.php:1208
141
- #: ../_codepress-admin-columns.php:1223
142
- #: ../_codepress-admin-columns.php:1225
143
- msgid "Attachment"
 
 
 
 
 
 
 
 
 
144
  msgstr ""
145
 
146
- #: ../codepress-admin-columns.php:1216
147
- #: ../_codepress-admin-columns.php:1233
 
148
  msgid "Custom Field"
149
  msgstr ""
150
 
151
- #: ../codepress-admin-columns.php:1222
152
- #: ../_codepress-admin-columns.php:1239
 
153
  msgid "Field"
154
  msgstr "Veld"
155
 
156
- #: ../codepress-admin-columns.php:1246
157
- #: ../codepress-admin-columns.php:1248
158
  msgid "User ID"
159
  msgstr ""
160
 
161
- #: ../codepress-admin-columns.php:1255
162
- #: ../codepress-admin-columns.php:1257
 
 
 
163
  msgid "First name"
164
  msgstr "Voornaam"
165
 
166
- #: ../codepress-admin-columns.php:1263
167
- #: ../codepress-admin-columns.php:1265
168
  msgid "Last name"
169
  msgstr "Achternaam"
170
 
171
- #: ../codepress-admin-columns.php:1271
172
- #: ../codepress-admin-columns.php:1273
173
  msgid "Url"
174
  msgstr ""
175
 
176
- #: ../codepress-admin-columns.php:1279
177
- #: ../codepress-admin-columns.php:1281
178
  msgid "Registered"
179
  msgstr "Registratie"
180
 
181
- #: ../codepress-admin-columns.php:1307
182
- #: ../_codepress-admin-columns.php:1119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  msgid "Custom"
184
  msgstr ""
185
 
186
- #: ../codepress-admin-columns.php:1596
187
- #: ../_codepress-admin-columns.php:226
188
- msgid "Codepress Admin Columns"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  msgstr ""
190
 
191
- #: ../codepress-admin-columns.php:1605
192
- #: ../_codepress-admin-columns.php:235
193
- msgid "Admin Columns"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  msgstr ""
195
 
196
- #: ../codepress-admin-columns.php:1620
197
- #: ../_codepress-admin-columns.php:250
198
- msgid "Save Changes"
199
- msgstr "Wijzigingen opslaan"
200
 
201
- #: ../codepress-admin-columns.php:1632
202
- #: ../_codepress-admin-columns.php:262
203
- msgid "Restore defaults"
204
- msgstr "Herstel instellingen"
205
 
206
- #: ../codepress-admin-columns.php:1636
207
- #: ../_codepress-admin-columns.php:266
208
- msgid "Restore default settings"
209
- msgstr "Herstel standaard instellingen"
210
 
211
- #: ../codepress-admin-columns.php:1636
212
- #: ../_codepress-admin-columns.php:266
213
- msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
214
- msgstr "Waarschuwing! ALLE bewaarde instellingen worden verwijderd. Dit kan niet worden ongedaan. \\'OK\\' om te verwijderen, \\'Annuleren\\' om te stoppen"
215
 
216
- #: ../codepress-admin-columns.php:1638
217
- #: ../_codepress-admin-columns.php:268
218
- msgid "This will delete all column settings and restore the default settings."
219
- msgstr "Hiermee worden alle kolommen instellingen verwijderd en de standaardinstellingen hersteld."
 
 
 
 
 
 
 
 
 
 
 
220
 
221
- #: ../codepress-admin-columns.php:1653
222
- #: ../_codepress-admin-columns.php:283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  msgid "Need support?"
224
  msgstr "Hulp nodig?"
225
 
226
- #: ../codepress-admin-columns.php:1656
227
  #, php-format
228
  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."
229
  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."
230
 
231
- #: ../codepress-admin-columns.php:1657
232
- #: ../_codepress-admin-columns.php:287
233
  #, php-format
234
  msgid "If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>."
235
  msgstr "Als een bug bent tegen gekomen, of een feature wil aanvragen, stuur ons dan <a href='%s'>je feedback</a>."
236
 
237
- #: ../_codepress-admin-columns.php:286
238
- #, php-format
239
- msgid "If you are having problems with this plugin, please talk about them in the <a href=\"%s\">Support forums</a>."
240
- msgstr "Als je problem hebt met deze plugin, stel je vragen dan in de <a href=\"%s\">Support forums</a>."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
 
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:10+0100\n"
7
  "Last-Translator: Codepress <info@codepress.nl>\n"
8
  "Language-Team: Codepress <info@codepress.nl>\n"
9
  "MIME-Version: 1.0\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 "origineel"
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 "Antwoord op"
292
+
293
+ #: ../codepress-admin-columns.php:2225
294
+ msgid "Approved"
295
+ msgstr "Goedgekeurd"
296
+
297
+ #: ../codepress-admin-columns.php:2231
298
+ msgid "Date GMT"
299
+ msgstr "Datum GMT"
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 &#8212; with the sorting addon."
399
+ msgstr "Zorg ervoor dat <strong>alle kolommen</strong> van <strong>alle typen</strong> sorteren ondersteund &#8212; 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,530 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Codepress Admin Columns\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-04-11 11:48+0100\n"
6
+ "PO-Revision-Date: 2012-04-20 21:14+0100\n"
7
+ "Last-Translator: Codepress <info@codepress.nl>\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:2238
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:2278
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:2031
58
+ #: ../codepress-admin-columns.php:2350
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:2341
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
+ #: ../codepress-admin-columns.php:1512
85
+ msgid "Remove"
86
+ msgstr "Usuń"
87
+
88
+ #: ../codepress-admin-columns.php:974
89
+ msgid "Standard"
90
+ msgstr "Standardowe"
91
+
92
+ #: ../codepress-admin-columns.php:1215
93
+ msgid "original"
94
+ msgstr "oryginalny"
95
+
96
+ #: ../codepress-admin-columns.php:1381
97
+ #: ../codepress-admin-columns.php:1392
98
+ #, php-format
99
+ msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>"
100
+ msgstr "Opublikowany dnia <a href=\"%1$s\">%2$s o godz. %3$s</a>"
101
+
102
+ #: ../codepress-admin-columns.php:1464
103
+ msgid "Edit this item"
104
+ msgstr "Edytuj element"
105
+
106
+ #: ../codepress-admin-columns.php:1464
107
+ #: ../codepress-admin-columns.php:1504
108
+ msgid "Edit"
109
+ msgstr "Edytuj"
110
+
111
+ #: ../codepress-admin-columns.php:1465
112
+ msgid "Edit this item inline"
113
+ msgstr "Edytuj element"
114
+
115
+ #: ../codepress-admin-columns.php:1465
116
+ msgid "Quick&nbsp;Edit"
117
+ msgstr "Szybka&nbsp;edycja"
118
+
119
+ #: ../codepress-admin-columns.php:1469
120
+ msgid "Restore this item from the Trash"
121
+ msgstr "Przywróć ten element z kosza"
122
+
123
+ #: ../codepress-admin-columns.php:1469
124
+ msgid "Restore"
125
+ msgstr "Przywróć"
126
+
127
+ #: ../codepress-admin-columns.php:1471
128
+ msgid "Move this item to the Trash"
129
+ msgstr "Przenieś ten element do kosza"
130
+
131
+ #: ../codepress-admin-columns.php:1471
132
+ msgid "Trash"
133
+ msgstr "Kosz"
134
+
135
+ #: ../codepress-admin-columns.php:1473
136
+ msgid "Delete this item permanently"
137
+ msgstr "Usuń ten element na zawsze"
138
+
139
+ #: ../codepress-admin-columns.php:1473
140
+ msgid "Delete Permanently"
141
+ msgstr "Usuń na zawsze"
142
+
143
+ #: ../codepress-admin-columns.php:1478
144
+ #, php-format
145
+ msgid "Preview &#8220;%s&#8221;"
146
+ msgstr "Podejrzyj &#8220;%s&#8221;"
147
+
148
+ #: ../codepress-admin-columns.php:1478
149
+ msgid "Preview"
150
+ msgstr "Podejrzyj"
151
+
152
+ #: ../codepress-admin-columns.php:1480
153
+ #, php-format
154
+ msgid "View &#8220;%s&#8221;"
155
+ msgstr "Zobacz &#8220;%s&#8221;"
156
+
157
+ #: ../codepress-admin-columns.php:1480
158
+ msgid "View"
159
+ msgstr "Zobacz"
160
+
161
+ #: ../codepress-admin-columns.php:1510
162
+ msgid "Delete"
163
+ msgstr "Usuń"
164
+
165
+ #: ../codepress-admin-columns.php:1997
166
+ msgid "Comments"
167
+ msgstr "Komentarze"
168
+
169
+ #: ../codepress-admin-columns.php:2003
170
+ msgid "Icon"
171
+ msgstr "Ikona"
172
+
173
+ #: ../codepress-admin-columns.php:2028
174
+ msgid "Featured Image"
175
+ msgstr "Ikona wpisu"
176
+
177
+ #: ../codepress-admin-columns.php:2034
178
+ #: ../codepress-admin-columns.php:2088
179
+ msgid "Page Order"
180
+ msgstr "Kolejność stron"
181
+
182
+ #: ../codepress-admin-columns.php:2037
183
+ #: ../codepress-admin-columns.php:2105
184
+ msgid "Post Format"
185
+ msgstr "Format wpisu"
186
+
187
+ #: ../codepress-admin-columns.php:2040
188
+ #: ../codepress-admin-columns.php:2223
189
+ #: ../codepress-admin-columns.php:2272
190
+ #: ../codepress-admin-columns.php:2312
191
+ msgid "ID"
192
+ msgstr "ID"
193
+
194
+ #: ../codepress-admin-columns.php:2043
195
+ msgid "Slug"
196
+ msgstr "Bezpośredni odnośnik"
197
+
198
+ #: ../codepress-admin-columns.php:2046
199
+ msgid "Attachment"
200
+ msgstr "Załącznik"
201
+
202
+ #: ../codepress-admin-columns.php:2049
203
+ msgid "No. of Attachments"
204
+ msgstr "Liczba załączników"
205
+
206
+ #: ../codepress-admin-columns.php:2052
207
+ msgid "Roles"
208
+ msgstr "Role"
209
+
210
+ #: ../codepress-admin-columns.php:2055
211
+ #: ../codepress-admin-columns.php:3095
212
+ msgid "Status"
213
+ msgstr "Status"
214
+
215
+ #: ../codepress-admin-columns.php:2058
216
+ msgid "Comment status"
217
+ msgstr "Status komentarza"
218
+
219
+ #: ../codepress-admin-columns.php:2061
220
+ msgid "Ping status"
221
+ msgstr "Status ping"
222
+
223
+ #: ../codepress-admin-columns.php:2064
224
+ #: ../codepress-admin-columns.php:2175
225
+ msgid "Actions"
226
+ msgstr "Działania"
227
+
228
+ #: ../codepress-admin-columns.php:2074
229
+ msgid "Word count"
230
+ msgstr "Liczba słów"
231
+
232
+ #: ../codepress-admin-columns.php:2081
233
+ msgid "Sticky"
234
+ msgstr "Przyklejone"
235
+
236
+ #: ../codepress-admin-columns.php:2090
237
+ msgid "Order"
238
+ msgstr "Kolejność"
239
+
240
+ #: ../codepress-admin-columns.php:2098
241
+ msgid "Page Template"
242
+ msgstr "Szablon strony"
243
+
244
+ #: ../codepress-admin-columns.php:2117
245
+ msgid "Taxonomy"
246
+ msgstr "Taksonomia"
247
+
248
+ #: ../codepress-admin-columns.php:2127
249
+ #: ../codepress-admin-columns.php:2197
250
+ #: ../codepress-admin-columns.php:2357
251
+ msgid "Custom Field"
252
+ msgstr "Własne pole"
253
+
254
+ #: ../codepress-admin-columns.php:2133
255
+ #: ../codepress-admin-columns.php:2203
256
+ #: ../codepress-admin-columns.php:2363
257
+ msgid "Field"
258
+ msgstr "Pole"
259
+
260
+ #: ../codepress-admin-columns.php:2154
261
+ msgid "User ID"
262
+ msgstr "ID użytkownika"
263
+
264
+ #: ../codepress-admin-columns.php:2157
265
+ msgid "Nickname"
266
+ msgstr "Pseudonim"
267
+
268
+ #: ../codepress-admin-columns.php:2160
269
+ msgid "First name"
270
+ msgstr "Imię"
271
+
272
+ #: ../codepress-admin-columns.php:2163
273
+ msgid "Last name"
274
+ msgstr "Nazwisko"
275
+
276
+ #: ../codepress-admin-columns.php:2166
277
+ msgid "Url"
278
+ msgstr "Adres URL"
279
+
280
+ #: ../codepress-admin-columns.php:2169
281
+ msgid "Registered"
282
+ msgstr "Zarejestrowany"
283
+
284
+ #: ../codepress-admin-columns.php:2172
285
+ #: ../codepress-admin-columns.php:2244
286
+ #: ../codepress-admin-columns.php:2275
287
+ msgid "Description"
288
+ msgstr "Opis"
289
+
290
+ #: ../codepress-admin-columns.php:2189
291
+ msgid "Postcount"
292
+ msgstr "Liczba wpisów"
293
+
294
+ #: ../codepress-admin-columns.php:2226
295
+ msgid "Mime type"
296
+ msgstr "Typ pliku"
297
+
298
+ #: ../codepress-admin-columns.php:2229
299
+ msgid "File name"
300
+ msgstr "Nazwa pliku"
301
+
302
+ #: ../codepress-admin-columns.php:2232
303
+ msgid "Dimensions"
304
+ msgstr "Wymiary"
305
+
306
+ #: ../codepress-admin-columns.php:2235
307
+ msgid "Height"
308
+ msgstr "Wysokość"
309
+
310
+ #: ../codepress-admin-columns.php:2241
311
+ msgid "Caption"
312
+ msgstr "Tytuł"
313
+
314
+ #: ../codepress-admin-columns.php:2247
315
+ msgid "Alt"
316
+ msgstr "Tekst alternatywny"
317
+
318
+ #: ../codepress-admin-columns.php:2250
319
+ msgid "Upload paths"
320
+ msgstr "Ścieżki plików"
321
+
322
+ #: ../codepress-admin-columns.php:2281
323
+ msgid "Target"
324
+ msgstr "Cel"
325
+
326
+ #: ../codepress-admin-columns.php:2284
327
+ msgid "Owner"
328
+ msgstr "Właściciel"
329
+
330
+ #: ../codepress-admin-columns.php:2287
331
+ msgid "Notes"
332
+ msgstr "Notatki"
333
+
334
+ #: ../codepress-admin-columns.php:2290
335
+ msgid "Rss"
336
+ msgstr "Rss"
337
+
338
+ #: ../codepress-admin-columns.php:2293
339
+ msgid "Length"
340
+ msgstr "Długość"
341
+
342
+ #: ../codepress-admin-columns.php:2315
343
+ msgid "Author Name"
344
+ msgstr "Imię Autora"
345
+
346
+ #: ../codepress-admin-columns.php:2318
347
+ msgid "Avatar"
348
+ msgstr "Avatar"
349
+
350
+ #: ../codepress-admin-columns.php:2321
351
+ msgid "Author url"
352
+ msgstr "URL Autora"
353
+
354
+ #: ../codepress-admin-columns.php:2324
355
+ msgid "Author IP"
356
+ msgstr "IP Autora"
357
+
358
+ #: ../codepress-admin-columns.php:2327
359
+ msgid "Author email"
360
+ msgstr "Email Autora"
361
+
362
+ #: ../codepress-admin-columns.php:2330
363
+ msgid "In Reply To"
364
+ msgstr "W odpowiedzi na"
365
+
366
+ #: ../codepress-admin-columns.php:2338
367
+ msgid "Approved"
368
+ msgstr "Zatwierdzony"
369
+
370
+ #: ../codepress-admin-columns.php:2344
371
+ msgid "Date GMT"
372
+ msgstr "Data GMT"
373
+
374
+ #: ../codepress-admin-columns.php:2347
375
+ msgid "Agent"
376
+ msgstr "Przeglądarka"
377
+
378
+ #: ../codepress-admin-columns.php:2393
379
+ msgid "Custom"
380
+ msgstr "Włąsne"
381
+
382
+ #: ../codepress-admin-columns.php:2470
383
+ #: ../codepress-admin-columns.php:3218
384
+ msgid "Addons"
385
+ msgstr "Dodatki"
386
+
387
+ #: ../codepress-admin-columns.php:3036
388
+ #: ../codepress-admin-columns.php:3203
389
+ msgid "find out more"
390
+ msgstr "dowiedz się więcej"
391
+
392
+ #: ../codepress-admin-columns.php:3040
393
+ msgid "This will make all of the new columns support sorting"
394
+ msgstr "Dzięki temu wszystkie nowe kolumny będą sortowalne"
395
+
396
+ #: ../codepress-admin-columns.php:3041
397
+ 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>"
398
+ 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>"
399
+
400
+ #: ../codepress-admin-columns.php:3042
401
+ msgid "Perfect for sorting your articles, media files, comments, links and users"
402
+ msgstr "Idealne rozwiązanie do sortowania wpisów, mediów, komentarzy, linków i użytkowników"
403
+
404
+ #: ../codepress-admin-columns.php:3051
405
+ #: ../codepress-admin-columns.php:3053
406
+ msgid "Sortorder"
407
+ msgstr "Kierunek sortowania"
408
+
409
+ #: ../codepress-admin-columns.php:3061
410
+ msgid "Inactive"
411
+ msgstr "Nieaktywny"
412
+
413
+ #: ../codepress-admin-columns.php:3064
414
+ msgid "Active"
415
+ msgstr "Aktywny"
416
+
417
+ #: ../codepress-admin-columns.php:3069
418
+ msgid "Fill in your activation code"
419
+ msgstr "Wpisz kod aktywacyjny"
420
+
421
+ #: ../codepress-admin-columns.php:3070
422
+ msgid "Activate"
423
+ msgstr "Aktywuj"
424
+
425
+ #: ../codepress-admin-columns.php:3074
426
+ msgid "Deactivate"
427
+ msgstr "Deaktywuj"
428
+
429
+ #: ../codepress-admin-columns.php:3089
430
+ msgid "Activate Add-ons"
431
+ msgstr "Aktywuj dodatki"
432
+
433
+ #: ../codepress-admin-columns.php:3090
434
+ msgid "Add-ons can be unlocked by purchasing a license key. Each key can be used on multiple sites"
435
+ msgstr "Dodatki mągą być aktywowane po zakupie licencji. Każdy klucz licencji może być sotsowany na wielu stronach"
436
+
437
+ #: ../codepress-admin-columns.php:3094
438
+ msgid "Addon"
439
+ msgstr "Dodatek"
440
+
441
+ #: ../codepress-admin-columns.php:3096
442
+ msgid "Activation Code"
443
+ msgstr "Kod aktywacyjny"
444
+
445
+ #: ../codepress-admin-columns.php:3105
446
+ msgid "Enter your activation code"
447
+ msgstr "Wpisz kod aktywacyjny"
448
+
449
+ #: ../codepress-admin-columns.php:3106
450
+ msgid "Activation code unrecognised"
451
+ msgstr "Kod aktywacyjny nie został rozpoznany"
452
+
453
+ #: ../codepress-admin-columns.php:3200
454
+ msgid "You will find a short overview at the <strong>Help</strong> section in the top-right screen."
455
+ msgstr "Krótkie podsumowanie znajdziesz w dziale <strong>Pomocy</strong>, w prawym, górnym rogu ekranu."
456
+
457
+ #: ../codepress-admin-columns.php:3208
458
+ msgid "Codepress Admin Columns"
459
+ msgstr "Edytor kolumn"
460
+
461
+ #: ../codepress-admin-columns.php:3221
462
+ msgid "By default WordPress let's you only sort by title, date, comments and author."
463
+ msgstr "Domyślnie WordPress pozwala na sortowanie po tytule, dacie, komentarzu i autorze."
464
+
465
+ #: ../codepress-admin-columns.php:3222
466
+ msgid "Make <strong>all columns</strong> of <strong>all types</strong> support sorting &#8212; with the sorting addon."
467
+ msgstr "Włącz sortowanie <strong>wszystkich kolumn, wszystkich typów</strong> &#8212; uaktywniając dodatek."
468
+
469
+ #: ../codepress-admin-columns.php:3230
470
+ msgid "Like this plugin?"
471
+ msgstr "Lubisz tę wtyczkę?"
472
+
473
+ #: ../codepress-admin-columns.php:3233
474
+ msgid "Why not do any or all of the following"
475
+ msgstr "Dlaczego by nie zrobić jednej lub wszystkich z poniższych rzeczy"
476
+
477
+ #: ../codepress-admin-columns.php:3235
478
+ msgid "Link to it so other folks can find out about it."
479
+ msgstr "Dodaj link aby inni mogli się o niej dowiedzieć."
480
+
481
+ #: ../codepress-admin-columns.php:3236
482
+ msgid "Give it a 5 star rating on WordPress.org."
483
+ msgstr "Przyznaj jej 5 gwaizdek na stronie WordPress.org."
484
+
485
+ #: ../codepress-admin-columns.php:3237
486
+ msgid "Donate a token of your appreciation."
487
+ msgstr "Wspomóż drobną dotacją."
488
+
489
+ #: ../codepress-admin-columns.php:3245
490
+ msgid "Need support?"
491
+ msgstr "Potrzebujesz pomocy?"
492
+
493
+ #: ../codepress-admin-columns.php:3249
494
+ #, php-format
495
+ 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."
496
+ 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."
497
+
498
+ #: ../codepress-admin-columns.php:3250
499
+ #, php-format
500
+ msgid "If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>."
501
+ 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>."
502
+
503
+ #: ../codepress-admin-columns.php:3265
504
+ msgid "Admin Columns"
505
+ msgstr "Edytor kolumn"
506
+
507
+ #: ../codepress-admin-columns.php:3283
508
+ msgid "Save Changes"
509
+ msgstr "Zapisz zmiany"
510
+
511
+ #: ../codepress-admin-columns.php:3295
512
+ msgid "Restore defaults"
513
+ msgstr "Przywróć domyślne"
514
+
515
+ #: ../codepress-admin-columns.php:3299
516
+ msgid "Restore default settings"
517
+ msgstr "Przywróć ustawienia domyślne"
518
+
519
+ #: ../codepress-admin-columns.php:3299
520
+ msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
521
+ msgstr "Uwaga! WSZYSTKIE zapisane ustawienia kolumn zostaną usunięte. Tej operacji nie można przywrócić. Kliknij \\'OK\\' aby usunąć lub \\'Anuluj\\' aby przerwać."
522
+
523
+ #: ../codepress-admin-columns.php:3301
524
+ msgid "This will delete all column settings and restore the default settings."
525
+ msgstr "Ta operacja usunie wszystkie ustawienia kolumn u przywróci je do ustawień domyślnych."
526
+
527
+ #: ../classes/sortable.php:961
528
+ msgid "Show all "
529
+ msgstr "Pokaż wszystkie"
530
+
readme.txt CHANGED
@@ -1,17 +1,19 @@
1
  === Codepress Admin Columns ===
2
  Contributors: codepress, tschutter
3
- Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, wp-admin
4
  Requires at least: 3.1
5
- Tested up to: 3.3-RC1
6
- Stable tag: 1.1.3
7
 
8
  == Description ==
9
 
10
- Completely Customise your Custom Columns 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 and users. You can add or remove columns, change their label and reorder them.
13
 
14
- = Custom Columns =
 
 
15
 
16
  The following custom columns are added:
17
 
@@ -25,8 +27,64 @@ The following custom columns are added:
25
  * ID
26
  * Slug
27
  * Sticky
 
 
 
 
 
 
28
  * Custom Fields
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  = Custom Fields =
31
 
32
  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:
@@ -37,27 +95,31 @@ With the custom field column you can display any custom field values. It can sho
37
  * Multiple Values
38
  * Numeric value ( this also works for sorting by meta_value_num )
39
 
40
- = Sortable Custom Columns =
41
 
42
- A nice feature is that it will make some of the new columns support sorting. By default WordPress let's you sort by Title, Date, Comments and Author. This will make you be able to sort by:
43
 
44
- * ID
45
- * page order
46
- * slug
47
- * page template
48
- * custom fields ( both meta_value and meta_value_num are supported )
49
 
50
- = User Columns =
51
 
52
- You can also change the User Columns. We have added a few additional custom columns:
53
 
54
- * User ID
55
- * First name
56
- * Last name
57
- * Url
58
- * Register date
59
 
60
- We will be adding more in coming releases. You can leave any <a href='http://www.codepress.nl/plugins/codepress-admin-columns#feedback'>requests or feedback</a>.
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  **Related Links:**
63
 
@@ -69,22 +131,95 @@ We will be adding more in coming releases. You can leave any <a href='http://www
69
  2. Activate Codepress Admin Columns through the 'Plugins' menu in WordPress
70
  3. Configure the plugin by going to the Admin Column settings that appears under the Settings menu.
71
 
72
-
73
  == Frequently Asked Questions ==
74
 
75
  = I have an idea for a great way to improve this plugin =
76
 
77
  Great! I'd love to hear from you.
78
- Leave your feedback at http://www.codepress.nl/plugins/codepress-admin-columns#feedback.
79
 
80
  == Screenshots ==
81
 
82
- 1. Posts Screen with custom columns.
83
- 2. Settings page of the Codepress Admin columns plugin.
84
- 3. Options for the Custom Field Column.
 
 
 
 
85
 
86
  == Changelog ==
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  = 1.1.3 =
89
 
90
  * added bug fix for WP3.3beta ( thanks to raonip and ronbme for pointing this out )
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.4
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. You will have full control over all columns for pages, posts, posttypes, media, links, comments and users.
13
 
14
+ Add or remove columns, change their label, change their width and reorder them.
15
+
16
+ = Post Types Columns =
17
 
18
  The following custom columns are added:
19
 
27
  * ID
28
  * Slug
29
  * Sticky
30
+ * Word count
31
+ * Roles
32
+ * Status
33
+ * Number of Attachments
34
+ * Last Modified
35
+ * Comment count
36
  * Custom Fields
37
 
38
+ = User Columns =
39
+
40
+ You can also change the User Columns. The following user columns are added:
41
+
42
+ * User ID
43
+ * First name
44
+ * Last name
45
+ * Url
46
+ * Register date
47
+ * Biographical Info ( description )
48
+ * Number of Posts Types
49
+ * User Custom Fields
50
+
51
+ Some of the user custom fields that are included: user level, capabilities, admin color, nickname... many more.
52
+
53
+ = Media Columns =
54
+
55
+ Customise the Media Library Columns. The following media columns are added:
56
+
57
+ * Media ID
58
+ * File name
59
+ * Height
60
+ * Width
61
+ * Dimensions ( width x height )
62
+ * EXIF and IPTC image data
63
+ * Description, Caption and Alternate tekst
64
+ * Mime-Type
65
+ * Media Custom Fields
66
+
67
+ = Comment Columns =
68
+
69
+ A lot more comment colums are added, here are a few examples:
70
+
71
+ * Avatar
72
+ * Author IP
73
+ * Agent
74
+ * ID
75
+ * Comment excerpt
76
+ * Comment Meta data
77
+
78
+ = Link Columns =
79
+
80
+ A few examples of added Link columns:
81
+
82
+ * ID
83
+ * Target
84
+ * Description
85
+ * Notes
86
+ * Owner
87
+
88
  = Custom Fields =
89
 
90
  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:
95
  * Multiple Values
96
  * Numeric value ( this also works for sorting by meta_value_num )
97
 
98
+ = Sortable Custom Columns for all Screens =
99
 
100
+ 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>.
101
 
102
+ 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>.
 
 
 
 
103
 
104
+ = Third party plugin support =
105
 
106
+ 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.
107
 
108
+ = Translations =
 
 
 
 
109
 
110
+ If you like to contrinute a language, please send them to <a href="mailto:info@codepress.nl">info@codepress.nl</a>.
111
+
112
+ * Polish (pl_PL) - Thanks for contributing the polish language goes to Bartosz
113
+
114
+
115
+ = Upcoming releases =
116
+
117
+ The next major release (1.5) will have the option to set default sorting per screen.
118
+
119
+
120
+ **Feedback**
121
+
122
+ You can leave any <a href='http://www.codepress.nl/plugins/codepress-admin-columns/feedback'>requests or feedback</a>.
123
 
124
  **Related Links:**
125
 
131
  2. Activate Codepress Admin Columns through the 'Plugins' menu in WordPress
132
  3. Configure the plugin by going to the Admin Column settings that appears under the Settings menu.
133
 
 
134
  == Frequently Asked Questions ==
135
 
136
  = I have an idea for a great way to improve this plugin =
137
 
138
  Great! I'd love to hear from you.
139
+ Leave your feedback at http://www.codepress.nl/plugins/codepress-admin-columns/feedback.
140
 
141
  == Screenshots ==
142
 
143
+ 1. Settings page for Post(type) columns.
144
+ 2. Posts Screen with the customized sortable columns.
145
+ 3. Settings page for the Media Library columns.
146
+ 4. Media Screen with the customized sortable columns.
147
+ 5. Settings page for Users columns.
148
+ 6. Users Screen with the customized sortable columns.
149
+ 7. Settings page showing the different displaying types for custom field.
150
 
151
  == Changelog ==
152
 
153
+ = 1.4.4 =
154
+ * added posts columns Last Modified and Comment count
155
+ * added media columns for EXIF and IPTC image data
156
+ * added custom fields columns to the Media Library
157
+ * given column values it's own class
158
+ * added bug fix for sorting bookmarks/links
159
+ * added fix for possible php warning
160
+
161
+ = 1.4.3 =
162
+ * removed taxonomy filtering ( this will return in next patch with an option to show/hide )
163
+
164
+ = 1.4.2 =
165
+ * added fix for unexpected output in the column value
166
+ * added fix for better 3rd party plugin support
167
+ * added column for Comment status
168
+ * added column for Ping/Trackback status
169
+ * added column for Posts Actions (delete, view etc.)
170
+ * added column for Users Actions (delete, view etc.)
171
+ * added sorting taxonomies ( only on first one )
172
+ * added bug fix for sorting
173
+ * added taxonomy filtering
174
+
175
+ = 1.4.1 =
176
+ * added polish translation, thanks to Bartosz.
177
+ * changed the license key validation proces
178
+ * removed non-breaking-space-character from column output
179
+
180
+ = 1.4 =
181
+
182
+ * added support for comment columns
183
+ * added support for link columns
184
+ * added links to taxonomies
185
+ * added sorting user custom fields
186
+ * added sorting to links columns
187
+ * added user columns so you can see how many articles an author has published of a certain post type
188
+ * added Textual help
189
+ * added the option to specify column width
190
+ * added role column to all posts screens
191
+ * added posts status column to all posts screens
192
+ * added image path to media library
193
+ * added added apply_filters('cpac-get-post-types', $post_types) to filter out certain post types
194
+ * added option to enter license key for activating sorting on ALL columns
195
+ * fixed a php5 warning
196
+ * fixed a conflict with the Co-Authors plugin
197
+
198
+ = 1.3 =
199
+
200
+ * added support for Media columns
201
+ * added Media columns: filename, width, height, dimensions, description, alt, caption and mime-type
202
+ * added date type to posts custom fields
203
+ * added title type to posts custom fields
204
+ * sorting has changed. when sorting; only results are shown which contain a value
205
+ * str_word_count is used for excerpts
206
+
207
+ = 1.2.1 =
208
+
209
+ * added word count sorting
210
+ * added attachment count sorting
211
+ * added template name sorting
212
+ * minor styling changes
213
+ * bug fix with sorting by slug
214
+ * bug fix with sorting by attachment
215
+
216
+ = 1.2 =
217
+
218
+ * added support for third party plugins
219
+ * added user custom fields
220
+ * added extra image check
221
+ * bug fix with javascript (jquery) enqueue
222
+
223
  = 1.1.3 =
224
 
225
  * added bug fix for WP3.3beta ( thanks to raonip and ronbme for pointing this out )
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