Admin Columns - Version 1.4.3

Version Description

  • removed taxonomy filtering ( this will return in next patch with an option to show/hide )
Download this release

Release Info

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

Code changes from version 1.0 to 1.4.3

Files changed (42) hide show
  1. assets/css/admin-column.css +332 -18
  2. assets/css/column.css +11 -0
  3. assets/images/addon_sortable_1.png +0 -0
  4. assets/images/arrows.png +0 -0
  5. assets/images/cross.png +0 -0
  6. assets/images/information.png +0 -0
  7. assets/images/loading.gif +0 -0
  8. assets/images/no.png +0 -0
  9. assets/images/reorder_arrow.png +0 -0
  10. assets/images/settings.png +0 -0
  11. assets/images/sort.png +0 -0
  12. assets/images/square.png +0 -0
  13. assets/js/admin-column.js +238 -6
  14. assets/js/jquery.qtip.js +19 -0
  15. assets/ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  16. assets/ui-theme/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  17. assets/ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  18. assets/ui-theme/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  19. assets/ui-theme/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  20. assets/ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  21. assets/ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  22. assets/ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  23. assets/ui-theme/images/ui-icons_222222_256x240.png +0 -0
  24. assets/ui-theme/images/ui-icons_2e83ff_256x240.png +0 -0
  25. assets/ui-theme/images/ui-icons_454545_256x240.png +0 -0
  26. assets/ui-theme/images/ui-icons_888888_256x240.png +0 -0
  27. assets/ui-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  28. assets/ui-theme/jquery-ui-1.8.18.custom.css +120 -0
  29. classes/sortable.php +1027 -0
  30. codepress-admin-columns.php +2660 -701
  31. languages/codepress-admin-columns-nl_NL.mo +0 -0
  32. languages/codepress-admin-columns-nl_NL.po +338 -188
  33. languages/codepress-admin-columns-pl_PL.mo +0 -0
  34. languages/codepress-admin-columns-pl_PL.po +648 -0
  35. readme.txt +176 -25
  36. screenshot-1.png +0 -0
  37. screenshot-2.png +0 -0
  38. screenshot-3.png +0 -0
  39. screenshot-4.png +0 -0
  40. screenshot-5.png +0 -0
  41. screenshot-6.png +0 -0
  42. 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;
@@ -109,7 +154,8 @@
109
  display: block;
110
  margin-right: 30px;
111
  overflow: hidden;
112
- height: 15px;
 
113
  }
114
  #general-cpac-settings .cpac-option-list li .cpac-type-options input {
115
  margin-top: 6px;
@@ -130,6 +176,11 @@
130
  text-indent: -999em;
131
  overflow: hidden;
132
  }
 
 
 
 
 
133
  #general-cpac-settings .cpac-option-list li div.cpac-meta-title span {
134
  display: inline-block;
135
  margin: 5px 5px 0 0;
@@ -165,6 +216,31 @@
165
  #general-cpac-settings .cpac-option-list li .cpac-type-inside select {
166
  min-width: 184px;
167
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  #general-cpac-settings .cpac-add-column a {
169
  display: block;
170
  }
@@ -187,6 +263,123 @@
187
  color: #832525;
188
  text-shadow: none;
189
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  #restore-cpac-settings .inside {
191
  padding: 10px;
192
  }
@@ -206,4 +399,125 @@
206
  }
207
  #restore-cpac-settings .inside .description {
208
  color: #832525;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  }
1
+ #cpac {
2
+ /* overflow: hidden; */
3
+ }
4
  #cpac .postbox {
5
  margin: 0 10px 10px 0;
6
  }
7
  #cpac .cpac-menu {
8
  clear: both;
9
+ overflow: hidden;
10
+ margin-right: 276px;
11
+ }
12
+ #cpac .cpac-menu .subsubsub {
13
+ white-space: normal;
14
+ margin-right: 14px;
15
+ }
16
+ #cpac .cpac-settings-link {
17
+ float: right;
18
+ float: right;
19
+ margin: 12px 14px 5px 0;
20
+ background: transparent url('../images/settings.png') no-repeat 0 0;
21
+ padding-left: 20px;
22
+ text-decoration: none;
23
+ display: inline-block;
24
+ line-height: 16px;
25
+ }
26
+ #cpac .cpac-settings-link.current {
27
+ font-weight: bold;
28
+ }
29
+ #cpac .cpac-col-left {
30
+ /* width: 70%; */
31
+ clear: left;
32
+ float: left;
33
+ margin-right: -2000px;
34
+ width: 100%;
35
+ }
36
+ #cpac .cpac-col-left .metabox-holder {
37
+ margin-right: 276px;
38
+ }
39
+ #cpac .cpac-col-right {
40
+ /* width: 20%; */
41
+ margin-right: auto;
42
+ width: 266px;
43
+ float: right;
44
+ position: relative;
45
+ clear: right;
46
+ }
47
+ #cpac .cpac-col-right .inside {
48
+ padding: 0 10px;
49
  }
50
  #icon-codepress-admin-columns {
51
  background: transparent url('../images/icon.png') no-repeat 0 0;
52
  }
53
+
54
+ /* =General settings
55
+ -------------------------------------------------------------- */
56
  #general-cpac-settings > .inside {
57
  padding: 0;
58
  margin: 0;
77
  #general-cpac-settings table.form-table tr.bottom td {
78
  border-bottom: none;
79
  }
80
+ #general-cpac-settings a.go-to-screen {
81
+ display: block;
82
+ padding: 5px 0;
83
+ font-weight: normal;
84
+ text-decoration: none;
85
+ }
86
  #general-cpac-settings .cpac-box {
87
  position: relative;
88
  }
89
  #general-cpac-settings .cpac-option-list {
90
  overflow: hidden;
91
+ width: 360px;
92
+ margin-bottom: 5px;
93
  }
94
  #general-cpac-settings .cpac-reorder-msg {
95
+ background: transparent url('../images/reorder_arrow.png') no-repeat scroll 0 0;
96
  margin-left: 5px;
97
  height: 23px;
98
+ line-height: 25px;
99
+ padding-left: 25px;
100
+ color: #727272;
101
+ font-size: 12px;
102
+ font-family: 'Trebuchet MS', Arial, Verdana;
103
+ font-style: italic;
104
  clear: both;
105
  }
106
  #general-cpac-settings .cpac-option-list li {
118
  background-image: -webkit-linear-gradient(top, #f9f9f9, #ececec);
119
  background-image: linear-gradient(top, #f9f9f9, #ececec);
120
  border-radius: 3px 3px 3px 3px;
121
+ border: 1px solid #cbcbcb;
122
  margin-top: 1px;
123
  }
 
 
 
 
 
 
 
 
 
 
124
  #general-cpac-settings .cpac-option-list li .cpac-sort-handle {
125
  background: transparent url('../images/sort.png') no-repeat 5px 5px;
126
  width: 20px;
154
  display: block;
155
  margin-right: 30px;
156
  overflow: hidden;
157
+ height: 17px;
158
+ line-height: 17px;
159
  }
160
  #general-cpac-settings .cpac-option-list li .cpac-type-options input {
161
  margin-top: 6px;
176
  text-indent: -999em;
177
  overflow: hidden;
178
  }
179
+ #general-cpac-settings .cpac-option-list li.opened a.cpac-action {}
180
+ #general-cpac-settings .cpac-option-list li.active a.cpac-action {
181
+ background-position: 50% -66px;
182
+ }
183
+ #general-cpac-settings .cpac-option-list li.active.opened a.cpac-action {}
184
  #general-cpac-settings .cpac-option-list li div.cpac-meta-title span {
185
  display: inline-block;
186
  margin: 5px 5px 0 0;
216
  #general-cpac-settings .cpac-option-list li .cpac-type-inside select {
217
  min-width: 184px;
218
  }
219
+ #general-cpac-settings .cpac-option-list li .cpac-type-inside input.input-width {
220
+ min-width: 25px;
221
+ width: 25px;
222
+ border: none;
223
+ background: transparent;
224
+ padding: 0;
225
+ margin-left: 0px;
226
+ text-align: right;
227
+ }
228
+ #general-cpac-settings .cpac-option-list li .cpac-type-inside div.input-width-range {
229
+ display: inline-block;
230
+ min-width: 136px;
231
+ width: 136px;
232
+ margin: 8px 0 0;
233
+ position: relative;
234
+ }
235
+ #general-cpac-settings .cpac-option-list li .cpac-type-inside div.input-width-range .ui-slider-handle {
236
+ cursor:e-resize;
237
+ }
238
+ #general-cpac-settings .cpac-option-list li .cpac-type-inside div.description {
239
+ display: inline-block;
240
+ font-size: 11px;
241
+ padding: 0 4px 0 0;
242
+ width: 36px;
243
+ }
244
  #general-cpac-settings .cpac-add-column a {
245
  display: block;
246
  }
263
  color: #832525;
264
  text-shadow: none;
265
  }
266
+ #general-cpac-settings .cpac-option-list li.active {
267
+ background-color: #c7c7c7;
268
+ background-image: -ms-linear-gradient(top, #e9e9e9, #c7c7c7);
269
+ background-image: -moz-linear-gradient(top, #e9e9e9, #c7c7c7);
270
+ background-image: -o-linear-gradient(top, #e9e9e9, #c7c7c7);
271
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#e9e9e9), to(#c7c7c7));
272
+ background-image: -webkit-linear-gradient(top, #e9e9e9, #c7c7c7);
273
+ background-image: linear-gradient(top, #e9e9e9, #c7c7c7);
274
+ border-color: #aeaeae;
275
+ }
276
+ #general-cpac-settings .cpac-option-list li.active .cpac-sort-handle {
277
+ background-position: 5px -19px;
278
+ }
279
+ #general-cpac-settings .cpac-option-list li.active div.cpac-meta-title {
280
+ color: #151515;
281
+ }
282
+ #general-cpac-settings .cpac-option-list li.active div.cpac-meta-title span {
283
+ color: #5c5c5c
284
+ }
285
+
286
+ /* =Plugin settings (Options)
287
+ -------------------------------------------------------------- */
288
+ #cpac-box-plugin_settings {}
289
+ #cpac-box-plugin_settings > td {
290
+ border: none;
291
+ padding: 0;
292
+ margin: 0;
293
+ }
294
+ #cpac-box-plugin_settings table.nopadding {
295
+ border-collapse: separate;
296
+ border-spacing: 0;
297
+ border: none;
298
+ width: 100%;
299
+ }
300
+ #cpac-box-plugin_settings table.nopadding tr.last > td {
301
+ border-bottom: none;
302
+ border-top: none;
303
+ }
304
+ #cpac-box-plugin_settings table.addons {
305
+ /* max-width: 620px; */
306
+ }
307
+ #cpac-box-plugin_settings table.addons th.activation_type {
308
+ width: 110px;
309
+ }
310
+ #cpac-box-plugin_settings table.addons th.activation_status {
311
+ width: 90px;
312
+ }
313
+ #cpac-box-plugin_settings table.addons th.activation_code {
314
+ /* width: auto; */
315
+ min-width: 260px;
316
+ }
317
+ #cpac-box-plugin_settings table.addons th.activation_more {
318
+ /* min-width: 120px; */
319
+ text-align: left;
320
+ width: auto;
321
+ }
322
+ #cpac-box-plugin_settings table.addons td.activation_type span {
323
+ font-size: 14px;
324
+ display: inline-block;
325
+ background: transparent url('../images/information.png') no-repeat right 50%;
326
+ padding-right: 20px;
327
+ }
328
+ #cpac-box-plugin_settings table.addons td {
329
+ background: #ffffff;
330
+ /* vertical-align: middle; */
331
+ padding: 18px 10px;
332
+ }
333
+ #cpac-box-plugin_settings table.addons td.activation_code input {
334
+ width: 176px;
335
+ color: #555555;
336
+ font-family: Arial;
337
+ font-size: 12px;
338
+ }
339
+ #cpac-box-plugin_settings table.addons td.activation_more {
340
+ text-align: left;
341
+ }
342
+ #cpac-box-plugin_settings table.addons td.activation_more a{
343
+ float: none;
344
+ display: inline-block;
345
+ margin-top: 1px;
346
+ }
347
+ #cpac-box-plugin_settings table.addons tr.last td {
348
+ border-bottom: none;
349
+ }
350
+ #cpac-box-plugin_settings table.addons .masked_key {
351
+ padding: 0;
352
+ }
353
+ #cpac-box-plugin_settings .cpac-options {}
354
+ #cpac-box-plugin_settings .cpac-options li {
355
+ overflow: hidden;
356
+ }
357
+ #cpac-box-plugin_settings .cpac-option-label {
358
+ float: left;
359
+ width: 140px;
360
+ }
361
+ #cpac-box-plugin_settings .cpac-option-inputs {
362
+ float: left;
363
+ width: 220px;
364
+ }
365
+ #cpac-box-plugin_settings table.addons .button {
366
+ position: relative;
367
+ }
368
+ #cpac-box-plugin_settings table.addons .button.loading {
369
+ padding-right: 25px;
370
+ }
371
+ #cpac-box-plugin_settings table.addons .button.loading span {
372
+ position: absolute;
373
+ top: 2px;
374
+ right: 6px;
375
+ background: transparent url('../images/loading.gif') no-repeat right 50%;
376
+ width: 16px;
377
+ height: 16px;
378
+ display: inline-block;
379
+ }
380
+
381
+ /* =Restore settings
382
+ -------------------------------------------------------------- */
383
  #restore-cpac-settings .inside {
384
  padding: 10px;
385
  }
399
  }
400
  #restore-cpac-settings .inside .description {
401
  color: #832525;
402
+ }
403
+
404
+ /* =Addons settings
405
+ -------------------------------------------------------------- */
406
+ #addons-cpac-settings {
407
+ overflow: hidden;
408
+ }
409
+ #addons-cpac-settings h2 {
410
+ font-size: 14px;
411
+ line-height: 14px;
412
+ margin-bottom: 0;
413
+ padding-bottom: 0;
414
+ }
415
+ #addons-cpac-settings a {
416
+ padding: 0 10px 10px;
417
+ text-decoration: none;
418
+ color: green;
419
+ text-decoration: underline;
420
+ }
421
+ #addons-cpac-settings a:hover {
422
+ color: darkgreen;
423
+ }
424
+
425
+
426
+ /* =Like this plugin settings
427
+ -------------------------------------------------------------- */
428
+ #likethisplugin-cpac-settings {
429
+ padding: 0;
430
+ }
431
+ #likethisplugin-cpac-settings ul {
432
+ margin-left: 20px;
433
+ }
434
+ #likethisplugin-cpac-settings li {
435
+ list-style: square;
436
+ line-height: 16px;
437
+ }
438
+ #likethisplugin-cpac-settings li a {
439
+ text-decoration: none;
440
+ }
441
+ #likethisplugin-cpac-settings li.donate_link a {
442
+ /* color: green;
443
+ text-decoration: underline; */
444
+ }
445
+ #likethisplugin-cpac-settings li.donate_link a:hover {
446
+ color: darkgreen;
447
+ }
448
+
449
+ /* =Activation
450
+ -------------------------------------------------------------- */
451
+ #cpac-box-plugin_settings .addons .activation_code .activate,
452
+ #cpac-box-plugin_settings .addons .activation_code .deactivate {
453
+ min-height: 25px;
454
+ }
455
+ #cpac-box-plugin_settings .activation_status .activate {
456
+ color: #CC0000;
457
+ }
458
+ #cpac-box-plugin_settings .activation_status .deactivate {
459
+ color: darkgreen;
460
+ }
461
+ #cpac-box-plugin_settings .activation-error-msg {
462
+ color: #CC0000;
463
+ line-height: 20px;
464
+ padding: 0 6px;
465
+ }
466
+
467
+ /* =Tooltip
468
+ -------------------------------------------------------------- */
469
+ .qtip .qtip-tip {
470
+ left: 74px !important;
471
+ top: 1px !important;
472
+ }
473
+ .qtip .qtip-wrapper {
474
+ background: #fff;
475
+ border-style: solid;
476
+ border-width: 1px;
477
+ border-color: #dfdfdf;
478
+ border-color: rgba(0,0,0,.125);
479
+ border-top: none;
480
+ -webkit-border-radius: 3px;
481
+ border-radius: 3px;
482
+ border-radius: 5px;
483
+ -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.19);
484
+ -moz-box-shadow: 0 2px 4px rgba(0,0,0,.19);
485
+ box-shadow: 0 2px 4px rgba(0,0,0,.19);
486
+
487
+ }
488
+ .qtip .qtip-wrapper .qtip_title {
489
+ padding: 15px 18px 14px 15px;
490
+ clear: both;
491
+ line-height: 1.4em;
492
+ font-size: 14px;
493
+ color: #fff;
494
+ border-radius: 3px 3px 0 0;
495
+ text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
496
+ background-color: #8cc1e9;
497
+ background-image: -webkit-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
498
+ background-image: -moz-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
499
+ background-image: -ms-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
500
+ background-image: -o-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
501
+ background-image: linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
502
+ }
503
+ .qtip .qtip-wrapper .qtip_content {
504
+ padding: 0 14px 14px;
505
+ margin: 0;
506
+ overflow: hidden;
507
+ clear: both;
508
+ min-height: 40px;
509
+ font-size: 13px;
510
+ background: #fff;
511
+ }
512
+ .qtip .qtip-wrapper .qtip_content .button-primary {
513
+ margin: 6px 0 0;
514
+ }
515
+
516
+ /* =Responsive Design
517
+ -------------------------------------------------------------- */
518
+ body.folded #cpac .cpac-col-left .metabox-holder {
519
+ margin-right: 0;
520
+ }
521
+ body.folded #cpac .cpac-col-right {
522
+ display: none;
523
  }
assets/css/column.css CHANGED
@@ -1,4 +1,15 @@
 
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
  }
assets/images/addon_sortable_1.png ADDED
Binary file
assets/images/arrows.png CHANGED
Binary file
assets/images/cross.png ADDED
Binary file
assets/images/information.png ADDED
Binary file
assets/images/loading.gif ADDED
Binary file
assets/images/no.png ADDED
Binary file
assets/images/reorder_arrow.png ADDED
Binary file
assets/images/settings.png ADDED
Binary file
assets/images/sort.png CHANGED
Binary file
assets/images/square.png ADDED
Binary file
assets/js/admin-column.js CHANGED
@@ -2,12 +2,20 @@
2
  * fires when the dom is ready
3
  *
4
  */
5
- jQuery(document).ready(function(){
 
 
 
 
6
  cpac_sortable();
7
  cpac_checked();
8
  cpac_box_events();
9
  cpac_menu();
10
  cpac_add_custom_column();
 
 
 
 
11
  });
12
 
13
  /**
@@ -15,7 +23,7 @@ jQuery(document).ready(function(){
15
  *
16
  */
17
  function cpac_sortable()
18
- {
19
  jQuery('ul.cpac-option-list').sortable({
20
  handle: 'div.cpac-sort-handle',
21
  placeholder: 'cpac-placeholder',
@@ -38,7 +46,7 @@ function cpac_checked()
38
  // toggle on
39
  if ( value != 'on') {
40
  li.addClass('active');
41
- state.attr('value', 'on');
42
  }
43
 
44
  // toggle off
@@ -59,7 +67,10 @@ function cpac_box_events()
59
  // fold in/out
60
  jQuery('#cpac .cpac-option-list .cpac-action').unbind('click').click(function(e){
61
  e.preventDefault();
62
- jQuery(this).closest('li').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,1027 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Coderess Sortable Columns Class
5
+ *
6
+ * @since 1.3
7
+ *
8
+ */
9
+ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
10
+ {
11
+ private $post_types,
12
+ $unlocked,
13
+ $show_all_results;
14
+
15
+ /**
16
+ * Constructor
17
+ *
18
+ * @since 1.0
19
+ */
20
+ function __construct()
21
+ {
22
+ add_action( 'wp_loaded', array( $this, 'init') );
23
+ }
24
+
25
+ /**
26
+ * Initialize
27
+ *
28
+ * @since 1.0
29
+ */
30
+ public function init()
31
+ {
32
+ // vars
33
+ $this->unlocked = $this->is_unlocked('sortable');
34
+ $this->post_types = $this->get_post_types();
35
+ $this->show_all_results = false;
36
+ $this->textdomain = 'codepress-admin-columns';
37
+
38
+ // init sorting
39
+ add_action( 'admin_init', array( $this, 'register_sortable_columns' ) );
40
+
41
+ // init filtering
42
+ // add_action( 'admin_init', array( $this, 'register_filtering_columns' ) );
43
+
44
+ // handle requests for sorting columns
45
+ add_filter( 'request', array( $this, 'handle_requests_orderby_column'), 1 );
46
+ add_action( 'pre_user_query', array( $this, 'handle_requests_orderby_users_column'), 1 );
47
+ add_action( 'admin_init', array( $this, 'handle_requests_orderby_links_column'), 1 );
48
+ add_action( 'admin_init', array( $this, 'handle_requests_orderby_comments_column'), 1 );
49
+ }
50
+
51
+ /**
52
+ * Register sortable columns
53
+ *
54
+ * Hooks into apply_filters( "manage_{$screen->id}_sortable_columns" ) which is found in class-wp-list-table.php
55
+ *
56
+ * @since 1.0
57
+ */
58
+ function register_sortable_columns()
59
+ {
60
+ if ( ! $this->unlocked )
61
+ return false;
62
+
63
+ /** Posts */
64
+ foreach ( $this->post_types as $post_type )
65
+ add_filter( "manage_edit-{$post_type}_sortable_columns", array($this, 'callback_add_sortable_posts_column'));
66
+
67
+ /** Users */
68
+ add_filter( "manage_users_sortable_columns", array($this, 'callback_add_sortable_users_column'));
69
+
70
+ /** Media */
71
+ add_filter( "manage_upload_sortable_columns", array($this, 'callback_add_sortable_media_column'));
72
+
73
+ /** Links */
74
+ add_filter( "manage_link-manager_sortable_columns", array($this, 'callback_add_sortable_links_column'));
75
+
76
+ /** Comments */
77
+ add_filter( "manage_edit-comments_sortable_columns", array($this, 'callback_add_sortable_comments_column'));
78
+ }
79
+
80
+ /**
81
+ * Callback add Posts sortable column
82
+ *
83
+ * @since 1.0
84
+ */
85
+ public function callback_add_sortable_posts_column($columns)
86
+ {
87
+ global $post_type;
88
+
89
+ return $this->add_managed_sortable_columns($post_type, $columns);
90
+ }
91
+
92
+ /**
93
+ * Callback add Users sortable column
94
+ *
95
+ * @since 1.1
96
+ */
97
+ public function callback_add_sortable_users_column($columns)
98
+ {
99
+ return $this->add_managed_sortable_columns('wp-users', $columns);
100
+ }
101
+
102
+ /**
103
+ * Callback add Media sortable column
104
+ *
105
+ * @since 1.3
106
+ */
107
+ public function callback_add_sortable_media_column($columns)
108
+ {
109
+ return $this->add_managed_sortable_columns('wp-media', $columns);
110
+ }
111
+
112
+ /**
113
+ * Callback add Links sortable column
114
+ *
115
+ * @since 1.3.1
116
+ */
117
+ public function callback_add_sortable_links_column($columns)
118
+ {
119
+ return $this->add_managed_sortable_columns('wp-links', $columns);
120
+ }
121
+
122
+ /**
123
+ * Callback add Comments sortable column
124
+ *
125
+ * @since 1.3.1
126
+ */
127
+ public function callback_add_sortable_comments_column($columns)
128
+ {
129
+ return $this->add_managed_sortable_columns('wp-comments', $columns);
130
+ }
131
+
132
+ /**
133
+ * Add managed sortable columns by Type
134
+ *
135
+ * @since 1.1
136
+ */
137
+ private function add_managed_sortable_columns( $type = 'post', $columns )
138
+ {
139
+ $display_columns = $this->get_merged_columns($type);
140
+
141
+ if ( ! $display_columns )
142
+ return $columns;
143
+
144
+ foreach ( $display_columns as $id => $vars ) {
145
+ if ( isset($vars['options']['sortorder']) && $vars['options']['sortorder'] == 'on' ){
146
+
147
+ // register format
148
+ $columns[$id] = $this->sanitize_string($vars['label']);
149
+ }
150
+ }
151
+
152
+ return $columns;
153
+ }
154
+
155
+ /**
156
+ * Admin requests for orderby column
157
+ *
158
+ * Only works for WP_Query objects ( such as posts and media )
159
+ *
160
+ * @since 1.0
161
+ */
162
+ public function handle_requests_orderby_column( $vars )
163
+ {
164
+ if ( ! isset( $vars['orderby'] ) )
165
+ return $vars;
166
+
167
+ /** Users */
168
+ // You would expect to see get_orderby_users_vars(), but sorting for
169
+ // users is handled through a different filter. Not 'request', but 'pre_user_query'.
170
+ // See handle_requests_orderby_users_column().
171
+
172
+ /** Media */
173
+ elseif ( $this->request_uri_is('upload') )
174
+ $vars = $this->get_orderby_media_vars($vars);
175
+
176
+ /** Posts */
177
+ elseif ( !empty($vars['post_type']) )
178
+ $vars = $this->get_orderby_posts_vars($vars);
179
+
180
+ return $vars;
181
+ }
182
+
183
+ /**
184
+ * Orderby Users column
185
+ *
186
+ * @since 1.3
187
+ */
188
+ public function handle_requests_orderby_users_column($user_query)
189
+ {
190
+ // query vars
191
+ $vars = $user_query->query_vars;
192
+
193
+ // Column
194
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-users' );
195
+
196
+ if ( empty($column) )
197
+ return $vars;
198
+
199
+ // id
200
+ $id = key($column);
201
+
202
+ // type
203
+ $type = $id;
204
+
205
+ // Check for user custom fields: column-meta-[customfieldname]
206
+ if ( $this->is_column_meta($type) )
207
+ $type = 'column-user-meta';
208
+
209
+ // Check for post count: column-user_postcount-[posttype]
210
+ if ( $this->get_posttype_by_postcount_column($type) )
211
+ $type = 'column-user_postcount';
212
+
213
+ // var
214
+ $cusers = array();
215
+ switch( $type ) :
216
+
217
+ case 'column-user_id':
218
+ $user_query->query_vars['orderby'] = 'ID';
219
+ break;
220
+
221
+ case 'column-user_registered':
222
+ $user_query->query_vars['orderby'] = 'registered';
223
+ break;
224
+
225
+ case 'column-nickname':
226
+ $user_query->query_vars['orderby'] = 'nickname';
227
+ break;
228
+
229
+ case 'column-first_name':
230
+ foreach ( $this->get_users_data() as $u )
231
+ if ($u->first_name || $this->show_all_results )
232
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->first_name);
233
+ $this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
234
+ break;
235
+
236
+ case 'column-last_name':
237
+ foreach ( $this->get_users_data() as $u )
238
+ if ($u->last_name || $this->show_all_results )
239
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->last_name);
240
+ $this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
241
+ break;
242
+
243
+ case 'column-user_url':
244
+ foreach ( $this->get_users_data() as $u )
245
+ if ($u->user_url || $this->show_all_results )
246
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->user_url);
247
+ $this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
248
+ break;
249
+
250
+ case 'column-user_description':
251
+ foreach ( $this->get_users_data() as $u )
252
+ if ($u->user_description || $this->show_all_results )
253
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->user_description);
254
+ $this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
255
+ break;
256
+
257
+ case 'column-user_postcount' :
258
+ $post_type = $this->get_posttype_by_postcount_column($id);
259
+ if ( $post_type ) {
260
+ foreach ( $this->get_users_data() as $u ) {
261
+ $count = $this->get_post_count( $post_type, $u->ID );
262
+ $cusers[$u->ID] = $this->prepare_sort_string_value($count);
263
+ }
264
+ $this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
265
+ }
266
+ break;
267
+
268
+ case 'role' :
269
+ foreach ( $this->get_users_data() as $u ) {
270
+ $role = !empty($u->roles[0]) ? $u->roles[0] : '';
271
+ if ($role || $this->show_all_results ) {
272
+ $cusers[$u->ID] = $this->prepare_sort_string_value($role);
273
+ }
274
+ }
275
+ $this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
276
+ break;
277
+
278
+ case 'column-user-meta' :
279
+ $field = $column[$id]['field'];
280
+ if ( $field ) {
281
+
282
+ // order numeric or string
283
+ $order = SORT_REGULAR;
284
+ if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' )
285
+ $order = SORT_NUMERIC;
286
+
287
+ // sort by metavalue
288
+ foreach ( $this->get_users_data() as $u ) {
289
+ $value = get_metadata('user', $u->ID, $field, true);
290
+ $cusers[$u->ID] = $this->prepare_sort_string_value($value);
291
+ }
292
+ $this->set_users_query_vars( &$user_query, $cusers, $order );
293
+ }
294
+ break;
295
+
296
+ endswitch;
297
+
298
+ return $user_query;
299
+ }
300
+
301
+ /**
302
+ * Orderby Links column
303
+ *
304
+ * Makes use of filter 'get_bookmarks' from bookmark.php to change the result set of the links
305
+ *
306
+ * @since 1.3.1
307
+ */
308
+ public function handle_requests_orderby_links_column()
309
+ {
310
+ // fire only when we are in the admins link-manager
311
+ if ( $this->request_uri_is('link-manager') )
312
+ add_filter( 'get_bookmarks', array( $this, 'callback_requests_orderby_links_column'), 10, 2);
313
+ }
314
+
315
+ /**
316
+ * Orderby Links column
317
+ *
318
+ * @since 1.3.1
319
+ */
320
+ public function callback_requests_orderby_links_column($results, $vars)
321
+ {
322
+ global $wpdb;
323
+
324
+ // Column
325
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-links' );
326
+
327
+ if ( empty($column) )
328
+ return $results;
329
+
330
+ // id
331
+ $type = $id = key($column);
332
+
333
+ // var
334
+ $length = '';
335
+ switch( $type ) :
336
+
337
+ case 'column-link_id':
338
+ if ( version_compare( get_bloginfo('version'), '3.2', '>' ) )
339
+ $vars['orderby'] = 'link_id';
340
+ else
341
+ $vars['orderby'] = 'id';
342
+ break;
343
+
344
+ case 'column-owner':
345
+ $vars['orderby'] = 'link_owner';
346
+ break;
347
+
348
+ case 'column-length':
349
+ $vars['orderby'] = 'length';
350
+ $length = ", CHAR_LENGTH(link_name) AS length";
351
+ break;
352
+
353
+ case 'column-target':
354
+ $vars['orderby'] = 'link_target';
355
+ break;
356
+
357
+ case 'column-description':
358
+ $vars['orderby'] = 'link_description';
359
+ break;
360
+
361
+ case 'column-notes':
362
+ $vars['orderby'] = 'link_notes';
363
+ break;
364
+
365
+ case 'column-rss':
366
+ $vars['orderby'] = 'link_rss';
367
+ break;
368
+
369
+ /** native WP columns */
370
+
371
+ // Relationship
372
+ case 'rel':
373
+ $vars['orderby'] = 'link_rel';
374
+ break;
375
+
376
+ default:
377
+ $vars['orderby'] = '';
378
+
379
+ endswitch;
380
+
381
+ // get bookmarks by orderby vars
382
+ if ( $vars['orderby'] ) {
383
+ $vars['order'] = mysql_escape_string($vars['order']);
384
+ $sql = "SELECT * {$length} FROM {$wpdb->links} WHERE 1=1 ORDER BY{$vars['orderby']} {$vars['order']}";
385
+ $results = $wpdb->get_results($sql);
386
+
387
+ // check for errors
388
+ if( is_wp_error($results) )
389
+ return false;
390
+ }
391
+
392
+ return $results;
393
+ }
394
+
395
+ /**
396
+ * Orderby Comments column
397
+ *
398
+ * @since 1.3.1
399
+ */
400
+ public function callback_requests_orderby_comments_column($pieces, $ref_comment)
401
+ {
402
+ // get query vars
403
+ $vars = $ref_comment->query_vars;
404
+
405
+ // Column
406
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-comments' );
407
+
408
+ if ( empty($column) )
409
+ return $pieces;
410
+
411
+ // id
412
+ $type = $id = key($column);
413
+
414
+ // var
415
+ switch( $type ) :
416
+
417
+ case 'column-comment_id':
418
+ $pieces['orderby'] = 'comment_ID';
419
+ break;
420
+
421
+ case 'column-author_author':
422
+ $pieces['orderby'] = 'comment_author';
423
+ break;
424
+
425
+ case 'column-author_ip':
426
+ $pieces['orderby'] = 'comment_author_IP';
427
+ break;
428
+
429
+ case 'column-author_url':
430
+ $pieces['orderby'] = 'comment_author_url';
431
+ break;
432
+
433
+ case 'column-author_email':
434
+ $pieces['orderby'] = 'comment_author_email';
435
+ break;
436
+
437
+ case 'column-reply_to':
438
+ break;
439
+
440
+ case 'column-approved':
441
+ $pieces['orderby'] = 'comment_approved';
442
+ break;
443
+
444
+ case 'column-date':
445
+ $pieces['orderby'] = 'comment_date';
446
+ break;
447
+
448
+ case 'column-agent':
449
+ $pieces['orderby'] = 'comment_agent';
450
+ break;
451
+
452
+ case 'column-excerpt':
453
+ $pieces['orderby'] = 'comment_content';
454
+ break;
455
+
456
+ case 'column-date_gmt':
457
+ // is default
458
+ break;
459
+
460
+ /** native WP columns */
461
+
462
+ // Relationship
463
+ case 'comment':
464
+ $pieces['orderby'] = 'comment_content';
465
+ break;
466
+
467
+ default:
468
+ $vars['orderby'] = '';
469
+
470
+ endswitch;
471
+
472
+ return $pieces;
473
+ }
474
+
475
+ /**
476
+ * Orderby Comments column
477
+ *
478
+ * @since 1.3.1
479
+ */
480
+ public function handle_requests_orderby_comments_column()
481
+ {
482
+ // fire only when we are in the admins edit-comments
483
+ if ( $this->request_uri_is('edit-comments') )
484
+ add_filter('comments_clauses', array( $this, 'callback_requests_orderby_comments_column'), 10, 2);
485
+ }
486
+
487
+ /**
488
+ * Set sorting vars in User Query Object
489
+ *
490
+ * @since 1.3
491
+ */
492
+ private function set_users_query_vars(&$user_query, $sortusers, $sort_flags = SORT_REGULAR )
493
+ {
494
+ global $wpdb;
495
+
496
+ // vars
497
+ $vars = $user_query->query_vars;
498
+
499
+ // sorting
500
+ if ( $vars['order'] == 'ASC' )
501
+ asort($sortusers, $sort_flags);
502
+ else
503
+ arsort($sortusers, $sort_flags);
504
+
505
+ // alter orderby SQL
506
+ if ( ! empty ( $sortusers ) ) {
507
+ $ids = implode(',', array_keys($sortusers));
508
+ $user_query->query_where .= " AND {$wpdb->prefix}users.ID IN ({$ids})";
509
+ $user_query->query_orderby = "ORDER BY FIELD ({$wpdb->prefix}users.ID,{$ids})";
510
+ }
511
+
512
+ // cleanup the vars we dont need
513
+ $vars['order'] = '';
514
+ $vars['orderby'] = '';
515
+
516
+ $user_query->query_vars = $vars;
517
+ }
518
+
519
+ /**
520
+ * Orderby Media column
521
+ *
522
+ * @since 1.3
523
+ */
524
+ private function get_orderby_media_vars($vars)
525
+ {
526
+ // Column
527
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-media' );
528
+
529
+ if ( empty($column) )
530
+ return $vars;
531
+
532
+ // var
533
+ $cposts = array();
534
+ switch( key($column) ) :
535
+
536
+ case 'column-mediaid' :
537
+ $vars['orderby'] = 'ID';
538
+ break;
539
+
540
+ case 'column-width' :
541
+ foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
542
+ $meta = wp_get_attachment_metadata($p->ID);
543
+ $width = !empty($meta['width']) ? $meta['width'] : 0;
544
+ if ( $width || $this->show_all_results )
545
+ $cposts[$p->ID] = $width;
546
+ }
547
+ $this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
548
+ break;
549
+
550
+ case 'column-height' :
551
+ foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
552
+ $meta = wp_get_attachment_metadata($p->ID);
553
+ $height = !empty($meta['height']) ? $meta['height'] : 0;
554
+ if ( $height || $this->show_all_results )
555
+ $cposts[$p->ID] = $height;
556
+ }
557
+ $this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
558
+ break;
559
+
560
+ case 'column-dimensions' :
561
+ foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
562
+ $meta = wp_get_attachment_metadata($p->ID);
563
+ $height = !empty($meta['height']) ? $meta['height'] : 0;
564
+ $width = !empty($meta['width']) ? $meta['width'] : 0;
565
+ $surface = $height*$width;
566
+
567
+ if ( $surface || $this->show_all_results )
568
+ $cposts[$p->ID] = $surface;
569
+ }
570
+ $this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
571
+ break;
572
+
573
+ case 'column-caption' :
574
+ foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p )
575
+ if ( $p->post_excerpt || $this->show_all_results )
576
+ $cposts[$p->ID] = $this->prepare_sort_string_value($p->post_excerpt);
577
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
578
+ break;
579
+
580
+ case 'column-description' :
581
+ foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p )
582
+ if ( $p->post_content || $this->show_all_results )
583
+ $cposts[$p->ID] = $this->prepare_sort_string_value( $p->post_content );
584
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
585
+ break;
586
+
587
+ case 'column-mime_type' :
588
+ foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p )
589
+ if ( $p->post_mime_type || $this->show_all_results )
590
+ $cposts[$p->ID] = $this->prepare_sort_string_value( $p->post_mime_type );
591
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
592
+ break;
593
+
594
+ case 'column-file_name' :
595
+ foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
596
+ $meta = get_post_meta($p->ID, '_wp_attached_file', true);
597
+ $file = !empty($meta) ? basename($meta) : '';
598
+ if ( $file || $this->show_all_results )
599
+ $cposts[$p->ID] = $file;
600
+ }
601
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
602
+ break;
603
+
604
+ case 'column-alternate_text' :
605
+ foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
606
+ $alt = get_post_meta($p->ID, '_wp_attachment_image_alt', true);
607
+ if ( $alt || $this->show_all_results ) {
608
+ $cposts[$p->ID] = $this->prepare_sort_string_value( $alt );
609
+ }
610
+ }
611
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
612
+ break;
613
+
614
+ endswitch;
615
+
616
+ return $vars;
617
+ }
618
+
619
+ /**
620
+ * Orderby Posts column
621
+ *
622
+ * @since 1.3
623
+ */
624
+ private function get_orderby_posts_vars($vars)
625
+ {
626
+ $post_type = $vars['post_type'];
627
+
628
+ // Column
629
+ $column = $this->get_orderby_type( $vars['orderby'], $post_type );
630
+
631
+ if ( empty($column) )
632
+ return $vars;
633
+
634
+ // id
635
+ $id = key($column);
636
+
637
+ // type
638
+ $type = $id;
639
+
640
+ // Check for taxonomies, such as column-taxonomy-[taxname]
641
+ if ( strpos($type, 'column-taxonomy-') !== false )
642
+ $type = 'column-taxonomy';
643
+
644
+ // custom fields
645
+ if ( $this->is_column_meta($type) )
646
+ $type = 'column-post-meta';
647
+
648
+ // attachments
649
+ if ( $type == 'column-attachment-count' )
650
+ $type = 'column-attachment';
651
+
652
+ // var
653
+ $cposts = array();
654
+ switch( $type ) :
655
+
656
+ case 'column-postid' :
657
+ $vars['orderby'] = 'ID';
658
+ break;
659
+
660
+ case 'column-order' :
661
+ $vars['orderby'] = 'menu_order';
662
+ break;
663
+
664
+ case 'column-post-meta' :
665
+ $field = $column[$id]['field'];
666
+
667
+ // orderby type
668
+ $field_type = 'meta_value';
669
+ if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' )
670
+ $field_type = 'meta_value_num';
671
+
672
+ $vars = array_merge($vars, array(
673
+ 'meta_key' => $field,
674
+ 'orderby' => $field_type
675
+ ));
676
+ break;
677
+
678
+ case 'column-excerpt' :
679
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
680
+
681
+ // add excerpt to the post ids
682
+ $cposts[$p->ID] = $this->prepare_sort_string_value($p->post_content);
683
+ }
684
+ // we will add the sorted post ids to vars['post__in'] and remove unused vars
685
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING );
686
+ break;
687
+
688
+ case 'column-word-count' :
689
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p )
690
+ $cposts[$p->ID] = str_word_count( $this->strip_trim( $p->post_content ) );
691
+ $this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
692
+ break;
693
+
694
+ case 'column-page-template' :
695
+ $templates = get_page_templates();
696
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
697
+ $page_template = get_post_meta($p->ID, '_wp_page_template', true);
698
+ $cposts[$p->ID] = array_search($page_template, $templates);
699
+ }
700
+ $this->set_vars_post__in( &$vars, $cposts );
701
+ break;
702
+
703
+ case 'column-post_formats' :
704
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
705
+ $cposts[$p->ID] = get_post_format($p->ID);
706
+ }
707
+ $this->set_vars_post__in( &$vars, $cposts );
708
+ break;
709
+
710
+ case 'column-attachment' :
711
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p )
712
+ $cposts[$p->ID] = count( $this->get_attachment_ids($p->ID) );
713
+ $this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
714
+ break;
715
+
716
+
717
+ case 'column-page-slug' :
718
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p )
719
+ $cposts[$p->ID] = $p->post_name;
720
+ $this->set_vars_post__in( &$vars, $cposts );
721
+ break;
722
+
723
+ case 'column-sticky' :
724
+ $stickies = get_option('sticky_posts');
725
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
726
+ $cposts[$p->ID] = $p->ID;
727
+ if ( !empty($stickies) && in_array($p->ID, $stickies ) ) {
728
+ $cposts[$p->ID] = 0;
729
+ }
730
+ }
731
+ $this->set_vars_post__in( &$vars, $cposts );
732
+ break;
733
+
734
+ case 'column-featured_image' :
735
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
736
+ $cposts[$p->ID] = $p->ID;
737
+ $thumb = get_the_post_thumbnail($p->ID);
738
+ if ( !empty($thumb) ) {
739
+ $cposts[$p->ID] = 0;
740
+ }
741
+ }
742
+ $this->set_vars_post__in( &$vars, $cposts );
743
+ break;
744
+
745
+ case 'column-roles' :
746
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
747
+ $cposts[$p->ID] = 0;
748
+ $userdata = get_userdata($p->post_author);
749
+ if ( !empty($userdata->roles[0]) ) {
750
+ $cposts[$p->ID] = $userdata->roles[0];
751
+ }
752
+ }
753
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING );
754
+ break;
755
+
756
+ case 'column-status' :
757
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
758
+ $cposts[$p->ID] = $p->post_status.strtotime($p->post_date);
759
+ }
760
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING );
761
+ break;
762
+
763
+ case 'column-comment-status' :
764
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
765
+ $cposts[$p->ID] = $p->comment_status;
766
+ }
767
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING );
768
+ break;
769
+
770
+ case 'column-ping-status' :
771
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
772
+ $cposts[$p->ID] = $p->ping_status;
773
+ }
774
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING );
775
+ break;
776
+
777
+ case 'column-taxonomy' :
778
+ $tax = str_replace('column-taxonomy-', '', $id);
779
+ foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
780
+ $cposts[$p->ID] = '';
781
+ $terms = get_the_terms($p->ID, $tax);
782
+ if ( !is_wp_error($terms) && !empty($terms) ) {
783
+ // only use the first term to sort
784
+ $term = array_shift(array_values($terms));
785
+ if ( isset($term->term_id) ) {
786
+ $cposts[$p->ID] = sanitize_term_field('name', $term->name, $term->term_id, $term->taxonomy, 'db');
787
+ }
788
+ }
789
+ }
790
+ $this->set_vars_post__in( &$vars, $cposts, SORT_STRING );
791
+
792
+ break;
793
+
794
+ endswitch;
795
+
796
+ return $vars;
797
+ }
798
+
799
+ /**
800
+ * Set post__in for use in WP_Query
801
+ *
802
+ * This will order the ID's asc or desc and set the appropriate filters.
803
+ *
804
+ * @since 1.2.1
805
+ */
806
+ private function set_vars_post__in( &$vars, $sortposts, $sort_flags = SORT_REGULAR )
807
+ {
808
+ // sort post ids by value
809
+ if ( $vars['order'] == 'asc' )
810
+ asort($sortposts, $sort_flags);
811
+ else
812
+ arsort($sortposts, $sort_flags);
813
+
814
+ // this will make sure WP_Query will use the order of the ids that we have just set in 'post__in'
815
+ // set priority higher then default to prevent conflicts with 3rd party plugins
816
+ add_filter('posts_orderby', array( $this, 'filter_orderby_post__in'), 10, 2 );
817
+
818
+ // cleanup the vars we dont need
819
+ $vars['order'] = '';
820
+ $vars['orderby'] = '';
821
+
822
+ // add the sorted post ids to the query with the use of post__in
823
+ $vars['post__in'] = array_keys($sortposts);
824
+ }
825
+
826
+ /**
827
+ * Get orderby type
828
+ *
829
+ * @since 1.1
830
+ */
831
+ private function get_orderby_type($orderby, $type)
832
+ {
833
+ $db_columns = $this->get_stored_columns($type);
834
+
835
+ if ( $db_columns ) {
836
+ foreach ( $db_columns as $id => $vars ) {
837
+
838
+ // check which custom column was clicked
839
+ if ( isset( $vars['label'] ) && $orderby == $this->sanitize_string( $vars['label'] ) ) {
840
+ $column[$id] = $vars;
841
+ return $column;
842
+ }
843
+ }
844
+ }
845
+ return false;
846
+ }
847
+
848
+ /**
849
+ * Maintain order of ids that are set in the post__in var.
850
+ *
851
+ * This will force the returned posts to use the order of the ID's that
852
+ * have been set in post__in. Without this the ID's will be set in numeric order.
853
+ * See the WP_Query object for more info about the use of post__in.
854
+ *
855
+ * @since 1.2.1
856
+ */
857
+ public function filter_orderby_post__in($orderby, $wp)
858
+ {
859
+ global $wpdb;
860
+
861
+ // we need the query vars
862
+ $vars = $wp->query_vars;
863
+ if ( ! empty ( $vars['post__in'] ) ) {
864
+ // now we can get the ids
865
+ $ids = implode(',', $vars['post__in']);
866
+
867
+ // by adding FIELD to the SQL query we are forcing the order of the ID's
868
+ return "FIELD({$wpdb->prefix}posts.ID,{$ids})";
869
+ }
870
+ }
871
+
872
+ /**
873
+ * Get any posts by post_type
874
+ *
875
+ * @since 1.2.1
876
+ */
877
+ private function get_any_posts_by_posttype( $post_type )
878
+ {
879
+ $allposts = get_posts(array(
880
+ 'numberposts' => -1,
881
+ 'post_status' => 'any',
882
+ 'post_type' => $post_type
883
+ ));
884
+ return $allposts;
885
+ }
886
+
887
+ /**
888
+ * Request URI is
889
+ *
890
+ * @since 1.3.1
891
+ */
892
+ private function request_uri_is( $screen_id = '' )
893
+ {
894
+ if (strpos( $_SERVER['REQUEST_URI'], "/{$screen_id}.php" ) !== false )
895
+ return true;
896
+
897
+ return false;
898
+ }
899
+
900
+ /**
901
+ * Prepare the value for being by sorting
902
+ *
903
+ * @since 1.3
904
+ */
905
+ private function prepare_sort_string_value($string)
906
+ {
907
+ // remove tags and only get the first 20 chars and force lowercase.
908
+ $string = strtolower( substr( $this->strip_trim($string),0 ,20 ) );
909
+
910
+ return $string;
911
+ }
912
+
913
+ /**
914
+ * Get users data
915
+ *
916
+ * @since 1.3
917
+ */
918
+ function get_users_data()
919
+ {
920
+ $userdatas = array();
921
+ $wp_users = get_users( array(
922
+ 'blog_id' => $GLOBALS['blog_id'],
923
+ ));
924
+ foreach ( $wp_users as $u ) {
925
+ $userdatas[$u->ID] = get_userdata($u->ID);
926
+ }
927
+ return $userdatas;
928
+ }
929
+
930
+ /**
931
+ * Register filtering columns
932
+ *
933
+ * @since 1.4.2
934
+ */
935
+ function register_filtering_columns()
936
+ {
937
+ if ( ! $this->unlocked )
938
+ return false;
939
+
940
+ // hook into wordpress
941
+ add_action('restrict_manage_posts', array($this, 'callback_restrict_posts'));
942
+ }
943
+
944
+ /**
945
+ * Add taxonomy filters to posts
946
+ *
947
+ * @since 1.4.2
948
+ */
949
+ function callback_restrict_posts()
950
+ {
951
+ global $post_type_object;
952
+
953
+ // make a filter foreach taxonomy
954
+ $taxonomies = get_object_taxonomies($post_type_object->name, 'names');
955
+
956
+ if ( $taxonomies ) {
957
+ foreach ( $taxonomies as $tax ) {
958
+ if ( !in_array($tax, array('post_tag','category','post_format') ) ) {
959
+
960
+ $terms = get_terms($tax);
961
+ $terms = $this->indent($terms, 0, 'parent', 'term_id');
962
+ $terms = $this->apply_dropdown_markup($terms);
963
+
964
+ $select = "<option value=''>".__('Show all ', $this->textdomain)."{$tax}</option>";
965
+ if (!empty($terms)) {
966
+ foreach( $terms as $term_slug => $term) {
967
+ $selected = isset($_GET[$tax]) && $term_slug == $_GET[$tax] ? " selected='selected'" : '';
968
+ $select .= "<option value='{$term_slug}'{$selected}>{$term}</option>";
969
+ }
970
+ }
971
+ echo "<select class='postform' name='{$tax}'>{$select}</select>";
972
+ }
973
+ }
974
+ }
975
+ }
976
+
977
+ /**
978
+ * Applies dropdown markup for taxonomy dropdown
979
+ *
980
+ * @since 1.4.2
981
+ */
982
+ private function apply_dropdown_markup($array, $level = 0, $output = array())
983
+ {
984
+ foreach($array as $v) {
985
+
986
+ $prefix = '';
987
+ for($i=0; $i<$level; $i++) {
988
+ $prefix .= '&nbsp;&nbsp;';
989
+ }
990
+
991
+ $output[$v->slug] = $prefix . htmlentities($v->name, ENT_QUOTES, 'UTF-8');
992
+
993
+ if ( !empty($v->children) ) {
994
+ $output = $this->apply_dropdown_markup($v->children, ($level + 1), $output);
995
+ }
996
+ }
997
+
998
+ return $output;
999
+ }
1000
+
1001
+ /**
1002
+ * Indents any object as long as it has a unique id and that of its parent.
1003
+ *
1004
+ * @since 1.4.2
1005
+ */
1006
+ private function indent($array, $parentId = 0, $parentKey = 'post_parent', $selfKey = 'ID', $childrenKey = 'children')
1007
+ {
1008
+ $indent = array();
1009
+
1010
+ // clean counter
1011
+ $i = 0;
1012
+
1013
+ foreach($array as $v) {
1014
+
1015
+ if ($v->$parentKey == $parentId) {
1016
+ $indent[$i] = $v;
1017
+ $indent[$i]->$childrenKey = $this->indent($array, $v->$selfKey, $parentKey, $selfKey);
1018
+
1019
+ $i++;
1020
+ }
1021
+ }
1022
+
1023
+ return $indent;
1024
+ }
1025
+ }
1026
+
1027
+ ?>
codepress-admin-columns.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: Codepress Admin Columns
4
- Version: 1.0.1
5
- Description: This plugin makes it easy to customize Admin Columns for your Posts, Pages and Custom Post Type Screens.
6
- Author: Tobias Schutter
7
  Author URI: http://www.codepress.nl
8
  Plugin URI: http://www.codepress.nl/plugins/codepress-admin-columns/
9
  Text Domain: codepress-admin-columns
@@ -26,17 +26,21 @@ along with this program; if not, write to the Free Software
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
 
29
- define( 'CPAC_VERSION', '1.0.1' );
 
 
 
 
30
 
31
  /**
32
- * Init Class
33
  *
34
- * @since 1.0
35
  */
36
- $cpac = new Codepress_Admin_Columns;
37
 
38
  /**
39
- * Advanced Admin Columns Class
40
  *
41
  * @since 1.0
42
  *
@@ -44,54 +48,82 @@ $cpac = new Codepress_Admin_Columns;
44
  class Codepress_Admin_Columns
45
  {
46
  private $post_types,
47
- $options,
48
- $options_default,
49
  $slug,
50
- $textdomain;
 
 
 
 
 
 
 
51
 
52
  /**
53
- * 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_column_value'), 10, 2 );
90
- add_action( 'manage_posts_custom_column', array( &$this, 'manage_column_value'), 10, 2 );
91
- add_action( 'admin_print_styles' , array( &$this, 'column_styles') );
92
- add_filter( 'request', array( &$this, 'handle_requests_orderby_column') );
93
- add_filter( 'plugin_action_links', array( &$this, 'add_settings_link'), 10, 2);
94
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
  /**
97
  * Admin Menu.
@@ -112,12 +144,19 @@ class Codepress_Admin_Columns
112
  // Menu slug
113
  $this->slug,
114
  // Callback
115
- array( &$this, 'plugin_settings_page')
116
  );
117
 
118
- // css scripts
119
- add_action( "admin_print_styles-$page", array( &$this, 'admin_styles') );
120
- }
 
 
 
 
 
 
 
121
 
122
  /**
123
  * Add Settings link to plugin page
@@ -134,194 +173,194 @@ class Codepress_Admin_Columns
134
  }
135
 
136
  /**
137
- * Register Columns
 
 
138
  *
139
  * @since 1.0
140
  */
141
  public function register_columns()
142
  {
143
- foreach ( $this->post_types as $post_type ) {
144
-
 
145
  // register column per post type
146
- add_filter("manage_edit-{$post_type}_columns", array(&$this, 'callback_set_column'));
147
-
148
- // register column as sortable
149
- add_filter( "manage_edit-{$post_type}_sortable_columns", array(&$this, 'callback_set_sortable_column'));
150
- }
 
 
 
 
 
 
 
 
 
 
151
  }
152
 
153
  /**
154
- * Callback Set Column
155
  *
156
  * @since 1.0
157
  */
158
- public function callback_set_column($columns)
159
- {
160
- global $post_type;
161
- $columns = $this->set_column($columns, $post_type);
162
-
163
- return $columns;
164
  }
165
 
166
  /**
167
- * Callback Set Sortable Column
168
  *
169
- * @since 1.0
170
  */
171
- public function callback_set_sortable_column($columns)
172
- {
173
- global $post_type;
174
- $columns = $this->set_sortable_filter($columns, $post_type);
175
-
176
- return $columns;
177
  }
178
 
179
  /**
180
- * Settings Page Template.
181
  *
182
- * This function in conjunction with others usei the WordPress
183
- * Settings API to create a settings page where users can adjust
184
- * the behaviour of this plugin.
 
 
 
 
 
 
185
  *
186
- * @since 1.0
187
  */
188
- public function plugin_settings_page()
189
  {
190
- // loop through post types
191
- $rows = '';
192
- foreach ( $this->post_types as $post_type ) {
193
-
194
- // post type label
195
- $label = $this->get_singular_name($post_type);
196
-
197
- // id
198
- $id = $this->sanitize_string($post_type);
199
-
200
- // build draggable boxes
201
- $boxes = $this->get_column_options($post_type);
202
-
203
- // class
204
- $class = $this->is_menu_type_current($post_type) ? ' current' : ' hidden';
205
-
206
- $rows .= "
207
- <tr id='cpac-box-{$id}' valign='top' class='cpac-box-row{$class}'>
208
- <th class='cpac_post_type' scope='row'>
209
- {$label}
210
- </th>
211
- <td>
212
- <h3 class='cpac_post_type hidden'>{$label}</h3>
213
- {$boxes}
214
- </td>
215
- </tr>
216
- ";
 
 
 
 
 
 
 
 
 
 
217
  }
218
 
219
- // Post Type Menu
220
- $menu = $this->get_post_type_menu();
 
 
 
 
 
 
 
 
 
221
 
222
- ?>
223
- <div id="cpac" class="wrap">
224
- <?php screen_icon($this->slug) ?>
225
- <h2><?php _e('Codepress Admin Columns', $this->textdomain); ?></h2>
226
- <?php echo $menu ?>
227
- <div class="postbox-container" style="width:70%;">
228
- <div class="metabox-holder">
229
- <div class="meta-box-sortables">
230
-
231
- <div id="general-cpac-settings" class="postbox">
232
- <div title="Click to toggle" class="handlediv"><br></div>
233
- <h3 class="hndle">
234
- <span><?php _e('Admin Columns', $this->textdomain ); ?></span>
235
- </h3>
236
- <div class="inside">
237
- <form method="post" action="options.php">
238
-
239
- <?php settings_fields( 'cpac-settings-group' ); ?>
240
-
241
- <table class="form-table">
242
-
243
- <?php echo $rows ?>
244
-
245
- <tr class="bottom" valign="top">
246
- <th scope="row"></th>
247
- <td>
248
- <p class="submit">
249
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
250
- </p>
251
- </td>
252
- </tr>
253
- </table>
254
- </form>
255
- </div>
256
- </div><!-- general-settings -->
257
-
258
- <div id="restore-cpac-settings" class="postbox">
259
- <div title="Click to toggle" class="handlediv"><br></div>
260
- <h3 class="hndle">
261
- <span><?php _e('Restore defaults', $this->textdomain) ?></span>
262
- </h3>
263
- <div class="inside">
264
- <form method="post" action="">
265
- <input type="submit" class="button" name="cpac-restore-defaults" value="<?php _e('Restore default settings', $this->textdomain ) ?>" onclick="return confirm('<?php _e("Warning! ALL saved admin columns data will be deleted. This cannot be undone. \'OK\' to delete, \'Cancel\' to stop", $this->textdomain); ?>');" />
266
- </form>
267
- <p class="description"><?php _e('This will delete all column settings and restore the default settings.', $this->textdomain); ?></p>
268
- </div>
269
- </div><!-- restore-cpac-settings -->
270
-
271
- </div>
272
- </div>
273
- </div><!-- .postbox-container -->
274
 
275
- <div class="postbox-container" style="width:20%;">
276
- <div class="metabox-holder">
277
- <div class="meta-box-sortables">
278
-
279
- <div id="side-cpac-settings" class="postbox">
280
- <div title="Click to toggle" class="handlediv"><br></div>
281
- <h3 class="hndle">
282
- <span><?php _e('Need support?', $this->textdomain) ?></span>
283
- </h3>
284
- <div class="inside">
285
- <p><?php printf(__('If you are having problems with this plugin, please talk about them in the <a href="%s">Support forums</a>.', $this->textdomain), 'http://wordpress.org/tags/codepress-admin-columns' );?></p>
286
- <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>
287
- </div>
288
- </div><!-- side-cpac-settings -->
289
-
290
- </div>
291
- </div>
292
- </div><!-- .postbox-container -->
 
293
 
294
- </div>
295
- <?php
 
 
 
 
 
 
 
 
 
296
  }
297
-
298
  /**
299
  * Get a list of Column options per post type
300
  *
301
  * @since 1.0
302
  */
303
- private function get_column_options($post_type)
304
  {
305
  // merge all columns
306
- $display_columns = $this->get_merged_columns($post_type);
307
 
308
  // define
309
  $list = '';
310
 
311
  // loop throught the active columns
312
  if ( $display_columns ) {
313
- foreach ( $display_columns as $key => $values ) {
314
 
315
  // add items to the list
316
- $list .= $this->get_box($post_type, $key, $values);
317
 
318
  }
319
  }
320
 
321
  // custom field button
322
  $button_add_column = '';
323
- if ( $this->get_postmeta_by_posttype($post_type) )
324
- $button_add_column = "<a href='javacript:;' class='cpac-add-customfield-column button'>+ " . __('Add Custom Field Column') . "</a>";
325
 
326
  return "
327
  <div class='cpac-box'>
@@ -329,7 +368,7 @@ class Codepress_Admin_Columns
329
  {$list}
330
  </ul>
331
  {$button_add_column}
332
- <div class='cpac-reorder-msg'></div>
333
  </div>
334
  ";
335
  }
@@ -339,60 +378,118 @@ class Codepress_Admin_Columns
339
  *
340
  * @since 1.0
341
  */
342
- private function get_merged_columns($post_type)
343
- {
344
- //get saved database columns
345
- $db_columns = $this->get_db_columns($post_type);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
 
347
- // get wp default columns
348
- $wp_default_columns = $this->get_wp_default_columns($post_type);
 
 
 
 
 
 
 
 
 
349
 
350
- // get custom columns
351
- $wp_custom_columns = $this->get_custom_columns($post_type);
352
 
353
- // merge wp default and custom columns
 
 
 
 
 
 
 
 
 
354
  $default_columns = wp_parse_args($wp_custom_columns, $wp_default_columns);
355
 
356
- // loop throught the active columns
 
357
  if ( $db_columns ) {
358
- foreach ( $db_columns as $key => $values ) {
 
 
 
 
 
359
 
360
  // get column meta options from custom columns
361
- if ( strpos($key, 'column-meta-') !== false )
362
- $db_columns[$key]['options'] = $wp_custom_columns['column-meta-1']['options'];
363
 
364
  // add static options
365
- else
366
- $db_columns[$key]['options'] = $default_columns[$key]['options'];
367
 
368
- unset($default_columns[$key]);
369
  }
370
  }
371
 
372
  // merge all
373
- $display_columns = wp_parse_args($db_columns, $default_columns);
374
-
375
- return $display_columns;
376
  }
377
-
378
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  /**
380
  * Get checkbox
381
  *
382
  * @since 1.0
383
  */
384
- private function get_box($post_type, $key, $values)
385
  {
386
  $classes = array();
387
 
388
  // set state
389
  $state = isset($values['state']) ? $values['state'] : '';
390
 
391
- // set sortorder
392
- $sortorder = isset($values['sortorder']) && $values['sortorder'] == 'on' ? 'on' : '';
393
-
394
  // class
395
- $classes[] = "cpac-box-{$key}";
396
  if ( $state )
397
  $classes[] = 'active';
398
  if ( ! empty($values['options']['class']) )
@@ -400,31 +497,44 @@ class Codepress_Admin_Columns
400
  $class = implode(' ', $classes);
401
 
402
  // more box options
403
- $more_options = $this->get_additional_box_options($post_type, $key, $values);
404
  $action = "<a class='cpac-action' href='#open'>open</a>";
 
 
 
 
 
 
 
 
 
 
405
 
406
  // hide box options
407
- if ( ! empty($values['options']['hide_options']) ) {
408
- $action = $more_options = '';
 
409
  }
410
 
411
  $list = "
412
  <li class='{$class}'>
413
- <div class='cpac-sort-handle'></div>
414
- <div class='cpac-type-options'>
415
-
416
  <div class='cpac-checkbox'></div>
417
- <input type='hidden' class='cpac-state' name='cpac_options[columns][{$post_type}][{$key}][state]' value='{$state}'/>
418
- <input type='hidden' name='cpac_options[columns][{$post_type}][{$key}][sortorder]' value='{$sortorder}'/>
419
- <label class='main-label'>{$values['label']}</label>
420
  </div>
421
  <div class='cpac-meta-title'>
422
  {$action}
423
- <span>{$values['options']['type_label']}</span>
424
  </div>
425
  <div class='cpac-type-inside'>
426
- <label for='cpac_options[columns][{$post_type}][{$key}][label]'>Label: </label>
427
- <input type='text' name='cpac_options[columns][{$post_type}][{$key}][label]' value='{$values['label']}' class='text'/>
 
 
 
 
428
  <br/>
429
  {$more_options}
430
  </div>
@@ -439,13 +549,13 @@ class Codepress_Admin_Columns
439
  *
440
  * @since 1.0
441
  */
442
- private function get_additional_box_options($post_type, $key, $values)
443
  {
444
  $fields = '';
445
 
446
- // Custom Fields
447
- if ( strpos($key, 'column-meta-') !== false )
448
- $fields .= $this->get_box_options_customfields($post_type, $key, $values);
449
 
450
  return $fields;
451
  }
@@ -455,10 +565,10 @@ class Codepress_Admin_Columns
455
  *
456
  * @since 1.0
457
  */
458
- private function get_box_options_customfields($post_type, $key, $values)
459
  {
460
  // get post meta fields
461
- $fields = $this->get_postmeta_by_posttype($post_type);
462
 
463
  if ( empty($fields) )
464
  return false;
@@ -485,10 +595,15 @@ class Codepress_Admin_Columns
485
  'library_id' => __('Media Library Icon', $this->textdomain),
486
  'excerpt' => __('Excerpt'),
487
  'array' => __('Multiple Values', $this->textdomain),
 
 
 
488
  );
489
 
490
- // add filters
491
- $fieldtypes = apply_filters('cpac-field-types', $fieldtypes );
 
 
492
  foreach ( $fieldtypes as $fkey => $fieldtype ) {
493
  $fieldtype_options .= sprintf
494
  (
@@ -499,12 +614,16 @@ class Codepress_Admin_Columns
499
  );
500
  }
501
 
 
 
 
 
502
  if ( empty($field_options) )
503
  return false;
504
 
505
  // add remove button
506
  $remove = '<p class="remove-description description">'.__('This field can not be removed', $this->textdomain).'</p>';
507
- if ( $key != 'column-meta-1') {
508
  $remove = "
509
  <p>
510
  <a href='javascript:;' class='cpac-delete-custom-field-box'>".__('Remove')."</a>
@@ -513,12 +632,18 @@ class Codepress_Admin_Columns
513
  }
514
 
515
  $inside = "
516
- <label for='cpac_options[columns][{$post_type}][{$key}][field]'>Custom Field: </label>
517
- <select name='cpac_options[columns][{$post_type}][{$key}][field]'>{$field_options}</select>
518
  <br/>
519
- <label for='cpac_options[columns][{$post_type}][{$key}][field_type]'>Field Type: </label>
520
- <select name='cpac_options[columns][{$post_type}][{$key}][field_type]'>{$fieldtype_options}</select>
521
  <br/>
 
 
 
 
 
 
522
  {$remove}
523
  ";
524
 
@@ -526,17 +651,32 @@ class Codepress_Admin_Columns
526
  }
527
 
528
  /**
529
- * Get post meta fields by post type
530
  *
531
  * @since 1.0
532
  */
533
- private function get_postmeta_by_posttype($post_type)
534
  {
535
  global $wpdb;
536
- // get mata fields
537
- $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';
538
- $fields = $wpdb->get_results($sql, ARRAY_N);
 
 
 
 
 
 
 
539
 
 
 
 
 
 
 
 
 
540
  // postmeta
541
  if ( $fields ) {
542
  $meta_fields = array();
@@ -546,9 +686,8 @@ class Codepress_Admin_Columns
546
  $meta_fields[] = $field[0];
547
  }
548
  }
549
-
550
  return $meta_fields;
551
- }
552
 
553
  return false;
554
  }
@@ -558,19 +697,35 @@ class Codepress_Admin_Columns
558
  *
559
  * @since 1.0
560
  */
561
- public function admin_enqueue_scripts()
562
  {
563
- wp_enqueue_script( 'dashboard' );
564
- wp_enqueue_script( 'jquery-ui-sortable' );
565
- wp_enqueue_script( 'cpac-admin', $this->plugin_url('/assets/js/admin-column.js'), array('jquery', 'jquery-ui-sortable'), CPAC_VERSION );
566
  }
567
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
568
  /**
569
  * Get post types
570
  *
571
  * @since 1.0
572
  */
573
- private function get_post_types()
574
  {
575
  $post_types = get_post_types(array(
576
  '_builtin' => false
@@ -578,7 +733,7 @@ class Codepress_Admin_Columns
578
  $post_types['post'] = 'post';
579
  $post_types['page'] = 'page';
580
 
581
- return $post_types;
582
  }
583
 
584
  /**
@@ -588,6 +743,7 @@ class Codepress_Admin_Columns
588
  */
589
  public function admin_styles()
590
  {
 
591
  wp_enqueue_style( 'cpac-admin', $this->plugin_url('/assets/css/admin-column.css'), array(), CPAC_VERSION, 'all' );
592
  }
593
 
@@ -609,10 +765,10 @@ class Codepress_Admin_Columns
609
  public function register_settings()
610
  {
611
  // If we have no options in the database, let's add them now.
612
- if ( false === $this->options )
613
- add_option( 'cpac_options', array(&$this, 'get_default_plugin_options') );
614
 
615
- register_setting( 'cpac-settings-group', 'cpac_options', array(&$this, 'options_callback') );
616
  }
617
 
618
  /**
@@ -630,7 +786,7 @@ class Codepress_Admin_Columns
630
  }
631
 
632
  /**
633
- * Save geocode coordinates of focus location.
634
  *
635
  * @since 1.0
636
  */
@@ -644,23 +800,49 @@ class Codepress_Admin_Columns
644
  *
645
  * @since 1.0
646
  */
647
- private function handle_requests()
648
  {
649
  // settings updated
650
- if ( ! empty($_REQUEST['settings-updated']) ) {
651
-
652
- // stores the default columns that are set by WP or set in the theme.
653
- $wp_default_columns = array();
654
- foreach ( $this->post_types as $post_type ) {
655
- $wp_default_columns[$post_type] = $this->get_wp_default_columns($post_type);
656
- }
657
- update_option( 'cpac_options_default', $wp_default_columns );
658
- }
659
 
660
  // restore defaults
661
- if ( ! empty($_REQUEST['cpac-restore-defaults']) ) {
662
  $this->restore_defaults();
663
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
  }
665
 
666
  /**
@@ -671,7 +853,7 @@ class Codepress_Admin_Columns
671
  private function restore_defaults()
672
  {
673
  delete_option( 'cpac_options' );
674
- delete_option( 'cpac_options_default' );
675
  }
676
 
677
  /**
@@ -679,15 +861,16 @@ class Codepress_Admin_Columns
679
  *
680
  * @since 1.0
681
  */
682
- private function get_post_excerpt($post_id, $charlength = 100)
683
  {
684
- global $post;
 
685
  $save_post = $post;
686
  $post = get_post($post_id);
687
  $excerpt = get_the_excerpt();
688
  $post = $save_post;
689
 
690
- $output = $this->get_shortened_string($excerpt, $charlength );
691
 
692
  return $output;
693
  }
@@ -697,22 +880,12 @@ class Codepress_Admin_Columns
697
  *
698
  * @since 1.0
699
  */
700
- private function get_shortened_string($string = '', $charlength = 100)
701
  {
702
  if (!$string)
703
  return false;
704
 
705
- $output = '';
706
- if ( strlen($string) > $charlength ) {
707
- $subex = substr($string,0,$charlength-5);
708
- $exwords = explode(" ",$subex);
709
- $excut = -(strlen($exwords[count($exwords)-1]));
710
- $output .= $excut < 0 ? substr($subex,0,$excut) : $subex;
711
- $output .= "[...]";
712
- } else {
713
- $output = $string;
714
- }
715
- return $output;
716
  }
717
 
718
  /**
@@ -720,21 +893,21 @@ class Codepress_Admin_Columns
720
  *
721
  * @since 1.0
722
  */
723
- public function manage_column_value($key, $post_id)
724
  {
725
- $type = $key;
726
 
727
  // Check for taxonomies, such as column-taxonomy-[taxname]
728
  if ( strpos($type, 'column-taxonomy-') !== false )
729
  $type = 'column-taxonomy';
730
 
731
  // Check for custom fields, such as column-meta-[customfieldname]
732
- if ( strpos($type, 'column-meta-') !== false )
733
- $type = 'column-meta';
734
 
735
  // Hook
736
- do_action('cpac-manage-column', $type, $key, $post_id);
737
-
738
  // Switch Types
739
  $result = '';
740
  switch ($type) :
@@ -751,15 +924,14 @@ class Codepress_Admin_Columns
751
 
752
  // Featured Image
753
  case "column-featured_image" :
754
- $result = get_the_post_thumbnail($post_id, array(80,80));
 
755
  break;
756
 
757
  // Sticky Post
758
  case "column-sticky" :
759
- if ( is_sticky($post_id) ) {
760
- $src = $this->plugin_url('assets/images/checkmark.png');
761
- $result = "<img alt='sticky' src='{$src}' />";
762
- }
763
  break;
764
 
765
  // Order
@@ -776,595 +948,2382 @@ class Codepress_Admin_Columns
776
  case "column-page-template" :
777
  // file name
778
  $page_template = get_post_meta($post_id, '_wp_page_template', true);
779
- // all page templates
780
- $templates = get_page_templates();
781
- // template name
782
- $result = array_search($page_template, $templates);
783
  break;
784
 
785
  // Slug
786
  case "column-page-slug" :
787
- $result = get_post($post_id)->post_name;
 
 
 
 
 
788
  break;
789
 
790
  // Taxonomy
791
  case "column-taxonomy" :
792
- $tax = str_replace('column-taxonomy-','',$key);
793
  $tags = get_the_terms($post_id, $tax);
794
  $tarr = array();
 
 
795
  if ( $tax == 'post_format' && empty($tags) ) {
796
  $result = __('Standard');
797
  }
798
- elseif ( !empty($tags) ) {
799
- foreach($tags as $tag) {
800
- $tarr[] = $tag->name;
 
 
 
 
 
 
 
801
  }
802
  $result = implode(', ', $tarr);
803
  }
804
  break;
805
 
806
  // Custom Field
807
- case "column-meta" :
808
- $result = $this->get_column_value_custom_field($post_id, $key);
809
  break;
810
 
811
  // Attachment
812
  case "column-attachment" :
813
  $result = $this->get_column_value_attachments($post_id);
814
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
815
 
816
  default :
817
- $result = get_post_meta( $post_id, $key, true );
818
 
819
  endswitch;
820
 
821
- if ( empty($result) )
822
- echo '&nbsp;';
823
-
824
  echo $result;
825
  }
826
-
827
  /**
828
- * Get column value of post attachments
829
  *
830
- * @since 1.0
831
  */
832
- private function get_column_value_attachments($post_id)
833
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
834
  $result = '';
835
- $attachments = get_posts(array(
836
- 'post_type' => 'attachment',
837
- 'numberposts' => -1,
838
- 'post_status' => null,
839
- 'post_parent' => $post_id
840
- ));
841
- if ( $attachments ) {
842
- foreach ( $attachments as $attach ) {
843
- $result .= wp_get_attachment_image( $attach->ID, array(80,80), true );
844
- }
845
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
846
  return $result;
847
  }
848
 
849
  /**
850
- * Get column value of Custom Field
851
  *
852
- * @since 1.0
853
  */
854
- private function get_column_value_custom_field($post_id, $key)
855
  {
856
- $columns = $this->get_db_columns( get_post_type($post_id) );
857
- $field = isset($columns[$key]['field']) ? $columns[$key]['field'] : '';
858
- $fieldtype = isset($columns[$key]['field_type']) ? $columns[$key]['field_type'] : '';
859
-
860
- // Get meta field value
861
- $meta = get_post_meta($post_id, $field, true);
862
 
863
- // multiple meta values
864
- if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
865
- $meta = get_post_meta($post_id, $field);
866
- $meta = $this->recursive_implode(', ', $meta);
867
- }
868
 
869
- // make sure there are no serialized arrays or empty meta data
870
- if ( empty($meta) || !is_string($meta) )
871
- return false;
872
-
873
- // handles each field type differently..
874
- switch ($fieldtype) :
875
 
876
- // Image
877
- case "image" :
878
- $meta = $this->get_thumbnail($meta);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
879
  break;
880
 
881
- // Media Library ID
882
- case "library_id" :
883
- // check if media exists
884
- $meta = wp_get_attachment_url($meta) ? wp_get_attachment_image( $meta, array(80,80), true ) : '';
 
 
 
 
 
 
 
 
 
 
885
  break;
886
 
887
- // Excerpt
888
- case "excerpt" :
889
- $meta = $this->get_shortened_string($meta, 100);
 
 
890
  break;
891
-
892
- endswitch;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
 
894
- return $meta;
895
- }
896
-
897
- /**
898
- * Implode for multi dimensional array
899
- *
900
- * @since 1.0
901
- */
902
- private function recursive_implode( $glue, $pieces )
903
- {
904
- foreach( $pieces as $r_pieces ) {
905
- if( is_array( $r_pieces ) ) {
906
- $retVal[] = $this->recursive_implode( $glue, $r_pieces );
907
- }
908
- else {
909
- $retVal[] = $r_pieces;
910
- }
911
- }
912
- return implode( $glue, $retVal );
913
  }
914
-
915
  /**
916
- * Set Columns for Registering
917
  *
918
- * @since 1.0
919
  */
920
- private function set_column($columns, $post_type)
921
  {
922
- $db_columns = $this->get_db_columns($post_type);
923
 
924
- if ( !$db_columns )
925
- return $columns;
926
 
927
- // set already loaded columns by plugins
928
- $set_columns = $this->filter_preset_columns($columns, $post_type);
929
-
930
- // loop through columns
931
- foreach ( $db_columns as $key => $values ) {
932
 
933
- // is active
934
- if ( isset($values['state']) && $values['state'] == 'on' ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
935
 
936
- // register format
937
- $set_columns[$key] = $values['label'];
938
- }
939
- }
940
- return $set_columns;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
941
  }
942
-
943
  /**
944
- * Set columns. These columns apply either for every post or set by a plugin.
945
  *
946
- * @since 1.0
947
  */
948
- private function filter_preset_columns($columns, $post_type = 'post')
949
  {
950
- $options = $this->options_default;
951
 
952
- if ( !$options )
953
- return $columns;
954
 
955
- // we use the wp default columns for filtering...
956
- $db_columns = $options[$post_type];
 
957
 
958
- // ... the ones that are set by plugins, theme functions and such.
959
- $dif_columns = array_diff(array_keys($columns), array_keys($db_columns));
960
 
961
- // we add those to the columns
962
- $pre_columns = array();
963
- if ( $dif_columns ) {
964
- foreach ( $dif_columns as $column ) {
965
- $pre_columns[$column] = $columns[$column];
966
- }
967
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
968
 
969
- return $pre_columns;
970
  }
971
 
972
  /**
973
- * Set sortable columns
974
  *
975
  * @since 1.0
976
  */
977
- private function set_sortable_filter($columns, $post_type)
978
  {
979
- $db_columns = $this->get_db_columns($post_type);
980
-
981
- if ( !$db_columns )
982
- return $columns;
983
-
984
- // loop through columns
985
- foreach ( $db_columns as $key => $values ) {
986
-
987
- // is active
988
- if ( isset($values['sortorder']) && $values['sortorder'] == 'on' ){
989
-
990
- // register format
991
- $columns[$key] = $this->sanitize_string($values['label']);
992
  }
993
- }
994
- return $columns;
995
- }
996
-
997
  /**
998
- * Get WP default supported admin columns per post type.
999
  *
1000
- * @since 1.0
 
 
 
 
1001
  */
1002
- private function get_wp_default_columns($post_type = 'post')
1003
- {
1004
- // load some dependencies
1005
- require_once(ABSPATH . 'wp-admin\includes\template.php');
1006
- require_once(ABSPATH . 'wp-admin\includes\class-wp-list-table.php');
1007
- require_once(ABSPATH . 'wp-admin\includes\class-wp-posts-list-table.php');
1008
-
1009
- // we need to change the current screen
1010
- global $current_screen;
1011
- $org_current_screen = $current_screen;
1012
-
1013
- // overwrite current_screen global with our post type of choose...
1014
- $current_screen->post_type = $post_type;
1015
-
1016
- // ...so we can get its columns
1017
- $columns = WP_Posts_List_Table::get_columns();
1018
-
1019
- // we remove the checkbox column as an option...
1020
- unset($columns['cb']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1021
 
1022
- // change to uniform format
1023
- $uniform_columns = array();
1024
- foreach ( $columns as $key => $label ) {
1025
- $hide_options = false;
1026
- $type_label = $label;
1027
 
1028
- // comment exception
1029
- if ( strpos( $label, 'comment-grey-bubble.png') ) {
1030
- $type_label = __('Comments', $this->textdomain);
1031
- $hide_options = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1032
  }
1033
 
1034
- $uniform_colums[$key] = array(
1035
- 'label' => $label,
1036
- 'state' => 'on',
1037
- 'options' => array(
1038
- 'type_label' => $type_label,
1039
- 'hide_options' => $hide_options,
1040
- 'class' => 'cpac-box-wp-native',
1041
- )
1042
- );
1043
  }
1044
 
1045
- // reset current screen
1046
- $current_screen = $org_current_screen;
1047
-
1048
- return $uniform_colums;
1049
  }
1050
-
1051
  /**
1052
- * Add extra columns
1053
  *
1054
- * @since 1.0
1055
  */
1056
- private function get_custom_columns($post_type)
1057
  {
1058
- $custom_columns = array();
1059
-
1060
- // default arguments
1061
- $defaults = array(
1062
- 'label' => '',
1063
- 'sortorder' => '',
1064
- 'state' => '',
 
 
 
 
 
 
 
 
 
 
 
1065
 
1066
- // options are static
1067
- 'options' => array(
1068
- 'type_label' => __('Custom', $this->textdomain),
1069
- 'hide_options' => false,
1070
- 'class' => 'cpac-box-custom',
1071
- )
1072
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1073
 
1074
- // Thumbnail support
1075
- if ( post_type_supports($post_type, 'thumbnail') ) {
1076
- $custom_columns['column-featured_image'] = wp_parse_args( array(
1077
- 'label' => __('Featured Image', $this->textdomain),
1078
- 'options' => array(
1079
- 'type_label' => __('Image', $this->textdomain)
1080
- )
1081
- ), $defaults);
 
 
 
 
1082
  }
1083
 
1084
- // Excerpt support
1085
- if ( post_type_supports($post_type, 'editor') ) {
1086
- $custom_columns['column-excerpt'] = wp_parse_args( array(
1087
- 'label' => __('Excerpt', $this->textdomain),
1088
- 'options' => array(
1089
- 'type_label' => __('Excerpt', $this->textdomain)
1090
- )
1091
- ), $defaults);
1092
  }
1093
 
1094
- // Sticky support
1095
- if ( $post_type == 'post' ) {
1096
- $custom_columns['column-sticky'] = wp_parse_args( array(
1097
- 'label' => __('Sticky', $this->textdomain),
1098
- 'options' => array(
1099
- 'type_label' => __('Sticky', $this->textdomain)
1100
- )
1101
- ), $defaults);
1102
- }
1103
 
1104
- // Order support
1105
- if ( post_type_supports($post_type, 'page-attributes') ) {
1106
- $custom_columns['column-order'] = wp_parse_args( array(
1107
- 'label' => __('Page Order', $this->textdomain),
1108
- 'sortorder' => 'on',
1109
- 'options' => array(
1110
- 'type_label' => __('Order', $this->textdomain)
1111
- )
1112
- ), $defaults);
1113
- }
1114
 
1115
- // Page Template
1116
- if ( $post_type == 'page' ) {
1117
- $custom_columns['column-page-template'] = wp_parse_args( array(
1118
- 'label' => __('Page Template', $this->textdomain),
1119
- 'sortorder' => 'on',
1120
- 'options' => array(
1121
- 'type_label' => __('Page Template', $this->textdomain)
1122
- )
1123
- ), $defaults);
1124
  }
1125
 
1126
- // Post Formats
1127
- if ( post_type_supports($post_type, 'post-formats') ) {
1128
- $custom_columns['column-post_formats'] = wp_parse_args( array(
1129
- 'label' => __('Post Format', $this->textdomain),
1130
- 'options' => array(
1131
- 'type_label' => __('Post Format', $this->textdomain)
1132
- )
1133
- ), $defaults);
1134
- }
1135
 
1136
- // Taxonomy support
1137
- $taxonomies = get_object_taxonomies($post_type, 'objects');
1138
- if ( $taxonomies ) {
1139
- foreach ( $taxonomies as $tax_slug => $tax ) {
1140
- if ( $tax_slug != 'post_tag' && $tax_slug != 'category' && $tax_slug != 'post_format' ) {
1141
- $custom_columns['column-taxonomy-'.$tax->name] = wp_parse_args( array(
1142
- 'label' => $tax->label,
1143
- 'options' => array(
1144
- 'type_label' => __('Taxonomy', $this->textdomain)
1145
- )
1146
- ), $defaults);
1147
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1148
  }
1149
  }
1150
 
1151
- // Post ID support
1152
- $custom_columns['column-postid'] = wp_parse_args( array(
1153
- 'label' => 'ID',
1154
- 'sortorder' => 'on',
1155
- 'options' => array(
1156
- 'type_label' => 'ID',
1157
- )
1158
- ), $defaults);
 
 
 
1159
 
1160
- // Slug support
1161
- $custom_columns['column-page-slug'] = wp_parse_args( array(
1162
- 'label' => __('Slug', $this->textdomain),
1163
- 'sortorder' => 'on',
1164
- 'options' => array(
1165
- 'type_label' => __('Slug', $this->textdomain),
1166
- )
1167
- ), $defaults);
1168
 
1169
- // Attachment support
1170
- $custom_columns['column-attachment'] = wp_parse_args( array(
1171
- 'label' => __('Attachment', $this->textdomain),
1172
- 'sortorder' => 'on',
1173
- 'options' => array(
1174
- 'type_label' => __('Attachment', $this->textdomain)
1175
- )
1176
- ), $defaults);
1177
 
1178
- // Custom Field support
1179
- if ( $this->get_postmeta_by_posttype($post_type) ) {
1180
- $custom_columns['column-meta-1'] = wp_parse_args( array(
1181
- 'label' => __('Custom Field', $this->textdomain),
1182
- 'field' => '',
1183
- 'field_type' => '',
1184
- 'options' => array(
1185
- 'type_label' => __('Field', $this->textdomain),
1186
- 'class' => 'cpac-box-metafield'
1187
- )
1188
- ), $defaults);
1189
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1190
 
1191
- return apply_filters('cpac-custom-columns', $custom_columns);
1192
  }
1193
 
1194
  /**
1195
- * Admin requests for orderby column
1196
  *
1197
- * @since 1.0
1198
  */
1199
- private function get_db_columns($post_type)
1200
- {
1201
- // get plugin options
1202
- $options = $this->options;
1203
-
1204
- // get saved columns
1205
- if ( isset($options['columns'][$post_type]) )
1206
- return $options['columns'][$post_type];
 
 
 
 
1207
 
1208
  return false;
1209
- }
1210
 
1211
  /**
1212
- * Post Type Menu
1213
  *
1214
- * @since 1.0
1215
  */
1216
- private function get_post_type_menu()
1217
  {
1218
- // set
1219
- $menu = '';
1220
- $count = 1;
1221
 
1222
- // referer
1223
- $referer = '';
1224
- if ( isset($_REQUEST['cpac_type']) && $_REQUEST['cpac_type'] )
1225
- $referer = $_REQUEST['cpac_type'];
1226
-
1227
- // loop
1228
- foreach ( $this->post_types as $post_type ) {
1229
- $label = $this->get_singular_name($post_type);
1230
- $clean_label = $this->sanitize_string($post_type);
1231
 
1232
- // divider
1233
- $divider = $count++ == 1 ? '' : ' | ';
 
1234
 
1235
- // current
1236
- $current = '';
1237
- if ( $this->is_menu_type_current($post_type) )
1238
- $current = ' class="current"';
1239
-
1240
- // menu list
1241
- $menu .= "
1242
- <li>{$divider}<a{$current} href='#cpac-box-{$clean_label}'>{$label}</a></li>
1243
- ";
1244
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1245
 
1246
- return "
1247
- <div class='cpac-menu'>
1248
- <ul class='subsubsub'>
1249
- {$menu}
1250
- </ul>
1251
- </div>
1252
- ";
1253
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1254
 
 
 
 
1255
  /**
1256
- * Checks if menu type is currently viewed
1257
  *
1258
- * @since 1.0
1259
  */
1260
- private function is_menu_type_current( $post_type )
1261
  {
1262
- //print_r($post_type);
 
 
 
 
 
1263
 
1264
- // referer
1265
- $referer = '';
1266
- if ( ! empty($_REQUEST['cpac_type']) )
1267
- $referer = $_REQUEST['cpac_type'];
 
 
 
 
 
 
 
 
1268
 
1269
- // get label
1270
- $label = $this->get_singular_name($post_type);
1271
- $clean_label = $this->sanitize_string($post_type);
1272
 
1273
- // get first element from post-types
1274
- $first = array_shift(array_values($this->post_types));
1275
 
1276
- // display the page that was being viewed before saving
1277
- if ( $referer ) {
1278
- if ( $referer == 'cpac-box-'.$clean_label ) {
1279
- return true;
1280
- }
1281
 
1282
- // settings page has not yet been saved
1283
- } elseif ( $first == $post_type ) {
1284
- return true;
1285
- }
1286
 
1287
- return false;
 
 
 
 
1288
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1289
 
 
 
 
 
 
 
 
 
 
1290
  /**
1291
- * Get singular name of post type
1292
  *
1293
- * @since 1.0
1294
  */
1295
- private function get_singular_name( $post_type )
1296
  {
1297
- $posttype_obj = get_post_type_object($post_type);
1298
- $label = $posttype_obj->labels->singular_name;
1299
- return $label;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1300
  }
1301
 
1302
  /**
1303
- * Admin requests for orderby column
1304
  *
1305
  * @since 1.0
1306
  */
1307
- public function handle_requests_orderby_column( $vars )
1308
  {
1309
- if ( isset( $vars['orderby'] ) ) {
1310
- // get saved columns
1311
- $db_columns = $this->get_db_columns($vars['post_type']);
 
 
 
 
 
 
1312
 
1313
- // Column Page Order
1314
- if ( isset($db_columns['column-order']) ) {
1315
-
1316
- // sanitizing label
1317
- $label = $this->sanitize_string($db_columns['column-order']['label']);
1318
-
1319
- // Check for Page Order
1320
- if ( $vars['orderby'] == $label ) {
1321
- $vars['orderby'] = 'menu_order';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1322
  }
1323
  }
1324
- }
1325
- return $vars;
1326
- }
1327
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1328
  /**
1329
- * Sanitize label
1330
  *
1331
- * Uses intern wordpress function esc_url so it matches the label sorting url.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1332
  *
1333
- * @since 1.0
1334
  */
1335
- private function sanitize_string($string)
1336
- {
1337
- $string = esc_url($string);
1338
- return str_replace('http://','', $string);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1339
  }
1340
 
1341
  /**
1342
- * Get a url to a file in this plugin.
1343
  *
1344
- * @since 1.0
1345
  */
1346
- private function plugin_url( $file = '' )
1347
- {
1348
- return plugins_url($file, __FILE__);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1349
  }
1350
 
1351
  /**
1352
- * Get a thumbnail
1353
  *
1354
- * @since 1.0
1355
  */
1356
- private function get_thumbnail( $image = '' )
1357
- {
1358
- if ( empty($image) )
1359
- return false;
1360
-
1361
- $image_path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $image);
1362
- $new = image_resize( $image_path, 120, 80, true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1363
 
1364
- if ( ! is_wp_error( $new ) )
1365
- $image = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $new);
1366
-
1367
- return "<img src='{$image}' alt='' width='120' height='80' />";
1368
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1369
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1370
  ?>
1
  <?php
2
  /*
3
  Plugin Name: Codepress Admin Columns
4
+ Version: 1.4.3
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/
9
  Text Domain: codepress-admin-columns
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
 
29
+ define( 'CPAC_VERSION', '1.4.3' );
30
+
31
+ // only run plugin in the admin interface
32
+ if ( !is_admin() )
33
+ return false;
34
 
35
  /**
36
+ * Dependencies
37
  *
38
+ * @since 1.3
39
  */
40
+ require_once dirname( __FILE__ ) . '/classes/sortable.php';
41
 
42
  /**
43
+ * Codepress Admin Columns Class
44
  *
45
  * @since 1.0
46
  *
48
  class Codepress_Admin_Columns
49
  {
50
  private $post_types,
 
 
51
  $slug,
52
+ $textdomain,
53
+ $codepress_url,
54
+ $wordpress_url,
55
+ $excerpt_length,
56
+ $admin_page,
57
+ $notice_message,
58
+ $notice_type,
59
+ $api_url;
60
 
61
  /**
62
+ * Constructor
63
  *
64
  * @since 1.0
65
  */
66
  function __construct()
67
+ {
68
+ $this->api_url = 'http://www.codepress.nl/';
69
+
70
+ // wp is loaded
71
+ add_action( 'wp_loaded', array( $this, 'init') );
72
  }
73
 
74
  /**
75
+ * Initialize plugin.
76
  *
77
  * Loading sequence is determined and intialized.
78
  *
79
  * @since 1.0
80
  */
81
+ public function init()
82
  {
83
  // vars
84
  $this->post_types = $this->get_post_types();
85
+
86
+ // set
 
 
 
87
  $this->slug = 'codepress-admin-columns';
88
  $this->textdomain = 'codepress-admin-columns';
89
+ $this->codepress_url = 'http://www.codepress.nl/plugins/codepress-admin-columns';
90
+ $this->wordpress_url = 'http://wordpress.org/tags/codepress-admin-columns';
91
+
92
+ // number of words
93
+ $this->excerpt_length = 20;
94
 
95
  // translations
96
  load_plugin_textdomain( $this->textdomain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
97
 
98
+ // register settings
99
+ add_action( 'admin_menu', array( $this, 'settings_menu') );
100
+ add_action( 'admin_init', array( $this, 'register_settings') );
101
+
102
+ // styling & scripts
103
+ add_action( 'admin_enqueue_scripts' , array( $this, 'column_styles') );
104
+ add_filter( 'admin_body_class', array( $this, 'admin_class' ) );
105
+ add_action( 'admin_head', array( $this, 'admin_css') );
106
+
107
+ // register column headers
108
+ add_action( 'admin_init', array( $this, 'register_columns' ) );
109
+
110
+ // actions columns
111
+ add_action( 'manage_pages_custom_column', array( $this, 'manage_posts_column_value'), 10, 2 );
112
+ add_action( 'manage_posts_custom_column', array( $this, 'manage_posts_column_value'), 10, 2 );
113
+ add_filter( 'manage_users_custom_column', array( $this, 'manage_users_column_value'), 10, 3 );
114
+ add_action( 'manage_media_custom_column', array( $this, 'manage_media_column_value'), 10, 2 );
115
+ add_action( 'manage_link_custom_column', array( $this, 'manage_link_column_value'), 10, 2 );
116
+ add_action( 'manage_comments_custom_column', array( $this, 'manage_comments_column_value'), 10, 2 );
117
+
118
+ // action ajax
119
+ add_action( 'wp_ajax_cpac_addon_activation', array( $this, 'ajax_activation'));
120
+
121
+ // handle requests gets a low priority so it will trigger when all other plugins have loaded their columns
122
+ add_action( 'admin_init', array( $this, 'handle_requests' ), 1000 );
123
+
124
+ // filters
125
+ add_filter( 'plugin_action_links', array( $this, 'add_settings_link'), 1, 2);
126
+ }
127
 
128
  /**
129
  * Admin Menu.
144
  // Menu slug
145
  $this->slug,
146
  // Callback
147
+ array( $this, 'plugin_settings_page')
148
  );
149
 
150
+ // set admin page
151
+ $this->admin_page = $page;
152
+
153
+ // settings page specific styles and scripts
154
+ add_action( "admin_print_styles-$page", array( $this, 'admin_styles') );
155
+ add_action( "admin_print_scripts-$page", array( $this, 'admin_scripts') );
156
+
157
+ // add help tabs
158
+ add_action("load-$page", array( $this, 'help_tabs'));
159
+ }
160
 
161
  /**
162
  * Add Settings link to plugin page
173
  }
174
 
175
  /**
176
+ * Register Columns
177
+ *
178
+ * apply_filters location in includes/screen.php
179
  *
180
  * @since 1.0
181
  */
182
  public function register_columns()
183
  {
184
+ /** Posts */
185
+ foreach ( $this->post_types as $post_type ) {
186
+
187
  // register column per post type
188
+ add_filter("manage_edit-{$post_type}_columns", array($this, 'callback_add_posts_column_headings'));
189
+ }
190
+
191
+ /** Users */
192
+ add_filter( "manage_users_columns", array($this, 'callback_add_users_column_headings'), 9);
193
+ // give higher priority, so it will load just before other plugins to prevent conflicts
194
+
195
+ /** Media */
196
+ add_filter( "manage_upload_columns", array($this, 'callback_add_media_column_headings'));
197
+
198
+ /** Links */
199
+ add_filter( "manage_link-manager_columns", array($this, 'callback_add_links_column_headings'));
200
+
201
+ /** Comments */
202
+ add_filter( "manage_edit-comments_columns", array($this, 'callback_add_comments_column_headings'));
203
  }
204
 
205
  /**
206
+ * Callback add Posts Column
207
  *
208
  * @since 1.0
209
  */
210
+ public function callback_add_posts_column_headings($columns)
211
+ {
212
+ global $post;
213
+
214
+ return $this->add_columns_headings($post->post_type, $columns);
 
215
  }
216
 
217
  /**
218
+ * Callback add Users column
219
  *
220
+ * @since 1.1
221
  */
222
+ public function callback_add_users_column_headings($columns)
223
+ {
224
+ return $this->add_columns_headings('wp-users', $columns);
 
 
 
225
  }
226
 
227
  /**
228
+ * Callback add Media column
229
  *
230
+ * @since 1.3
231
+ */
232
+ public function callback_add_media_column_headings($columns)
233
+ {
234
+ return $this->add_columns_headings('wp-media', $columns);
235
+ }
236
+
237
+ /**
238
+ * Callback add Links column
239
  *
240
+ * @since 1.3.1
241
  */
242
+ public function callback_add_links_column_headings($columns)
243
  {
244
+ return $this->add_columns_headings('wp-links', $columns);
245
+ }
246
+
247
+ /**
248
+ * Callback add Comments column
249
+ *
250
+ * @since 1.3.1
251
+ */
252
+ public function callback_add_comments_column_headings($columns)
253
+ {
254
+ return $this->add_columns_headings('wp-comments', $columns);
255
+ }
256
+
257
+ /**
258
+ * Add managed columns by Type
259
+ *
260
+ * @since 1.1
261
+ */
262
+ private function add_columns_headings( $type, $columns )
263
+ {
264
+ // only get stored columns.. the rest we don't need
265
+ $db_columns = $this->get_stored_columns($type);
266
+
267
+ if ( !$db_columns )
268
+ return $columns;
269
+
270
+ // filter already loaded columns by plugins
271
+ $set_columns = $this->filter_preset_columns( $type, $columns );
272
+
273
+ // loop through columns
274
+ foreach ( $db_columns as $id => $values ) {
275
+ // is active
276
+ if ( isset($values['state']) && $values['state'] == 'on' ){
277
+
278
+ // register format
279
+ $set_columns[$id] = $values['label'];
280
+ }
281
  }
282
 
283
+ return $set_columns;
284
+ }
285
+
286
+ /**
287
+ * Set columns. These columns apply either for every post or set by a plugin.
288
+ *
289
+ * @since 1.0
290
+ */
291
+ private function filter_preset_columns( $type, $columns )
292
+ {
293
+ $options = get_option('cpac_options_default');
294
 
295
+ if ( !$options )
296
+ return $columns;
297
+
298
+ // we use the wp default columns for filtering...
299
+ $stored_wp_default_columns = $options[$type];
300
+
301
+ // ... the ones that are set by plugins, theme functions and such.
302
+ $dif_columns = array_diff(array_keys($columns), array_keys($stored_wp_default_columns));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
 
304
+ // we add those to the columns
305
+ $pre_columns = array();
306
+ if ( $dif_columns ) {
307
+ foreach ( $dif_columns as $column ) {
308
+ $pre_columns[$column] = $columns[$column];
309
+ }
310
+ }
311
+
312
+ return $pre_columns;
313
+ }
314
+
315
+ /**
316
+ * Add managed sortable columns by Type
317
+ *
318
+ * @since 1.1
319
+ */
320
+ private function add_managed_sortable_columns( $type, $columns )
321
+ {
322
+ $display_columns = $this->get_merged_columns($type);
323
 
324
+ if ( ! $display_columns )
325
+ return $columns;
326
+
327
+ foreach ( $display_columns as $id => $vars ) {
328
+ if ( isset($vars['options']['sortorder']) && $vars['options']['sortorder'] == 'on' ){
329
+
330
+ // register format
331
+ $columns[$id] = $this->sanitize_string($vars['label']);
332
+ }
333
+ }
334
+ return $columns;
335
  }
336
+
337
  /**
338
  * Get a list of Column options per post type
339
  *
340
  * @since 1.0
341
  */
342
+ private function get_column_boxes($type)
343
  {
344
  // merge all columns
345
+ $display_columns = $this->get_merged_columns($type);
346
 
347
  // define
348
  $list = '';
349
 
350
  // loop throught the active columns
351
  if ( $display_columns ) {
352
+ foreach ( $display_columns as $id => $values ) {
353
 
354
  // add items to the list
355
+ $list .= $this->get_box($type, $id, $values);
356
 
357
  }
358
  }
359
 
360
  // custom field button
361
  $button_add_column = '';
362
+ if ( $this->get_meta_by_type($type) )
363
+ $button_add_column = "<a href='javacript:;' class='cpac-add-customfield-column button'>+ " . __('Add Custom Field Column', $this->textdomain) . "</a>";
364
 
365
  return "
366
  <div class='cpac-box'>
368
  {$list}
369
  </ul>
370
  {$button_add_column}
371
+ <div class='cpac-reorder-msg'>" . __('drag and drop to reorder', $this->textdomain) . "</div>
372
  </div>
373
  ";
374
  }
378
  *
379
  * @since 1.0
380
  */
381
+ protected function get_merged_columns( $type )
382
+ {
383
+ /** Comments */
384
+ if ( $type == 'wp-comments' ) {
385
+ $wp_default_columns = $this->get_wp_default_comments_columns();
386
+ $wp_custom_columns = $this->get_custom_comments_columns();
387
+ }
388
+
389
+ /** Links */
390
+ elseif ( $type == 'wp-links' ) {
391
+ $wp_default_columns = $this->get_wp_default_links_columns();
392
+ $wp_custom_columns = $this->get_custom_links_columns();
393
+ }
394
+
395
+ /** Users */
396
+ elseif ( $type == 'wp-users' ) {
397
+ $wp_default_columns = $this->get_wp_default_users_columns();
398
+ $wp_custom_columns = $this->get_custom_users_columns();
399
+ }
400
 
401
+ /** Media */
402
+ elseif ( $type == 'wp-media' ) {
403
+ $wp_default_columns = $this->get_wp_default_media_columns();
404
+ $wp_custom_columns = $this->get_custom_media_columns();
405
+ }
406
+
407
+ /** Posts */
408
+ else {
409
+ $wp_default_columns = $this->get_wp_default_posts_columns($type);
410
+ $wp_custom_columns = $this->get_custom_posts_columns($type);
411
+ }
412
 
413
+ // merge columns
414
+ $display_columns = $this->parse_columns($wp_custom_columns, $wp_default_columns, $type);
415
 
416
+ return $display_columns;
417
+ }
418
+
419
+ /**
420
+ * Merge the default columns (set by WordPress) and the added custom columns (set by plugins, theme etc.)
421
+ *
422
+ * @since 1.3.3
423
+ */
424
+ function parse_columns($wp_custom_columns, $wp_default_columns, $type) {
425
+ // merge columns
426
  $default_columns = wp_parse_args($wp_custom_columns, $wp_default_columns);
427
 
428
+ //get saved database columns
429
+ $db_columns = $this->get_stored_columns($type);
430
  if ( $db_columns ) {
431
+
432
+ // let's remove any unavailable columns.. such as disabled plugins
433
+ $db_columns = $this->remove_unavailable_columns($db_columns, $default_columns);
434
+
435
+ // loop throught the active columns
436
+ foreach ( $db_columns as $id => $values ) {
437
 
438
  // get column meta options from custom columns
439
+ if ( $this->is_column_meta($id) )
440
+ $db_columns[$id]['options'] = $wp_custom_columns['column-meta-1']['options'];
441
 
442
  // add static options
443
+ elseif ( isset($default_columns[$id]['options']) )
444
+ $db_columns[$id]['options'] = $default_columns[$id]['options'];
445
 
446
+ unset($default_columns[$id]);
447
  }
448
  }
449
 
450
  // merge all
451
+ return wp_parse_args($db_columns, $default_columns);
 
 
452
  }
453
+
454
+ /**
455
+ * Remove deactivated (plugin) columns
456
+ *
457
+ * This will remove any columns that have been stored, but are no longer available. This happends
458
+ * when plugins are deactivated or when they are removed from the theme functions.
459
+ *
460
+ * @since 1.2
461
+ */
462
+ private function remove_unavailable_columns( array $db_columns, array $default_columns)
463
+ {
464
+ // check or differences
465
+ $diff = array_diff( array_keys($db_columns), array_keys($default_columns) );
466
+
467
+ if ( ! empty($diff) && is_array($diff) ) {
468
+ foreach ( $diff as $column_name ){
469
+ // make an exception for column-meta-xxx
470
+ if ( ! $this->is_column_meta($column_name) ) {
471
+ unset($db_columns[$column_name]);
472
+ }
473
+ }
474
+ }
475
+
476
+ return $db_columns;
477
+ }
478
+
479
  /**
480
  * Get checkbox
481
  *
482
  * @since 1.0
483
  */
484
+ private function get_box($type, $id, $values)
485
  {
486
  $classes = array();
487
 
488
  // set state
489
  $state = isset($values['state']) ? $values['state'] : '';
490
 
 
 
 
491
  // class
492
+ $classes[] = "cpac-box-{$id}";
493
  if ( $state )
494
  $classes[] = 'active';
495
  if ( ! empty($values['options']['class']) )
497
  $class = implode(' ', $classes);
498
 
499
  // more box options
500
+ $more_options = $this->get_additional_box_options($type, $id, $values);
501
  $action = "<a class='cpac-action' href='#open'>open</a>";
502
+
503
+ // type label
504
+ $type_label = isset($values['options']['type_label']) ? $values['options']['type_label'] : '';
505
+
506
+ // label
507
+ $label = isset($values['label']) ? str_replace("'", '"', $values['label']) : '';
508
+
509
+ // width
510
+ $width = isset($values['width']) ? $values['width'] : 0;
511
+ $width_descr = isset($values['width']) && $values['width'] > 0 ? $values['width'] . '%' : __('default', $this->textdomain);
512
 
513
  // hide box options
514
+ $label_hidden = '';
515
+ if ( ! empty($values['options']['hide_options']) || strpos($label, '<img') !== false ) {
516
+ $label_hidden = ' style="display:none"';
517
  }
518
 
519
  $list = "
520
  <li class='{$class}'>
521
+ <div class='cpac-sort-handle'></div>
522
+ <div class='cpac-type-options'>
 
523
  <div class='cpac-checkbox'></div>
524
+ <input type='hidden' class='cpac-state' name='cpac_options[columns][{$type}][{$id}][state]' value='{$state}'/>
525
+ <label class='main-label'>{$values['label']}</label>
 
526
  </div>
527
  <div class='cpac-meta-title'>
528
  {$action}
529
+ <span>{$type_label}</span>
530
  </div>
531
  <div class='cpac-type-inside'>
532
+ <label for='cpac_options-{$type}-{$id}-label'{$label_hidden}>Label: </label>
533
+ <input type='text' name='cpac_options[columns][{$type}][{$id}][label]' id='cpac_options-{$type}-{$id}-label' value='{$label}' class='text'{$label_hidden}/>
534
+ <label for='cpac_options-{$type}-{$id}-width'>".__('Width', $this->textdomain).":</label>
535
+ <input type='hidden' maxlength='4' class='input-width' name='cpac_options[columns][{$type}][{$id}][width]' id='cpac_options-{$type}-{$id}-width' value='{$width}' />
536
+ <div class='description width-decription' title='".__('default', $this->textdomain)."'>{$width_descr}</div>
537
+ <div class='input-width-range'></div>
538
  <br/>
539
  {$more_options}
540
  </div>
549
  *
550
  * @since 1.0
551
  */
552
+ private function get_additional_box_options($type, $id, $values)
553
  {
554
  $fields = '';
555
 
556
+ // Custom Fields
557
+ if ( $this->is_column_meta($id) )
558
+ $fields = $this->get_box_options_customfields($type, $id, $values);
559
 
560
  return $fields;
561
  }
565
  *
566
  * @since 1.0
567
  */
568
+ private function get_box_options_customfields($type, $id, $values)
569
  {
570
  // get post meta fields
571
+ $fields = $this->get_meta_by_type($type);
572
 
573
  if ( empty($fields) )
574
  return false;
595
  'library_id' => __('Media Library Icon', $this->textdomain),
596
  'excerpt' => __('Excerpt'),
597
  'array' => __('Multiple Values', $this->textdomain),
598
+ 'numeric' => __('Numeric', $this->textdomain),
599
+ 'date' => __('Date', $this->textdomain),
600
+ 'title_by_id' => __('Post Title (Post ID\'s)', $this->textdomain),
601
  );
602
 
603
+ // add filter
604
+ $fieldtypes = apply_filters('cpac-field-types', $fieldtypes );
605
+
606
+ // set select options
607
  foreach ( $fieldtypes as $fkey => $fieldtype ) {
608
  $fieldtype_options .= sprintf
609
  (
614
  );
615
  }
616
 
617
+ // before and after string
618
+ $before = ! empty($values['before']) ? $values['before'] : '' ;
619
+ $after = ! empty($values['after']) ? $values['after'] : '' ;
620
+
621
  if ( empty($field_options) )
622
  return false;
623
 
624
  // add remove button
625
  $remove = '<p class="remove-description description">'.__('This field can not be removed', $this->textdomain).'</p>';
626
+ if ( $id != 'column-meta-1') {
627
  $remove = "
628
  <p>
629
  <a href='javascript:;' class='cpac-delete-custom-field-box'>".__('Remove')."</a>
632
  }
633
 
634
  $inside = "
635
+ <label for='cpac-{$type}-{$id}-field'>Custom Field: </label>
636
+ <select name='cpac_options[columns][{$type}][{$id}][field]' id='cpac-{$type}-{$id}-field'>{$field_options}</select>
637
  <br/>
638
+ <label for='cpac-{$type}-{$id}-field_type'>Field Type: </label>
639
+ <select name='cpac_options[columns][{$type}][{$id}][field_type]' id='cpac-{$type}-{$id}-field_type'>{$fieldtype_options}</select>
640
  <br/>
641
+ <label for='cpac-{$type}-{$id}-before'>Before: </label>
642
+ <input type='text' class='cpac-before' name='cpac_options[columns][{$type}][{$id}][before]' id='cpac-{$type}-{$id}-before' value='{$before}'/>
643
+ <br/>
644
+ <label for='cpac-{$type}-{$id}-after'>After: </label>
645
+ <input type='text' class='cpac-after' name='cpac_options[columns][{$type}][{$id}][after]' id='cpac-{$type}-{$id}-after' value='{$after}'/>
646
+ <br/>
647
  {$remove}
648
  ";
649
 
651
  }
652
 
653
  /**
654
+ * Get post meta fields by type; post(types) or users.
655
  *
656
  * @since 1.0
657
  */
658
+ private function get_meta_by_type($type = 'post')
659
  {
660
  global $wpdb;
661
+
662
+ /** Comments */
663
+ if ( $type == 'wp-comments') {
664
+ $sql = "SELECT DISTINCT meta_key FROM {$wpdb->commentmeta} ORDER BY 1";
665
+ }
666
+
667
+ /** Users */
668
+ elseif ( $type == 'wp-users') {
669
+ $sql = "SELECT DISTINCT meta_key FROM {$wpdb->usermeta} ORDER BY 1";
670
+ }
671
 
672
+ /** Posts */
673
+ else {
674
+ $sql = $wpdb->prepare( "SELECT DISTINCT meta_key FROM {$wpdb->postmeta} pm JOIN {$wpdb->posts} p ON pm.post_id = p.ID WHERE p.post_type = %s ORDER BY 1", $type);
675
+ }
676
+
677
+ // run sql
678
+ $fields = $wpdb->get_results($sql, ARRAY_N);
679
+
680
  // postmeta
681
  if ( $fields ) {
682
  $meta_fields = array();
686
  $meta_fields[] = $field[0];
687
  }
688
  }
 
689
  return $meta_fields;
690
+ }
691
 
692
  return false;
693
  }
697
  *
698
  * @since 1.0
699
  */
700
+ public function admin_scripts()
701
  {
702
+ wp_enqueue_script( 'jquery-ui-slider' );
703
+ wp_enqueue_script( 'cpac-qtip2', $this->plugin_url('/assets/js/jquery.qtip.js'), array('jquery'), CPAC_VERSION );
704
+ wp_enqueue_script( 'cpac-admin', $this->plugin_url('/assets/js/admin-column.js'), array('jquery', 'dashboard', 'jquery-ui-sortable'), CPAC_VERSION );
705
  }
706
+
707
+ /**
708
+ * Get column types
709
+ *
710
+ * @since 1.1
711
+ */
712
+ private function get_types()
713
+ {
714
+ $types = $this->post_types;
715
+ $types['wp-users'] = 'wp-users';
716
+ $types['wp-media'] = 'wp-media';
717
+ $types['wp-links'] = 'wp-links';
718
+ $types['wp-comments'] = 'wp-comments';
719
+
720
+ return $types;
721
+ }
722
+
723
  /**
724
  * Get post types
725
  *
726
  * @since 1.0
727
  */
728
+ protected function get_post_types()
729
  {
730
  $post_types = get_post_types(array(
731
  '_builtin' => false
733
  $post_types['post'] = 'post';
734
  $post_types['page'] = 'page';
735
 
736
+ return apply_filters('cpac-get-post-types', $post_types);
737
  }
738
 
739
  /**
743
  */
744
  public function admin_styles()
745
  {
746
+ wp_enqueue_style( 'jquery-ui-lightness', $this->plugin_url('/assets/ui-theme/jquery-ui-1.8.18.custom.css'), array(), CPAC_VERSION, 'all' );
747
  wp_enqueue_style( 'cpac-admin', $this->plugin_url('/assets/css/admin-column.css'), array(), CPAC_VERSION, 'all' );
748
  }
749
 
765
  public function register_settings()
766
  {
767
  // If we have no options in the database, let's add them now.
768
+ if ( false === get_option('cpac_options') )
769
+ add_option( 'cpac_options', array($this, 'get_default_plugin_options') );
770
 
771
+ register_setting( 'cpac-settings-group', 'cpac_options', array($this, 'options_callback') );
772
  }
773
 
774
  /**
786
  }
787
 
788
  /**
789
+ * Optional callback.
790
  *
791
  * @since 1.0
792
  */
800
  *
801
  * @since 1.0
802
  */
803
+ public function handle_requests()
804
  {
805
  // settings updated
806
+ if ( ! empty($_REQUEST['settings-updated']) )
807
+ $this->store_wp_default_columns();
 
 
 
 
 
 
 
808
 
809
  // restore defaults
810
+ if ( ! empty($_REQUEST['cpac-restore-defaults']) )
811
  $this->restore_defaults();
812
+
813
+ }
814
+
815
+ /**
816
+ * Stores WP default columns
817
+ *
818
+ * This will store columns that are set by WordPress core or
819
+ * set by the theme for page, post(types) and user columns
820
+ *
821
+ * @since 1.2
822
+ */
823
+ private function store_wp_default_columns()
824
+ {
825
+ // stores the default columns that are set by WP or set in the theme.
826
+ $wp_default_columns = array();
827
+
828
+ // Posts
829
+ foreach ( $this->post_types as $post_type ) {
830
+ $wp_default_columns[$post_type] = $this->get_wp_default_posts_columns($post_type);
831
+ }
832
+
833
+ // Users
834
+ $wp_default_columns['wp-users'] = $this->get_wp_default_users_columns();
835
+
836
+ // Media
837
+ $wp_default_columns['wp-media'] = $this->get_wp_default_media_columns();
838
+
839
+ // Links
840
+ $wp_default_columns['wp-links'] = $this->get_wp_default_links_columns();
841
+
842
+ // Comments
843
+ $wp_default_columns['wp-comments'] = $this->get_wp_default_comments_columns();
844
+
845
+ update_option( 'cpac_options_default', $wp_default_columns );
846
  }
847
 
848
  /**
853
  private function restore_defaults()
854
  {
855
  delete_option( 'cpac_options' );
856
+ delete_option( 'cpac_options_default' );
857
  }
858
 
859
  /**
861
  *
862
  * @since 1.0
863
  */
864
+ private function get_post_excerpt($post_id)
865
  {
866
+ global $post;
867
+
868
  $save_post = $post;
869
  $post = get_post($post_id);
870
  $excerpt = get_the_excerpt();
871
  $post = $save_post;
872
 
873
+ $output = $this->get_shortened_string($excerpt, $this->excerpt_length );
874
 
875
  return $output;
876
  }
880
  *
881
  * @since 1.0
882
  */
883
+ private function get_shortened_string($string = '', $num_words = 55, $more = null)
884
  {
885
  if (!$string)
886
  return false;
887
 
888
+ return wp_trim_words( $string, $num_words, $more );
 
 
 
 
 
 
 
 
 
 
889
  }
890
 
891
  /**
893
  *
894
  * @since 1.0
895
  */
896
+ public function manage_posts_column_value($column_name, $post_id)
897
  {
898
+ $type = $column_name;
899
 
900
  // Check for taxonomies, such as column-taxonomy-[taxname]
901
  if ( strpos($type, 'column-taxonomy-') !== false )
902
  $type = 'column-taxonomy';
903
 
904
  // Check for custom fields, such as column-meta-[customfieldname]
905
+ if ( $this->is_column_meta($type) )
906
+ $type = 'column-post-meta';
907
 
908
  // Hook
909
+ do_action('cpac-manage-posts-column', $type, $column_name, $post_id);
910
+
911
  // Switch Types
912
  $result = '';
913
  switch ($type) :
924
 
925
  // Featured Image
926
  case "column-featured_image" :
927
+ if ( has_post_thumbnail($post_id) )
928
+ $result = get_the_post_thumbnail($post_id, array(80,80));
929
  break;
930
 
931
  // Sticky Post
932
  case "column-sticky" :
933
+ if ( is_sticky($post_id) )
934
+ $result = $this->get_asset_image('checkmark.png');
 
 
935
  break;
936
 
937
  // Order
948
  case "column-page-template" :
949
  // file name
950
  $page_template = get_post_meta($post_id, '_wp_page_template', true);
951
+
952
+ // get template nice name
953
+ $result = array_search($page_template, get_page_templates());
 
954
  break;
955
 
956
  // Slug
957
  case "column-page-slug" :
958
+ $result = get_post($post_id)->post_name;
959
+ break;
960
+
961
+ // Slug
962
+ case "column-word-count" :
963
+ $result = str_word_count( $this->strip_trim( get_post($post_id)->post_content ) );
964
  break;
965
 
966
  // Taxonomy
967
  case "column-taxonomy" :
968
+ $tax = str_replace('column-taxonomy-', '', $column_name);
969
  $tags = get_the_terms($post_id, $tax);
970
  $tarr = array();
971
+
972
+ // for post formats we will display standard instead of empty
973
  if ( $tax == 'post_format' && empty($tags) ) {
974
  $result = __('Standard');
975
  }
976
+
977
+ // add name with link
978
+ elseif ( !empty($tags) ) {
979
+ $post_type = get_post_type($post_id);
980
+ foreach($tags as $tag) {
981
+ // sanatize title
982
+ if ( isset($tag->term_id) ) {
983
+ $tax_title = esc_html(sanitize_term_field('name', $tag->name, $tag->term_id, $tag->taxonomy, 'edit'));
984
+ $tarr[] = "<a href='edit.php?post_type={$post_type}&{$tag->taxonomy}={$tag->slug}'>{$tax_title}</a>";
985
+ }
986
  }
987
  $result = implode(', ', $tarr);
988
  }
989
  break;
990
 
991
  // Custom Field
992
+ case "column-post-meta" :
993
+ $result = $this->get_column_value_custom_field($post_id, $column_name, 'post');
994
  break;
995
 
996
  // Attachment
997
  case "column-attachment" :
998
  $result = $this->get_column_value_attachments($post_id);
999
  break;
1000
+
1001
+ // Attachment count
1002
+ case "column-attachment-count" :
1003
+ $result = count($this->get_attachment_ids($post_id));
1004
+ break;
1005
+
1006
+ // Roles
1007
+ case "column-roles" :
1008
+ $user_id = get_post($post_id)->post_author;
1009
+ $userdata = get_userdata( $user_id );
1010
+ if ( !empty($userdata->roles[0]) )
1011
+ echo implode(', ',$userdata->roles);
1012
+ break;
1013
+
1014
+ // Post status
1015
+ case "column-status" :
1016
+ $p = get_post($post_id);
1017
+ $result = $p->post_status;
1018
+ if ( $result == 'future')
1019
+ $result = $result . " <p class='description'>" . date_i18n( get_option('date_format') . ' ' . get_option('time_format') , strtotime($p->post_date) ) . "</p>";
1020
+ break;
1021
+
1022
+ // Post comment status
1023
+ case "column-comment-status" :
1024
+ $p = get_post($post_id);
1025
+ $result = $this->get_asset_image('no.png', $p->comment_status);
1026
+ if ( $p->comment_status == 'open' )
1027
+ $result = $this->get_asset_image('checkmark.png', $p->comment_status);
1028
+ break;
1029
+
1030
+ // Post ping status
1031
+ case "column-ping-status" :
1032
+ $p = get_post($post_id);
1033
+ $result = $this->get_asset_image('no.png', $p->ping_status);
1034
+ if ( $p->ping_status == 'open' )
1035
+ $result = $this->get_asset_image('checkmark.png', $p->ping_status);
1036
+ break;
1037
+
1038
+ // Post actions ( delete, edit etc. )
1039
+ case "column-actions" :
1040
+ $result = $this->get_column_value_actions($post_id, 'posts');
1041
+ break;
1042
 
1043
  default :
1044
+ $result = '';
1045
 
1046
  endswitch;
1047
 
 
 
 
1048
  echo $result;
1049
  }
1050
+
1051
  /**
1052
+ * Manage custom column for Users.
1053
  *
1054
+ * @since 1.1
1055
  */
1056
+ public function manage_users_column_value( $value, $column_name, $user_id )
1057
  {
1058
+ $type = $column_name;
1059
+
1060
+ $userdata = get_userdata( $user_id );
1061
+
1062
+ if ( ! $userdata )
1063
+ return false;
1064
+
1065
+ // Check for user custom fields: column-meta-[customfieldname]
1066
+ if ( $this->is_column_meta($type) )
1067
+ $type = 'column-user-meta';
1068
+
1069
+ // Check for post count: column-user_postcount-[posttype]
1070
+ if ( $this->get_posttype_by_postcount_column($type) )
1071
+ $type = 'column-user_postcount';
1072
+
1073
+ // Hook
1074
+ do_action('cpac-manage-users-column', $type, $column_name, $user_id);
1075
+
1076
  $result = '';
1077
+ switch ($type) :
1078
+
1079
+ // user id
1080
+ case "column-user_id" :
1081
+ $result = $user_id;
1082
+ break;
1083
+
1084
+ // first name
1085
+ case "column-nickname" :
1086
+ $result = $userdata->nickname;
1087
+ break;
1088
+
1089
+ // first name
1090
+ case "column-first_name" :
1091
+ $result = $userdata->first_name;
1092
+ break;
1093
+
1094
+ // last name
1095
+ case "column-last_name" :
1096
+ $result = $userdata->last_name;
1097
+ break;
1098
+
1099
+ // user url
1100
+ case "column-user_url" :
1101
+ $result = $userdata->user_url;
1102
+ break;
1103
+
1104
+ // user registration date
1105
+ case "column-user_registered" :
1106
+ $result = $userdata->user_registered;
1107
+ break;
1108
+
1109
+ // user description
1110
+ case "column-user_description" :
1111
+ $result = $this->get_shortened_string( get_the_author_meta('user_description', $user_id), $this->excerpt_length );
1112
+ break;
1113
+
1114
+ // user description
1115
+ case "column-user_postcount" :
1116
+ $post_type = $this->get_posttype_by_postcount_column($column_name);
1117
+
1118
+ // get post count
1119
+ $count = $this->get_post_count( $post_type, $user_id );
1120
+
1121
+ // set result
1122
+ $result = $count > 0 ? "<a href='edit.php?post_type={$post_type}&author={$user_id}'>{$count}</a>" : (string) $count;
1123
+ break;
1124
+
1125
+ // user actions
1126
+ case "column-actions" :
1127
+ $result = $this->get_column_value_actions($user_id, 'users');
1128
+ break;
1129
+
1130
+ // user meta data ( custom field )
1131
+ case "column-user-meta" :
1132
+ $result = $this->get_column_value_custom_field($user_id, $column_name, 'user');
1133
+ break;
1134
+
1135
+ default :
1136
+ $result = '';
1137
+
1138
+ endswitch;
1139
+
1140
  return $result;
1141
  }
1142
 
1143
  /**
1144
+ * Manage custom column for Media.
1145
  *
1146
+ * @since 1.3
1147
  */
1148
+ public function manage_media_column_value( $column_name, $media_id )
1149
  {
1150
+ $type = $column_name;
 
 
 
 
 
1151
 
1152
+ $meta = wp_get_attachment_metadata($media_id);
1153
+ $p = get_post($media_id);
 
 
 
1154
 
1155
+ // Hook
1156
+ do_action('cpac-manage-media-column', $type, $column_name, $media_id);
 
 
 
 
1157
 
1158
+ $result = '';
1159
+ switch ($type) :
1160
+
1161
+ // media id
1162
+ case "column-mediaid" :
1163
+ $result = $media_id;
1164
+ break;
1165
+
1166
+ // dimensions
1167
+ case "column-dimensions" :
1168
+ if ( !empty($meta['width']) && !empty($meta['height']) )
1169
+ $result = "{$meta['width']} x {$meta['height']}";
1170
+ break;
1171
+
1172
+ // width
1173
+ case "column-width" :
1174
+ $result = !empty($meta['width']) ? $meta['width'] : '';
1175
+ break;
1176
+
1177
+ // height
1178
+ case "column-height" :
1179
+ $result = !empty($meta['height']) ? $meta['height'] : '';
1180
+ break;
1181
+
1182
+ // description
1183
+ case "column-description" :
1184
+ $result = $p->post_content;
1185
  break;
1186
 
1187
+ // caption
1188
+ case "column-caption" :
1189
+ $result = $p->post_excerpt;
1190
+ break;
1191
+
1192
+ // alternate text
1193
+ case "column-alternate_text" :
1194
+ $alt = get_post_meta($media_id, '_wp_attachment_image_alt', true);
1195
+ $result = $this->strip_trim($alt);
1196
+ break;
1197
+
1198
+ // mime type
1199
+ case "column-mime_type" :
1200
+ $result = $p->post_mime_type;
1201
  break;
1202
 
1203
+ // file name
1204
+ case "column-file_name" :
1205
+ $file = wp_get_attachment_url($p->ID);
1206
+ $filename = basename($file);
1207
+ $result = "<a title='{$filename}' href='{$file}'>{$filename}</a>";
1208
  break;
1209
+
1210
+ // file paths
1211
+ case "column-file_paths" :
1212
+ $sizes = get_intermediate_image_sizes();
1213
+ $url = wp_get_attachment_url($p->ID);
1214
+ $filename = basename($url);
1215
+ $paths[] = "<a title='{$filename}' href='{$url}'>" . __('original', $this->textdomain) . "</a>";
1216
+ if ( $sizes ) {
1217
+ foreach ( $sizes as $size ) {
1218
+ $src = wp_get_attachment_image_src( $media_id, $size );
1219
+ if (!empty($src[0])) {
1220
+ $filename = basename($src[0]);
1221
+ $paths[] = "<a title='{$filename}' href='{$src[0]}'>{$size}</a>";
1222
+ }
1223
+ }
1224
+ }
1225
+ $result = implode('<span class="cpac-divider"></span>', $paths);
1226
+ break;
1227
+
1228
+ default :
1229
+ $result = '';
1230
+
1231
+ endswitch;
1232
 
1233
+ echo $result;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1234
  }
1235
+
1236
  /**
1237
+ * Manage custom column for Links
1238
  *
1239
+ * @since 1.3.1
1240
  */
1241
+ public function manage_link_column_value( $column_name, $link_id )
1242
  {
1243
+ $type = $column_name;
1244
 
1245
+ // links object... called bookmark
1246
+ $bookmark = get_bookmark($link_id);
1247
 
1248
+ // Hook
1249
+ do_action('cpac-manage-link-column', $type, $column_name, $link_id);
1250
+
1251
+ $result = '';
1252
+ switch ($type) :
1253
 
1254
+ // link id
1255
+ case "column-link_id" :
1256
+ $result = $link_id;
1257
+ break;
1258
+
1259
+ // description
1260
+ case "column-description" :
1261
+ $result = $bookmark->link_description;
1262
+ break;
1263
+
1264
+ // target
1265
+ case "column-target" :
1266
+ $result = $bookmark->link_target;
1267
+ break;
1268
+
1269
+ // notes
1270
+ case "column-notes" :
1271
+ $result = $this->get_shortened_string($bookmark->link_notes, $this->excerpt_length);
1272
+ break;
1273
+
1274
+ // rss
1275
+ case "column-rss" :
1276
+ $result = $this->get_shorten_url($bookmark->link_rss);
1277
+ break;
1278
 
1279
+ // image
1280
+ case "column-image" :
1281
+ $result = $this->get_thumbnail($bookmark->link_image);
1282
+ break;
1283
+
1284
+ // name length
1285
+ case "column-length" :
1286
+ $result = strlen($bookmark->link_name);
1287
+ break;
1288
+
1289
+ // owner
1290
+ case "column-owner" :
1291
+ $result = $bookmark->link_owner;
1292
+
1293
+ // add user link
1294
+ $userdata = get_userdata( $bookmark->link_owner );
1295
+ if (!empty($userdata->data)) {
1296
+ $result = $userdata->data->user_nicename;
1297
+ //$result = "<a href='user-edit.php?user_id={$bookmark->link_owner}'>{$result}</a>";
1298
+ }
1299
+ break;
1300
+
1301
+ default :
1302
+ $result = '';
1303
+
1304
+ endswitch;
1305
+
1306
+ echo $result;
1307
  }
1308
+
1309
  /**
1310
+ * Manage custom column for Comments
1311
  *
1312
+ * @since 1.3.1
1313
  */
1314
+ public function manage_comments_column_value( $column_name, $comment_id )
1315
  {
1316
+ $type = $column_name;
1317
 
1318
+ // comments object
1319
+ $comment = get_comment($comment_id);
1320
 
1321
+ // Check for custom fields, such as column-meta-[customfieldname]
1322
+ if ( $this->is_column_meta($type) )
1323
+ $type = 'column-comment-meta';
1324
 
1325
+ // Hook
1326
+ do_action('cpac-manage-comments-column', $type, $column_name, $comment_id);
1327
 
1328
+ $result = '';
1329
+ switch ($type) :
1330
+
1331
+ // comment id
1332
+ case "column-comment_id" :
1333
+ $result = $comment_id;
1334
+ break;
1335
+
1336
+ // author
1337
+ case "column-author_author" :
1338
+ $result = $comment->comment_author;
1339
+ break;
1340
+
1341
+ // avatar
1342
+ case "column-author_avatar" :
1343
+ $result = get_avatar( $comment, 80 );
1344
+ break;
1345
+
1346
+ // url
1347
+ case "column-author_url" :
1348
+ $result = $this->get_shorten_url($comment->comment_author_url);
1349
+ break;
1350
+
1351
+ // ip
1352
+ case "column-author_ip" :
1353
+ $result = $comment->comment_author_IP;
1354
+ break;
1355
+
1356
+ // email
1357
+ case "column-author_email" :
1358
+ $result = $comment->comment_author_email;
1359
+ break;
1360
+
1361
+ // parent
1362
+ case "column-reply_to" :
1363
+ if ( $comment->comment_approved ) {
1364
+ $parent = get_comment( $comment->comment_parent );
1365
+ $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
1366
+ $name = get_comment_author( $parent->comment_ID );
1367
+ $result = sprintf( '<a href="%1$s">%2$s</a>', $parent_link, $name );
1368
+ }
1369
+ break;
1370
+
1371
+ // approved
1372
+ case "column-approved" :
1373
+ $result = $this->get_asset_image('no.png');
1374
+ if ( $comment->comment_approved )
1375
+ $result = $this->get_asset_image('checkmark.png');
1376
+ break;
1377
+
1378
+ // date
1379
+ case "column-date" :
1380
+ $comment_url = esc_url( get_comment_link( $comment_id ) );
1381
+ $result = sprintf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ),
1382
+ $comment_url,
1383
+ $this->get_date($comment->comment_date),
1384
+ $this->get_time($comment->comment_date)
1385
+ );
1386
+ $result = "<div class='submitted-on'>{$result}</div>";
1387
+ break;
1388
+
1389
+ // date GMT
1390
+ case "column-date_gmt" :
1391
+ $comment_url = esc_url( get_comment_link( $comment_id ) );
1392
+ $result = sprintf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ),
1393
+ $comment_url,
1394
+ $this->get_date($comment->comment_date_gmt),
1395
+ $this->get_time($comment->comment_date_gmt)
1396
+ );
1397
+ $result = "<div class='submitted-on'>{$result}</div>";
1398
+ break;
1399
+
1400
+ // custom field
1401
+ case "column-comment-meta" :
1402
+ $result = $this->get_column_value_custom_field($comment_id, $column_name, 'comment');
1403
+ break;
1404
+
1405
+ // agent
1406
+ case "column-agent" :
1407
+ $result = $comment->comment_agent;
1408
+ break;
1409
+
1410
+ // excerpt
1411
+ case "column-excerpt" :
1412
+ $comment = get_comment($comment_id);
1413
+ $result = $this->get_shortened_string($comment->comment_content, $this->excerpt_length);
1414
+ break;
1415
+
1416
+ default :
1417
+ $result = '';
1418
+
1419
+ endswitch;
1420
 
1421
+ echo $result;
1422
  }
1423
 
1424
  /**
1425
+ * Get column value of post attachments
1426
  *
1427
  * @since 1.0
1428
  */
1429
+ private function get_column_value_attachments( $post_id )
1430
  {
1431
+ $result = '';
1432
+ $attachment_ids = $this->get_attachment_ids($post_id);
1433
+ if ( $attachment_ids ) {
1434
+ foreach ( $attachment_ids as $attach_id ) {
1435
+ if ( wp_get_attachment_image($attach_id) )
1436
+ $result .= wp_get_attachment_image( $attach_id, array(80,80), true );
 
 
 
 
 
 
 
1437
  }
1438
+ }
1439
+ return $result;
1440
+ }
1441
+
1442
  /**
1443
+ * Get column value of post actions
1444
  *
1445
+ * This part has been taken from the following classes
1446
+ * Posts List Table
1447
+ *
1448
+ *
1449
+ * @since 1.4.2
1450
  */
1451
+ private function get_column_value_actions( $id, $type = 'posts' )
1452
+ {
1453
+ $actions = array();
1454
+
1455
+ /** Posts */
1456
+ if ( $type == 'posts') {
1457
+ $post_id = $id;
1458
+ $post = get_post($post_id);
1459
+ $title = _draft_or_post_title();
1460
+ $post_type_object = get_post_type_object( $post->post_type );
1461
+ $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
1462
+
1463
+ if ( $can_edit_post && 'trash' != $post->post_status ) {
1464
+ $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
1465
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
1466
+ }
1467
+ if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
1468
+ if ( 'trash' == $post->post_status )
1469
+ $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>";
1470
+ elseif ( EMPTY_TRASH_DAYS )
1471
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
1472
+ if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
1473
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
1474
+ }
1475
+ if ( $post_type_object->public ) {
1476
+ if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
1477
+ if ( $can_edit_post )
1478
+ $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>';
1479
+ } elseif ( 'trash' != $post->post_status ) {
1480
+ $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
1481
+ }
1482
+ }
1483
+ }
1484
 
1485
+ /** Users */
1486
+ elseif ( $type == 'users' ) {
 
 
 
1487
 
1488
+ $user_object = new WP_User( $id );
1489
+ $screen = get_current_screen();
1490
+
1491
+ if ( 'site-users-network' == $screen->id )
1492
+ $url = "site-users.php?id={$this->site_id}&amp;";
1493
+ else
1494
+ $url = 'users.php?';
1495
+
1496
+ if ( get_current_user_id() == $user_object->ID ) {
1497
+ $edit_link = 'profile.php';
1498
+ } else {
1499
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ) );
1500
+ }
1501
+
1502
+ if ( current_user_can( 'edit_user', $user_object->ID ) ) {
1503
+ $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
1504
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
1505
+ } else {
1506
+ $edit = "<strong>$user_object->user_login</strong><br />";
1507
  }
1508
 
1509
+ if ( !is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) )
1510
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . "</a>";
1511
+ if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) )
1512
+ $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>";
 
 
 
 
 
1513
  }
1514
 
1515
+ return implode(' | ', $actions);
 
 
 
1516
  }
1517
+
1518
  /**
1519
+ * Get column value of post attachments
1520
  *
1521
+ * @since 1.2.1
1522
  */
1523
+ protected function get_attachment_ids( $post_id )
1524
  {
1525
+ return get_posts(array(
1526
+ 'post_type' => 'attachment',
1527
+ 'numberposts' => -1,
1528
+ 'post_status' => null,
1529
+ 'post_parent' => $post_id,
1530
+ 'fields' => 'ids'
1531
+ ));
1532
+ }
1533
+
1534
+ /**
1535
+ * Get post count
1536
+ *
1537
+ * @since 1.3.1
1538
+ */
1539
+ protected function get_post_count( $post_type, $user_id )
1540
+ {
1541
+ if ( ! post_type_exists($post_type) || ! get_userdata($user_id) )
1542
+ return false;
1543
 
1544
+ $user_posts = get_posts(array(
1545
+ 'post_type' => $post_type,
1546
+ 'numberposts' => -1,
1547
+ 'author' => $user_id,
1548
+ 'post_status' => 'publish'
1549
+ ));
1550
+ return count($user_posts);
1551
+ }
1552
+
1553
+ /**
1554
+ * Get image from assets folder
1555
+ *
1556
+ * @since 1.3.1
1557
+ */
1558
+ protected function get_asset_image($name = '', $title = '')
1559
+ {
1560
+ if ( $name )
1561
+ return sprintf("<img alt='' src='%s' title='%s'/>", $this->plugin_url("assets/images/{$name}"), $title);
1562
+ }
1563
+
1564
+ /**
1565
+ * Shorten URL
1566
+ *
1567
+ * @since 1.3.1
1568
+ */
1569
+ protected function get_shorten_url($url = '')
1570
+ {
1571
+ if ( !$url )
1572
+ return false;
1573
+
1574
+ // shorten url
1575
+ $short_url = url_shorten( $url );
1576
 
1577
+ return "<a title='{$url}' href='{$url}'>{$short_url}</a>";
1578
+ }
1579
+ /**
1580
+ * Get column value of Custom Field
1581
+ *
1582
+ * @since 1.0
1583
+ */
1584
+ protected function get_column_value_custom_field($object_id, $column_name, $meta_type = 'post')
1585
+ {
1586
+ /** Users */
1587
+ if ( $meta_type == 'user' ) {
1588
+ $type = 'wp-users';
1589
  }
1590
 
1591
+ /** Posts */
1592
+ else {
1593
+ $type = get_post_type($object_id);
 
 
 
 
 
1594
  }
1595
 
1596
+ // get column
1597
+ $columns = $this->get_stored_columns($type);
 
 
 
 
 
 
 
1598
 
1599
+ // inputs
1600
+ $field = isset($columns[$column_name]['field']) ? $columns[$column_name]['field'] : '';
1601
+ $fieldtype = isset($columns[$column_name]['field_type']) ? $columns[$column_name]['field_type'] : '';
1602
+ $before = isset($columns[$column_name]['before']) ? $columns[$column_name]['before'] : '';
1603
+ $after = isset($columns[$column_name]['after']) ? $columns[$column_name]['after'] : '';
 
 
 
 
 
1604
 
1605
+ // Get meta field value
1606
+ $meta = get_metadata($meta_type, $object_id, $field, true);
1607
+
1608
+ // multiple meta values
1609
+ if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
1610
+ $meta = get_metadata($meta_type, $object_id, $field, true);
1611
+ $meta = $this->recursive_implode(', ', $meta);
 
 
1612
  }
1613
 
1614
+ // make sure there are no serialized arrays or empty meta data
1615
+ if ( empty($meta) || !is_string($meta) )
1616
+ return false;
1617
+
1618
+ // handles each field type differently..
1619
+ switch ($fieldtype) :
 
 
 
1620
 
1621
+ // Image
1622
+ case "image" :
1623
+ $meta = $this->get_thumbnail($meta);
1624
+ break;
1625
+
1626
+ // Media Library ID
1627
+ case "library_id" :
1628
+ $meta = $this->get_media_thumbnails($meta);
1629
+ break;
1630
+
1631
+ // Excerpt
1632
+ case "excerpt" :
1633
+ $meta = $this->get_shortened_string($meta, $this->excerpt_length);
1634
+ break;
1635
+
1636
+ // Date
1637
+ case "date" :
1638
+ $meta = $this->get_date($meta);
1639
+ break;
1640
+
1641
+ // Title
1642
+ case "title_by_id" :
1643
+ $titles = $this->get_custom_field_value_title($meta);
1644
+ if ( $titles )
1645
+ $meta = $titles;
1646
+ break;
1647
+
1648
+ endswitch;
1649
+
1650
+ // add before and after string
1651
+ $meta = "{$before}{$meta}{$after}";
1652
+
1653
+ return $meta;
1654
+ }
1655
+
1656
+ /**
1657
+ * Get custom field value 'Title by ID'
1658
+ *
1659
+ * @since 1.3
1660
+ */
1661
+ private function get_custom_field_value_title($meta)
1662
+ {
1663
+ //remove white spaces and strip tags
1664
+ $meta = $this->strip_trim( str_replace(' ','', $meta) );
1665
+
1666
+ // var
1667
+ $ids = $titles = array();
1668
+
1669
+ // check for multiple id's
1670
+ if ( strpos($meta, ',') !== false )
1671
+ $ids = explode(',',$meta);
1672
+ elseif ( is_numeric($meta) )
1673
+ $ids[] = $meta;
1674
+
1675
+ // display title with link
1676
+ if ( $ids && is_array($ids) ) {
1677
+ foreach ( $ids as $id ) {
1678
+ $title = is_numeric($id) ? get_the_title($id) : '';
1679
+ $link = get_edit_post_link($id);
1680
+ if ( $title )
1681
+ $titles[] = $link ? "<a href='{$link}'>{$title}</a>" : $title;
1682
  }
1683
  }
1684
 
1685
+ return implode('<span class="cpac-divider"></span>', $titles);
1686
+ }
1687
+
1688
+ /**
1689
+ * Get column value of Custom Field
1690
+ *
1691
+ * @since 1.2
1692
+ */
1693
+ private function get_user_column_value_custom_field($user_id, $id)
1694
+ {
1695
+ $columns = $this->get_stored_columns('wp-users');
1696
 
1697
+ // inputs
1698
+ $field = isset($columns[$id]['field']) ? $columns[$id]['field'] : '';
1699
+ $fieldtype = isset($columns[$id]['field_type']) ? $columns[$id]['field_type'] : '';
1700
+ $before = isset($columns[$id]['before']) ? $columns[$id]['before'] : '';
1701
+ $after = isset($columns[$id]['after']) ? $columns[$id]['after'] : '';
 
 
 
1702
 
1703
+ // Get meta field value
1704
+ $meta = get_user_meta($user_id, $field, true);
 
 
 
 
 
 
1705
 
1706
+ // multiple meta values
1707
+ if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
1708
+ $meta = get_user_meta($user_id, $field);
1709
+ $meta = $this->recursive_implode(', ', $meta);
1710
+ }
1711
+
1712
+ // make sure there are no serialized arrays or empty meta data
1713
+ if ( empty($meta) || !is_string($meta) )
1714
+ return false;
1715
+
1716
+ // handles each field type differently..
1717
+ switch ($fieldtype) :
1718
+
1719
+ // Image
1720
+ case "image" :
1721
+ $meta = $this->get_thumbnail($meta);
1722
+ break;
1723
+
1724
+ // Media Library ID
1725
+ case "library_id" :
1726
+ $meta = $this->get_media_thumbnails($meta);
1727
+ break;
1728
+
1729
+ // Excerpt
1730
+ case "excerpt" :
1731
+ $meta = $this->get_shortened_string($meta, $this->excerpt_length);
1732
+ break;
1733
+
1734
+ endswitch;
1735
+
1736
+ // add before and after string
1737
+ $meta = "{$before}{$meta}{$after}";
1738
 
1739
+ return $meta;
1740
  }
1741
 
1742
  /**
1743
+ * Implode for multi dimensional array
1744
  *
1745
+ * @since 1.0
1746
  */
1747
+ private function recursive_implode( $glue, $pieces )
1748
+ {
1749
+ foreach( $pieces as $r_pieces ) {
1750
+ if( is_array( $r_pieces ) ) {
1751
+ $retVal[] = $this->recursive_implode( $glue, $r_pieces );
1752
+ }
1753
+ else {
1754
+ $retVal[] = $r_pieces;
1755
+ }
1756
+ }
1757
+ if ( isset($retVal) && is_array($retVal) )
1758
+ return implode( $glue, $retVal );
1759
 
1760
  return false;
1761
+ }
1762
 
1763
  /**
1764
+ * Get WP default supported admin columns per post type.
1765
  *
1766
+ * @since 1.0
1767
  */
1768
+ private function get_wp_default_posts_columns($post_type = 'post')
1769
  {
1770
+ // load dependencies
 
 
1771
 
1772
+ // deprecated as of wp3.3
1773
+ if ( file_exists(ABSPATH . 'wp-admin/includes/template.php') )
1774
+ require_once(ABSPATH . 'wp-admin/includes/template.php');
 
 
 
 
 
 
1775
 
1776
+ // introduced since wp3.3
1777
+ if ( file_exists(ABSPATH . 'wp-admin/includes/screen.php') )
1778
+ require_once(ABSPATH . 'wp-admin/includes/screen.php');
1779
 
1780
+ // used for getting columns
1781
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
1782
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
1783
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php') )
1784
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php');
1785
+
1786
+ // some plugins depend on settings the $_GET['post_type'] variable such as ALL in One SEO
1787
+ $_GET['post_type'] = $post_type;
1788
+
1789
+ // for 3rd party plugin support we will call load-edit.php so all the
1790
+ // additional columns that are set by them will be avaible for us
1791
+ do_action('load-edit.php');
1792
+
1793
+ // we need to change the current screen
1794
+ global $current_screen;
1795
+ $org_current_screen = $current_screen;
1796
+
1797
+ // overwrite current_screen global with our post type of choose...
1798
+ $current_screen->post_type = $post_type;
1799
+
1800
+ // ...so we can get its columns
1801
+ $columns = WP_Posts_List_Table::get_columns();
1802
+
1803
+ if ( empty ( $columns ) )
1804
+ return false;
1805
+
1806
+ // change to uniform format
1807
+ $posts_columns = $this->get_uniform_format($columns);
1808
 
1809
+ // reset current screen
1810
+ $current_screen = $org_current_screen;
1811
+
1812
+ return $posts_columns;
 
 
 
1813
  }
1814
+
1815
+ /**
1816
+ * Get WP default users columns per post type.
1817
+ *
1818
+ * @since 1.1
1819
+ */
1820
+ private function get_wp_default_users_columns()
1821
+ {
1822
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
1823
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
1824
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php') )
1825
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php');
1826
+
1827
+ // turn off site users
1828
+ $this->is_site_users = false;
1829
+
1830
+ // get users columns
1831
+ $columns = WP_Users_List_Table::get_columns();
1832
+
1833
+ // change to uniform format
1834
+ $columns = $this->get_uniform_format($columns);
1835
+
1836
+ // add sorting to some of the default links columns
1837
+ $columns = $this->set_sorting_to_default_users_columns($columns);
1838
 
1839
+ return apply_filters('cpac-default-users-columns', $columns);
1840
+ }
1841
+
1842
  /**
1843
+ * Add Sorting to WP default Users columns
1844
  *
1845
+ * @since 1.4
1846
  */
1847
+ private function set_sorting_to_default_users_columns($columns)
1848
  {
1849
+ // Comment
1850
+ if ( !empty($columns['role']) ) {
1851
+ $columns['role']['options']['sortorder'] = 'on';
1852
+ }
1853
+ return $columns;
1854
+ }
1855
 
1856
+ /**
1857
+ * Get WP default media columns.
1858
+ *
1859
+ * @since 1.2.1
1860
+ */
1861
+ private function get_wp_default_media_columns()
1862
+ {
1863
+ // could use _get_list_table('WP_Media_List_Table') ?
1864
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
1865
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
1866
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php') )
1867
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php');
1868
 
1869
+ global $current_screen;
1870
+ $org_current_screen = $current_screen;
 
1871
 
1872
+ // overwrite current_screen global with our media id...
1873
+ $current_screen->id = 'upload';
1874
 
1875
+ // init media class
1876
+ $wp_media = new WP_Media_List_Table;
 
 
 
1877
 
1878
+ // get media columns
1879
+ $columns = $wp_media->get_columns();
 
 
1880
 
1881
+ // reset current screen
1882
+ $current_screen = $org_current_screen;
1883
+
1884
+ // change to uniform format
1885
+ return $this->get_uniform_format($columns);
1886
  }
1887
+
1888
+ /**
1889
+ * Get WP default links columns.
1890
+ *
1891
+ * @since 1.3.1
1892
+ */
1893
+ private function get_wp_default_links_columns()
1894
+ {
1895
+ // dependencies
1896
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
1897
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
1898
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-links-list-table.php') )
1899
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-links-list-table.php');
1900
+
1901
+ // get links columns
1902
+ $columns = WP_Links_List_Table::get_columns();
1903
 
1904
+ // change to uniform format
1905
+ $columns = $this->get_uniform_format($columns);
1906
+
1907
+ // add sorting to some of the default links columns
1908
+ $columns = $this->set_sorting_to_default_links_columns($columns);
1909
+
1910
+ return apply_filters('cpac-default-links-columns', $columns);
1911
+ }
1912
+
1913
  /**
1914
+ * Add Sorting to WP default links columns
1915
  *
1916
+ * @since 1.4
1917
  */
1918
+ private function set_sorting_to_default_links_columns($columns)
1919
  {
1920
+ // Relationship
1921
+ if ( !empty($columns['rel']) ) {
1922
+ $columns['rel']['options']['sortorder'] = 'on';
1923
+ }
1924
+ return $columns;
1925
+ }
1926
+
1927
+ /**
1928
+ * Get WP default links columns.
1929
+ *
1930
+ * @since 1.3.1
1931
+ */
1932
+ private function get_wp_default_comments_columns()
1933
+ {
1934
+ // dependencies
1935
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
1936
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
1937
+ if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php') )
1938
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php');
1939
+
1940
+ global $current_screen;
1941
+ $org_current_screen = $current_screen;
1942
+
1943
+ // overwrite current_screen global with our media id...
1944
+ $current_screen->id = 'edit-comments';
1945
+
1946
+ // init table object
1947
+ $wp_comment = new WP_Comments_List_Table;
1948
+
1949
+ // get comments
1950
+ $columns = $wp_comment->get_columns();
1951
+
1952
+ // reset current screen
1953
+ $current_screen = $org_current_screen;
1954
+
1955
+ // change to uniform format
1956
+ $columns = $this->get_uniform_format($columns);
1957
+
1958
+ // add sorting to some of the default links columns
1959
+ $columns = $this->set_sorting_to_default_comments_columns($columns);
1960
+
1961
+ return apply_filters('cpac-default-comments-columns', $columns);
1962
+ }
1963
+
1964
+ /**
1965
+ * Add Sorting to WP default comments columns
1966
+ *
1967
+ * @since 1.4
1968
+ */
1969
+ private function set_sorting_to_default_comments_columns($columns)
1970
+ {
1971
+ // Comment
1972
+ if ( !empty($columns['comment']) ) {
1973
+ $columns['comment']['options']['sortorder'] = 'on';
1974
+ }
1975
+ return $columns;
1976
  }
1977
 
1978
  /**
1979
+ * Build uniform format for all columns
1980
  *
1981
  * @since 1.0
1982
  */
1983
+ private function get_uniform_format($columns)
1984
  {
1985
+ // we remove the checkbox column as an option...
1986
+ if ( isset($columns['cb']) )
1987
+ unset($columns['cb']);
1988
+
1989
+ // change to uniform format
1990
+ $uniform_columns = array();
1991
+ foreach ( (array) $columns as $id => $label ) {
1992
+ $hide_options = false;
1993
+ $type_label = $label;
1994
 
1995
+ // comment exception
1996
+ if ( strpos( $label, 'comment-grey-bubble.png') ) {
1997
+ $type_label = __('Comments', $this->textdomain);
1998
+ $hide_options = true;
1999
+ }
2000
+
2001
+ // user icon excerption
2002
+ if ( $id == 'icon' ) {
2003
+ $type_label = __('Icon', $this->textdomain);
2004
+ }
2005
+
2006
+ $uniform_colums[$id] = array(
2007
+ 'label' => $label,
2008
+ 'state' => 'on',
2009
+ 'options' => array(
2010
+ 'type_label' => $type_label,
2011
+ 'hide_options' => $hide_options,
2012
+ 'class' => 'cpac-box-wp-native',
2013
+ )
2014
+ );
2015
+ }
2016
+ return $uniform_colums;
2017
+ }
2018
+
2019
+ /**
2020
+ * Custom posts columns
2021
+ *
2022
+ * @since 1.0
2023
+ */
2024
+ private function get_custom_posts_columns($post_type)
2025
+ {
2026
+ $custom_columns = array(
2027
+ 'column-featured_image' => array(
2028
+ 'label' => __('Featured Image', $this->textdomain)
2029
+ ),
2030
+ 'column-excerpt' => array(
2031
+ 'label' => __('Excerpt', $this->textdomain)
2032
+ ),
2033
+ 'column-order' => array(
2034
+ 'label' => __('Page Order', $this->textdomain)
2035
+ ),
2036
+ 'column-post_formats' => array(
2037
+ 'label' => __('Post Format', $this->textdomain)
2038
+ ),
2039
+ 'column-postid' => array(
2040
+ 'label' => __('ID', $this->textdomain)
2041
+ ),
2042
+ 'column-page-slug' => array(
2043
+ 'label' => __('Slug', $this->textdomain)
2044
+ ),
2045
+ 'column-attachment' => array(
2046
+ 'label' => __('Attachment', $this->textdomain)
2047
+ ),
2048
+ 'column-attachment-count' => array(
2049
+ 'label' => __('No. of Attachments', $this->textdomain)
2050
+ ),
2051
+ 'column-roles' => array(
2052
+ 'label' => __('Roles', $this->textdomain)
2053
+ ),
2054
+ 'column-status' => array(
2055
+ 'label' => __('Status', $this->textdomain)
2056
+ ),
2057
+ 'column-comment-status' => array(
2058
+ 'label' => __('Comment status', $this->textdomain)
2059
+ ),
2060
+ 'column-ping-status' => array(
2061
+ 'label' => __('Ping status', $this->textdomain)
2062
+ ),
2063
+ 'column-actions' => array(
2064
+ 'label' => __('Actions', $this->textdomain),
2065
+ 'options' => array(
2066
+ 'sortorder' => false
2067
+ )
2068
+ )
2069
+ );
2070
+
2071
+ // Word count support
2072
+ if ( post_type_supports($post_type, 'editor') ) {
2073
+ $custom_columns['column-word-count'] = array(
2074
+ 'label' => __('Word count', $this->textdomain)
2075
+ );
2076
+ }
2077
+
2078
+ // Sticky support
2079
+ if ( $post_type == 'post' ) {
2080
+ $custom_columns['column-sticky'] = array(
2081
+ 'label' => __('Sticky', $this->textdomain)
2082
+ );
2083
+ }
2084
+
2085
+ // Order support
2086
+ if ( post_type_supports($post_type, 'page-attributes') ) {
2087
+ $custom_columns['column-order'] = array(
2088
+ 'label' => __('Page Order', $this->textdomain),
2089
+ 'options' => array(
2090
+ 'type_label' => __('Order', $this->textdomain)
2091
+ )
2092
+ );
2093
+ }
2094
+
2095
+ // Page Template
2096
+ if ( $post_type == 'page' ) {
2097
+ $custom_columns['column-page-template'] = array(
2098
+ 'label' => __('Page Template', $this->textdomain)
2099
+ );
2100
+ }
2101
+
2102
+ // Post Formats
2103
+ if ( post_type_supports($post_type, 'post-formats') ) {
2104
+ $custom_columns['column-post_formats'] = array(
2105
+ 'label' => __('Post Format', $this->textdomain)
2106
+ );
2107
+ }
2108
+
2109
+ // Taxonomy support
2110
+ $taxonomies = get_object_taxonomies($post_type, 'objects');
2111
+ if ( $taxonomies ) {
2112
+ foreach ( $taxonomies as $tax_slug => $tax ) {
2113
+ if ( $tax_slug != 'post_tag' && $tax_slug != 'category' && $tax_slug != 'post_format' ) {
2114
+ $custom_columns['column-taxonomy-'.$tax->name] = array(
2115
+ 'label' => $tax->label,
2116
+ 'show_filter' => true,
2117
+ 'options' => array(
2118
+ 'type_label' => __('Taxonomy', $this->textdomain)
2119
+ )
2120
+ );
2121
  }
2122
  }
2123
+ }
2124
+
2125
+ // Custom Field support
2126
+ if ( $this->get_meta_by_type($post_type) ) {
2127
+ $custom_columns['column-meta-1'] = array(
2128
+ 'label' => __('Custom Field', $this->textdomain),
2129
+ 'field' => '',
2130
+ 'field_type' => '',
2131
+ 'before' => '',
2132
+ 'after' => '',
2133
+ 'options' => array(
2134
+ 'type_label' => __('Field', $this->textdomain),
2135
+ 'class' => 'cpac-box-metafield'
2136
+ )
2137
+ );
2138
+ }
2139
+
2140
+ // merge with defaults
2141
+ $custom_columns = $this->parse_defaults($custom_columns);
2142
+
2143
+ return apply_filters('cpac-custom-posts-columns', $custom_columns);
2144
+ }
2145
+
2146
  /**
2147
+ * Custom users columns
2148
  *
2149
+ * @since 1.1
2150
+ */
2151
+ private function get_custom_users_columns()
2152
+ {
2153
+ $custom_columns = array(
2154
+ 'column-user_id' => array(
2155
+ 'label' => __('User ID', $this->textdomain)
2156
+ ),
2157
+ 'column-nickname' => array(
2158
+ 'label' => __('Nickname', $this->textdomain)
2159
+ ),
2160
+ 'column-first_name' => array(
2161
+ 'label' => __('First name', $this->textdomain)
2162
+ ),
2163
+ 'column-last_name' => array(
2164
+ 'label' => __('Last name', $this->textdomain)
2165
+ ),
2166
+ 'column-user_url' => array(
2167
+ 'label' => __('Url', $this->textdomain)
2168
+ ),
2169
+ 'column-user_registered' => array(
2170
+ 'label' => __('Registered', $this->textdomain)
2171
+ ),
2172
+ 'column-user_description' => array(
2173
+ 'label' => __('Description', $this->textdomain)
2174
+ ),
2175
+ 'column-actions' => array(
2176
+ 'label' => __('Actions', $this->textdomain),
2177
+ 'options' => array(
2178
+ 'sortorder' => false
2179
+ )
2180
+ ),
2181
+ );
2182
+
2183
+ // User total number of posts
2184
+ if ($this->get_post_types()) {
2185
+ foreach ( $this->get_post_types() as $post_type ) {
2186
+ $label = $this->get_plural_name($post_type);
2187
+ $custom_columns['column-user_postcount-'.$post_type] = array(
2188
+ 'label' => __( sprintf('No. of %s',$label), $this->textdomain),
2189
+ 'options' => array(
2190
+ 'type_label' => __('Postcount', $this->textdomain)
2191
+ )
2192
+ );
2193
+ }
2194
+ }
2195
+
2196
+ // Custom Field support
2197
+ $custom_columns['column-meta-1'] = array(
2198
+ 'label' => __('Custom Field', $this->textdomain),
2199
+ 'field' => '',
2200
+ 'field_type' => '',
2201
+ 'before' => '',
2202
+ 'after' => '',
2203
+ 'options' => array(
2204
+ 'type_label' => __('Field', $this->textdomain),
2205
+ 'class' => 'cpac-box-metafield'
2206
+ )
2207
+ );
2208
+
2209
+ // merge with defaults
2210
+ $custom_columns = $this->parse_defaults($custom_columns);
2211
+
2212
+ return apply_filters('cpac-custom-users-columns', $custom_columns);
2213
+ }
2214
+
2215
+ /**
2216
+ * Custom media columns
2217
  *
2218
+ * @since 1.3
2219
  */
2220
+ private function get_custom_media_columns()
2221
+ {
2222
+ $custom_columns = array(
2223
+ 'column-mediaid' => array(
2224
+ 'label' => __('ID', $this->textdomain)
2225
+ ),
2226
+ 'column-mime_type' => array(
2227
+ 'label' => __('Mime type', $this->textdomain)
2228
+ ),
2229
+ 'column-file_name' => array(
2230
+ 'label' => __('File name', $this->textdomain)
2231
+ ),
2232
+ 'column-dimensions' => array(
2233
+ 'label' => __('Dimensions', $this->textdomain)
2234
+ ),
2235
+ 'column-height' => array(
2236
+ 'label' => __('Height', $this->textdomain)
2237
+ ),
2238
+ 'column-width' => array(
2239
+ 'label' => __('Width', $this->textdomain)
2240
+ ),
2241
+ 'column-caption' => array(
2242
+ 'label' => __('Caption', $this->textdomain)
2243
+ ),
2244
+ 'column-description' => array(
2245
+ 'label' => __('Description', $this->textdomain)
2246
+ ),
2247
+ 'column-alternate_text' => array(
2248
+ 'label' => __('Alt', $this->textdomain)
2249
+ ),
2250
+ 'column-file_paths' => array(
2251
+ 'label' => __('Upload paths', $this->textdomain),
2252
+ 'options' => array(
2253
+ 'sortorder' => false
2254
+ )
2255
+ ),
2256
+ );
2257
+
2258
+ // merge with defaults
2259
+ $custom_columns = $this->parse_defaults($custom_columns);
2260
+
2261
+ return apply_filters('cpac-custom-media-columns', $custom_columns);
2262
  }
2263
 
2264
  /**
2265
+ * Custom links columns
2266
  *
2267
+ * @since 1.3.1
2268
  */
2269
+ private function get_custom_links_columns()
2270
+ {
2271
+ $custom_columns = array(
2272
+ 'column-link_id' => array (
2273
+ 'label' => __('ID', $this->textdomain)
2274
+ ),
2275
+ 'column-description' => array (
2276
+ 'label' => __('Description', $this->textdomain)
2277
+ ),
2278
+ 'column-image' => array(
2279
+ 'label' => __('Image', $this->textdomain)
2280
+ ),
2281
+ 'column-target' => array(
2282
+ 'label' => __('Target', $this->textdomain)
2283
+ ),
2284
+ 'column-owner' => array(
2285
+ 'label' => __('Owner', $this->textdomain)
2286
+ ),
2287
+ 'column-notes' => array(
2288
+ 'label' => __('Notes', $this->textdomain)
2289
+ ),
2290
+ 'column-rss' => array(
2291
+ 'label' => __('Rss', $this->textdomain)
2292
+ ),
2293
+ 'column-length' => array(
2294
+ 'label' => __('Length', $this->textdomain)
2295
+ )
2296
+ );
2297
+
2298
+ // merge with defaults
2299
+ $custom_columns = $this->parse_defaults($custom_columns);
2300
+
2301
+ return apply_filters('cpac-custom-links-columns', $custom_columns);
2302
  }
2303
 
2304
  /**
2305
+ * Custom comments columns
2306
  *
2307
+ * @since 1.3.1
2308
  */
2309
+ private function get_custom_comments_columns()
2310
+ {
2311
+ $custom_columns = array(
2312
+ 'column-comment_id' => array(
2313
+ 'label' => __('ID', $this->textdomain)
2314
+ ),
2315
+ 'column-author_author' => array(
2316
+ 'label' => __('Author Name', $this->textdomain)
2317
+ ),
2318
+ 'column-author_avatar' => array(
2319
+ 'label' => __('Avatar', $this->textdomain)
2320
+ ),
2321
+ 'column-author_url' => array(
2322
+ 'label' => __('Author url', $this->textdomain)
2323
+ ),
2324
+ 'column-author_ip' => array(
2325
+ 'label' => __('Author IP', $this->textdomain)
2326
+ ),
2327
+ 'column-author_email' => array(
2328
+ 'label' => __('Author email', $this->textdomain)
2329
+ ),
2330
+ 'column-reply_to' => array(
2331
+ 'label' => __('In Reply To', $this->textdomain),
2332
+
2333
+ // options
2334
+ 'options' => array(
2335
+ 'sortorder' => false
2336
+ )
2337
+ ),
2338
+ 'column-approved' => array(
2339
+ 'label' => __('Approved', $this->textdomain)
2340
+ ),
2341
+ 'column-date' => array(
2342
+ 'label' => __('Date', $this->textdomain)
2343
+ ),
2344
+ 'column-date_gmt' => array(
2345
+ 'label' => __('Date GMT', $this->textdomain)
2346
+ ),
2347
+ 'column-agent' => array(
2348
+ 'label' => __('Agent', $this->textdomain)
2349
+ ),
2350
+ 'column-excerpt' => array(
2351
+ 'label' => __('Excerpt', $this->textdomain)
2352
+ )
2353
+ );
2354
 
2355
+ // Custom Field support
2356
+ if ( $this->get_meta_by_type('wp-comments') ) {
2357
+ $custom_columns['column-meta-1'] = array(
2358
+ 'label' => __('Custom Field', $this->textdomain),
2359
+ 'field' => '',
2360
+ 'field_type' => '',
2361
+ 'before' => '',
2362
+ 'after' => '',
2363
+ 'options' => array(
2364
+ 'type_label' => __('Field', $this->textdomain),
2365
+ 'class' => 'cpac-box-metafield',
2366
+ 'sortorder' => false,
2367
+ )
2368
+ );
2369
+ }
2370
+
2371
+ // merge with defaults
2372
+ $custom_columns = $this->parse_defaults($custom_columns);
2373
+
2374
+ return apply_filters('cpac-custom-comments-columns', $custom_columns);
2375
+ }
2376
+
2377
+ /**
2378
+ * Parse defaults
2379
+ *
2380
+ * @since 1.1
2381
+ */
2382
+ private function parse_defaults($columns)
2383
+ {
2384
+ // default arguments
2385
+ $defaults = array(
2386
+
2387
+ // stored values
2388
+ 'label' => '',
2389
+ 'state' => '',
2390
+ 'width' => '',
2391
+
2392
+ // static values
2393
+ 'options' => array(
2394
+ 'type_label' => __('Custom', $this->textdomain),
2395
+ 'hide_options' => false,
2396
+ 'class' => 'cpac-box-custom',
2397
+ 'sortorder' => 'on',
2398
+ )
2399
+ );
2400
+
2401
+ // parse args
2402
+ foreach ( $columns as $k => $column ) {
2403
+ $c[$k] = wp_parse_args( $column, $defaults);
2404
+
2405
+ // parse options args
2406
+ if ( isset($column['options']) )
2407
+ $c[$k]['options'] = wp_parse_args( $column['options'], $defaults['options']);
2408
+
2409
+ // set type label
2410
+ if ( empty($column['options']['type_label']) && !empty($column['label']) )
2411
+ $c[$k]['options']['type_label'] = $column['label'];
2412
+ }
2413
+
2414
+ return $c;
2415
+ }
2416
+
2417
+ /**
2418
+ * Admin requests for orderby column
2419
+ *
2420
+ * @since 1.0
2421
+ */
2422
+ protected function get_stored_columns($type)
2423
+ {
2424
+ // get plugin options
2425
+ $options = get_option('cpac_options');
2426
+
2427
+ // get saved columns
2428
+ if ( isset($options['columns'][$type]) )
2429
+ return $options['columns'][$type];
2430
+
2431
+ return false;
2432
+ }
2433
+
2434
+ /**
2435
+ * Post Type Menu
2436
+ *
2437
+ * @since 1.0
2438
+ */
2439
+ private function get_menu()
2440
+ {
2441
+ // set
2442
+ $menu = '';
2443
+ $count = 1;
2444
+
2445
+ // referer
2446
+ $referer = ! empty($_REQUEST['cpac_type']) ? $_REQUEST['cpac_type'] : '';
2447
+
2448
+ // loop
2449
+ foreach ( $this->get_types() as $type ) {
2450
+ $label = $this->get_singular_name($type);
2451
+ $clean_label = $this->sanitize_string($type);
2452
+
2453
+ // divider
2454
+ $divider = $count++ == 1 ? '' : ' | ';
2455
+
2456
+ // current
2457
+ $current = '';
2458
+ if ( $this->is_menu_type_current($type) )
2459
+ $current = ' class="current"';
2460
+
2461
+ // menu list
2462
+ $menu .= "
2463
+ <li>{$divider}<a{$current} href='#cpac-box-{$clean_label}'>{$label}</a></li>
2464
+ ";
2465
+ }
2466
+
2467
+ // settings url
2468
+ $class_current_settings = $this->is_menu_type_current('plugin_settings') ? ' current': '';
2469
+
2470
+ // options button
2471
+ $options_btn = "<a href='#cpac-box-plugin_settings' class='cpac-settings-link{$class_current_settings}'>".__('Addons')."</a>";
2472
+ //$options_btn = '';
2473
+
2474
+ return "
2475
+ <div class='cpac-menu'>
2476
+ <ul class='subsubsub'>
2477
+ {$menu}
2478
+ </ul>
2479
+ {$options_btn}
2480
+ </div>
2481
+ ";
2482
+ }
2483
+
2484
+ /**
2485
+ * Checks if menu type is currently viewed
2486
+ *
2487
+ * @since 1.0
2488
+ */
2489
+ private function is_menu_type_current( $type )
2490
+ {
2491
+ // referer
2492
+ $referer = ! empty($_REQUEST['cpac_type']) ? $_REQUEST['cpac_type'] : '';
2493
+
2494
+ // get label
2495
+ $clean_label = $this->sanitize_string($type);
2496
+
2497
+ // get first element from post-types
2498
+ $first = array_shift( array_values($this->post_types) );
2499
+
2500
+ // display the page that was being viewed before saving
2501
+ if ( $referer ) {
2502
+ if ( $referer == 'cpac-box-'.$clean_label ) {
2503
+ return true;
2504
+ }
2505
+
2506
+ // settings page has not yet been saved
2507
+ } elseif ( $first == $type ) {
2508
+ return true;
2509
+ }
2510
+
2511
+ return false;
2512
+ }
2513
+
2514
+ /**
2515
+ * Get singular name of post type
2516
+ *
2517
+ * @since 1.0
2518
+ */
2519
+ private function get_singular_name( $type )
2520
+ {
2521
+ // Links
2522
+ if ( $type == 'wp-links' )
2523
+ $label = 'Links';
2524
+
2525
+ // Comments
2526
+ elseif ( $type == 'wp-comments' )
2527
+ $label = 'Comments';
2528
+
2529
+ // Users
2530
+ elseif ( $type == 'wp-users' )
2531
+ $label = 'Users';
2532
+
2533
+ // Media
2534
+ elseif ( $type == 'wp-media' )
2535
+ $label = 'Media Library';
2536
+
2537
+ // Posts
2538
+ else {
2539
+ $posttype_obj = get_post_type_object($type);
2540
+ $label = $posttype_obj->labels->singular_name;
2541
+ }
2542
+
2543
+ return $label;
2544
+ }
2545
+
2546
+ /**
2547
+ * Get plural name of post type
2548
+ *
2549
+ * @since 1.3.1
2550
+ */
2551
+ private function get_plural_name( $type )
2552
+ {
2553
+ $posttype_obj = get_post_type_object($type);
2554
+ if ( $posttype_obj )
2555
+ return $posttype_obj->labels->name;
2556
+
2557
+ return false;
2558
+ }
2559
+
2560
+ /**
2561
+ * Get screen link to overview screen
2562
+ *
2563
+ * @since 1.3.1
2564
+ */
2565
+ private function get_type_screen_link( $type )
2566
+ {
2567
+ // Links
2568
+ if ( $type == 'wp-comments' )
2569
+ $link = get_admin_url() . 'edit-comments.php';
2570
+
2571
+ // Links
2572
+ if ( $type == 'wp-links' )
2573
+ $link = get_admin_url() . 'link-manager.php';
2574
+
2575
+ // Users
2576
+ if ( $type == 'wp-users' )
2577
+ $link = get_admin_url() . 'users.php';
2578
+
2579
+ // Media
2580
+ elseif ( $type == 'wp-media' )
2581
+ $link = get_admin_url() . 'upload.php';
2582
+
2583
+ // Posts
2584
+ else
2585
+ $link = get_admin_url() . "edit.php?post_type={$type}";
2586
+
2587
+ return $link;
2588
+ }
2589
+
2590
+ /**
2591
+ * Sanitize label
2592
+ *
2593
+ * Uses intern wordpress function esc_url so it matches the label sorting url.
2594
+ *
2595
+ * @since 1.0
2596
+ */
2597
+ protected function sanitize_string($string)
2598
+ {
2599
+ $string = esc_url($string);
2600
+ $string = str_replace('http://','', $string);
2601
+ $string = str_replace('https://','', $string);
2602
+
2603
+ return $string;
2604
+ }
2605
+
2606
+ /**
2607
+ * Get plugin url.
2608
+ *
2609
+ * @since 1.0
2610
+ */
2611
+ private function plugin_url( $file = '' )
2612
+ {
2613
+ return plugins_url($file, __FILE__);
2614
+ }
2615
+
2616
+ /**
2617
+ * Checks if column-meta key exists
2618
+ *
2619
+ * @since 1.0
2620
+ */
2621
+ protected function is_column_meta( $id = '' )
2622
+ {
2623
+ if ( strpos($id, 'column-meta-') !== false )
2624
+ return true;
2625
+
2626
+ return false;
2627
+ }
2628
+
2629
+ /**
2630
+ * Get the posttype from columnname
2631
+ *
2632
+ * @since 1.3.1
2633
+ */
2634
+ protected function get_posttype_by_postcount_column( $id = '' )
2635
+ {
2636
+ if ( strpos($id, 'column-user_postcount-') !== false )
2637
+ return str_replace('column-user_postcount-', '', $id);
2638
+
2639
+ return false;
2640
+ }
2641
+
2642
+ /**
2643
+ * Get a thumbnail
2644
+ *
2645
+ * @since 1.0
2646
+ */
2647
+ private function get_thumbnail( $image = '' )
2648
+ {
2649
+ if ( empty($image) )
2650
+ return false;
2651
+
2652
+ // get correct image path
2653
+ $image_path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $image);
2654
+
2655
+ // resize image
2656
+ if ( file_exists($image_path) && $this->is_image($image_path) ) {
2657
+ $resized = image_resize( $image_path, 80, 80, true);
2658
+
2659
+ if ( ! is_wp_error( $resized ) ) {
2660
+ $image = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $resized);
2661
+
2662
+ return "<img src='{$image}' alt='' width='80' height='80' />";
2663
+ }
2664
+
2665
+ return $resized->get_error_message();
2666
+ }
2667
+
2668
+ return false;
2669
+ }
2670
+
2671
+ /**
2672
+ * Get a thumbnail
2673
+ *
2674
+ * @since 1.3.1
2675
+ */
2676
+ private function get_media_thumbnails($meta)
2677
+ {
2678
+ $meta = $this->strip_trim( str_replace(' ','', $meta) );
2679
+
2680
+ // split media ids
2681
+ $media_ids = array($meta);
2682
+ if ( strpos($meta, ',') !== false )
2683
+ $media_ids = explode(',', $meta);
2684
+
2685
+ // check if media exists
2686
+ $thumbs = '';
2687
+ foreach ( $media_ids as $media_id )
2688
+ if ( is_numeric($media_id) )
2689
+ $thumbs .= wp_get_attachment_url($media_id) ? "<span class='cpac-column-value-image'>".wp_get_attachment_image( $media_id, array(80,80), true )."</span>" : '';
2690
+
2691
+ return $thumbs;
2692
+ }
2693
+
2694
+ /**
2695
+ * Checks an URL for image extension
2696
+ *
2697
+ * @since 1.2
2698
+ */
2699
+ private function is_image($url)
2700
+ {
2701
+ $validExt = array('.jpg', '.jpeg', '.gif', '.png', '.bmp');
2702
+ $ext = strrchr($url, '.');
2703
+
2704
+ return in_array($ext, $validExt);
2705
+ }
2706
+
2707
+ /**
2708
+ * Admin body class
2709
+ *
2710
+ * @since 1.4
2711
+ */
2712
+ function admin_class()
2713
+ {
2714
+ global $current_screen;
2715
+
2716
+ // we dont need the 'edit-' part
2717
+ $screen = str_replace('edit-', '', $current_screen->id);
2718
+
2719
+ // media library exception
2720
+ if ( $current_screen->base == 'upload' && $current_screen->id == 'upload' ) {
2721
+ $screen = 'media';
2722
+ }
2723
+
2724
+ // link exception
2725
+ if ( $current_screen->base == 'link-manager' && $current_screen->id == 'link-manager' ) {
2726
+ $screen = 'links';
2727
+ }
2728
+
2729
+ // loop the available types
2730
+ foreach ( $this->get_types() as $type => $label ) {
2731
+
2732
+ // match against screen or wp-screen
2733
+ if ( $type == $screen || $type == "wp-{$screen}" )
2734
+ return "cp-{$type}";
2735
+ }
2736
+ return false;
2737
+ }
2738
+
2739
+ /**
2740
+ * Admin CSS for Column width
2741
+ *
2742
+ * @since 1.4
2743
+ */
2744
+ function admin_css()
2745
+ {
2746
+ $css = '';
2747
+
2748
+ // loop throug the available types...
2749
+ foreach ( $this->get_types() as $type ) {
2750
+ $cols = $this->get_stored_columns($type);
2751
+ if ( $cols ) {
2752
+
2753
+ // loop through each available column...
2754
+ foreach ( $cols as $col_name => $col ) {
2755
+
2756
+ // and check for stored width and add it to the css
2757
+ if (!empty($col['width']) && is_numeric($col['width']) && $col['width'] > 0 ) {
2758
+ $css .= ".cp-{$type} .wrap table th.column-{$col_name} { width: {$col['width']}% !important; }";
2759
+ }
2760
+ }
2761
+ }
2762
+ }
2763
+
2764
+ echo "<style type='text/css'>{$css}</style>";
2765
+ }
2766
+
2767
+ /**
2768
+ * Unlocks
2769
+ *
2770
+ * @since 1.3
2771
+ */
2772
+ protected function is_unlocked($type)
2773
+ {
2774
+ return preg_match('/^[a-f0-9]{40}$/i', $this->get_license_key($type));
2775
+ }
2776
+
2777
+ /**
2778
+ * Check license key with API
2779
+ *
2780
+ * @since 1.3.3
2781
+ */
2782
+ private function check_remote_key($type, $key)
2783
+ {
2784
+ if ( empty($type) || empty($key) )
2785
+ return false;
2786
+
2787
+ // check key with remote API
2788
+ $response = wp_remote_post( $this->api_url, array(
2789
+ 'body' => array(
2790
+ 'api' => 'addon',
2791
+ 'key' => $key,
2792
+ 'type' => $type
2793
+ )
2794
+ ));
2795
+
2796
+ // license will be valid in case of WP error or succes
2797
+ if ( is_wp_error($response) || ( isset($response['body']) && json_decode($response['body']) == 'valid' ) )
2798
+ return true;
2799
+
2800
+ return false;
2801
+ }
2802
+
2803
+ /**
2804
+ * Set masked license key
2805
+ *
2806
+ * @since 1.3.1
2807
+ */
2808
+ private function get_masked_license_key($type)
2809
+ {
2810
+ return '**************************'.substr( $this->get_license_key($type), -4 );
2811
+ }
2812
+
2813
+ /**
2814
+ * Ajax activation
2815
+ *
2816
+ * @since 1.3.1
2817
+ */
2818
+ public function ajax_activation()
2819
+ {
2820
+ // keys
2821
+ $key = $_POST['key'];
2822
+ $type = $_POST['type'];
2823
+
2824
+ // update key
2825
+ if ( $key == 'remove' ) {
2826
+ $this->remove_license_key($type);
2827
+ }
2828
+
2829
+ // set license key
2830
+ elseif ( $this->check_remote_key($type, $key) ) {
2831
+
2832
+ // set key
2833
+ $this->set_license_key($type, $key);
2834
+
2835
+ // returned masked key
2836
+ echo json_encode( $this->get_masked_license_key($type) );
2837
+ }
2838
+
2839
+ exit;
2840
+ }
2841
+
2842
+ /**
2843
+ * Get license key
2844
+ *
2845
+ * @since 1.3
2846
+ */
2847
+ private function get_license_key($type)
2848
+ {
2849
+ return get_option("cpac_{$type}_ac");
2850
+ }
2851
+
2852
+ /**
2853
+ * Set license key
2854
+ *
2855
+ * @since 1.3
2856
+ */
2857
+ private function set_license_key($type, $key)
2858
+ {
2859
+ update_option( "cpac_{$type}_ac", $key);
2860
+ }
2861
+
2862
+ /**
2863
+ * Remove license key
2864
+ *
2865
+ * @since 1.3.1
2866
+ */
2867
+ private function remove_license_key($type)
2868
+ {
2869
+ delete_option( "cpac_{$type}_ac" );
2870
+ delete_transient("cpac_{$type}_trnsnt");
2871
+ }
2872
+
2873
+ /**
2874
+ * Strip tags and trim
2875
+ *
2876
+ * @since 1.3
2877
+ */
2878
+ protected function strip_trim($string)
2879
+ {
2880
+ return trim(strip_tags($string));
2881
+ }
2882
+
2883
+ /**
2884
+ * Get date
2885
+ *
2886
+ * @since 1.3.1
2887
+ */
2888
+ protected function get_date($date)
2889
+ {
2890
+ if ( ! $date )
2891
+ return false;
2892
+
2893
+ if ( ! is_numeric($date) )
2894
+ $date = strtotime($date);
2895
+
2896
+ return date_i18n( get_option('date_format'), $date );
2897
+ }
2898
+
2899
+ /**
2900
+ * Get time
2901
+ *
2902
+ * @since 1.3.1
2903
+ */
2904
+ protected function get_time($date)
2905
+ {
2906
+ if ( ! $date )
2907
+ return false;
2908
+
2909
+ if ( ! is_numeric($date) )
2910
+ $date = strtotime($date);
2911
+
2912
+ return date_i18n( get_option('time_format'), $date );
2913
+ }
2914
+
2915
+ /**
2916
+ * Admin notices
2917
+ *
2918
+ * @since 1.3.1
2919
+ */
2920
+ private function admin_notice($message = '', $type = 'updated')
2921
+ {
2922
+ $this->notice_message = $message;
2923
+ $this->notice_type = $type; // updated, error
2924
+
2925
+ add_action('admin_notices', array( $this, 'callback_admin_notice' ) );
2926
+ }
2927
+
2928
+ /**
2929
+ * Output Notice
2930
+ *
2931
+ * @since 1.3.1
2932
+ */
2933
+ public function callback_admin_notice()
2934
+ {
2935
+ echo "<div class='{$this->notice_type}' id='message'><p>{$this->notice_message}</p></div>";
2936
+ }
2937
+
2938
+ /**
2939
+ * Add help tabs
2940
+ *
2941
+ * @since 1.3
2942
+ */
2943
+ public function help_tabs($page)
2944
+ {
2945
+ $screen = get_current_screen();
2946
+
2947
+ if ( $screen->id != $this->admin_page || ! method_exists($screen,'add_help_tab') )
2948
+ return;
2949
+
2950
+ $admin_url = get_admin_url();
2951
+
2952
+ // add help content
2953
+ $tabs = array(
2954
+ array(
2955
+ 'title' => 'Overview',
2956
+ 'content' => "
2957
+ <h5>Codepress Admin Columns</h5>
2958
+ <p>
2959
+ 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.
2960
+ </p>
2961
+
2962
+ "
2963
+ ),
2964
+ array(
2965
+ 'title' => 'Basics',
2966
+ 'content' => "
2967
+ <h5>Show / Hide</h5>
2968
+ <p>
2969
+ You can switch columns on or off by cliking on the checkbox. This will show or hide each column heading.
2970
+ </p>
2971
+ <h5>Change order</h5>
2972
+ <p>
2973
+ By dragging the columns you can change the order which they will appear in.
2974
+ </p>
2975
+ <h5>Change label</h5>
2976
+ <p>
2977
+ By clicking on the triangle you will see the column options. Here you can change each label of the columns heading.
2978
+ </p>
2979
+ <h5>Change coluimn width</h5>
2980
+ <p>
2981
+ 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.
2982
+ </p>
2983
+ "
2984
+ ),
2985
+ array(
2986
+ 'title' => 'Custom Field',
2987
+ 'content' => "
2988
+ <h5>'Custom Field' column</h5>
2989
+ <p>
2990
+ The custom field colum uses the custom fields from posts and users. There are 8 types which you can set.
2991
+ </p>
2992
+ <ul>
2993
+ <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>
2994
+ <li><strong>Image</strong><br/>Value: should only contain an image URL.</li>
2995
+ <li><strong>Media Library Icon</strong><br/>Value: should only contain Attachment IDs ( seperated by ',' ).</li>
2996
+ <li><strong>Excerpt</strong><br/>Value: This will show the first 20 words of the Post content.</li>
2997
+ <li><strong>Multiple Values</strong><br/>Value: should be an array. This will flatten any ( multi dimensional ) array.</li>
2998
+ <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>
2999
+ <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>
3000
+ <li><strong>Post Titles</strong><br/>Value: can be one or more Post ID's (seperated by ',').</li>
3001
+ </ul>
3002
+ "
3003
+ )
3004
+ );
3005
+
3006
+ foreach ( $tabs as $k => $tab ) {
3007
+ $screen->add_help_tab(array(
3008
+ 'id' => 'cpac-tab-'.$k, // unique id
3009
+ 'title' => $tab['title'], // label
3010
+ 'content' => $tab['content'], // body
3011
+ ));
3012
+ }
3013
+ }
3014
+
3015
+ /**
3016
+ * Activation settings
3017
+ *
3018
+ * @since 1.3.1
3019
+ */
3020
+ private function activation_settings()
3021
+ {
3022
+ $class_current_settings = $this->is_menu_type_current('plugin_settings') ? ' current' : ' hidden'; '';
3023
+
3024
+ /** Sortable */
3025
+ $masked_key = '';
3026
+ $class_sortorder_activate = '';
3027
+ $class_sortorder_deactivate = ' hidden';
3028
+
3029
+ // is unlocked
3030
+ if ( $this->is_unlocked('sortable') ) {
3031
+ $masked_key = $this->get_masked_license_key('sortable');
3032
+ $class_sortorder_activate = ' hidden';
3033
+ $class_sortorder_deactivate = '';
3034
+ }
3035
+
3036
+ // find out more
3037
+ $find_out_more = "<a href='{$this->codepress_url}/sortorder-addon/' class='button-primary alignright' target='_blank'>".__('find out more', $this->textdomain)." &raquo</a>";
3038
+
3039
+ // info box
3040
+ $sortable_tooltip = "
3041
+ <p>".__('This will make all of the new columns support sorting', $this->textdomain).".</p>
3042
+ <p>".__('By default WordPress let\'s you sort by title, date, comments and author. This will make you be able to <strong>sort by any column of any type!</strong>', $this->textdomain)."</p>
3043
+ <p>".__('Perfect for sorting your articles, media files, comments, links and users', $this->textdomain).".</p>
3044
+ <img src='" . $this->plugin_url('/assets/images/addon_sortable_1.png') . "' alt='' />
3045
+ {$find_out_more}
3046
+ ";
3047
+
3048
+ // markup
3049
+ $sortable = "
3050
+ <tr id='cpac-activation-sortable' class='last'>
3051
+ <td class='activation_type'>
3052
+ <span>" . __('Sortorder', $this->textdomain) . "</span>
3053
+ <div class='cpac-tooltip hidden'>
3054
+ <div class='qtip_title'>" . __('Sortorder', $this->textdomain) . "</div>
3055
+ <div class='qtip_content'>
3056
+ <p>" . __($sortable_tooltip, $this->textdomain) . "</p>
3057
+ </div>
3058
+ </div>
3059
+ </td>
3060
+ <td class='activation_status'>
3061
+ <div class='activate{$class_sortorder_activate}'>
3062
+ " . __('Inactive', $this->textdomain) . "
3063
+ </div>
3064
+ <div class='deactivate{$class_sortorder_deactivate}'>
3065
+ " . __('Active', $this->textdomain) . "
3066
+ </div>
3067
+ </td>
3068
+ <td class='activation_code'>
3069
+ <div class='activate{$class_sortorder_activate}'>
3070
+ <input type='text' value='" . __('Fill in your activation code', $this->textdomain) . "' name='cpac-sortable-key'>
3071
+ <a href='javascript:;' class='button'>" . __('Activate', $this->textdomain) . "<span></span></a>
3072
+ </div>
3073
+ <div class='deactivate{$class_sortorder_deactivate}'>
3074
+ <span class='masked_key'>{$masked_key}</span>
3075
+ <a href='javascript:;' class='button'>" . __('Deactivate', $this->textdomain) . "<span></span></a>
3076
+ </div>
3077
+ <div class='activation-error-msg'></div>
3078
+ </td>
3079
+ <td class='activation_more'>{$find_out_more}</td>
3080
+ </tr><!-- #cpac-activation-sortable -->
3081
+ ";
3082
+
3083
+ // settings
3084
+ $row = "
3085
+ <tr id='cpac-box-plugin_settings' valign='top' class='cpac-box-row {$class_current_settings}'>
3086
+ <td colspan='2'>
3087
+ <table class='nopadding'>
3088
+ <tr class='last'>
3089
+ <td>
3090
+ <h2>".__('Activate Add-ons', $this->textdomain)."</h2>
3091
+ <p>".__('Add-ons can be unlocked by purchasing a license key. Each key can be used on multiple sites', $this->textdomain)." <a target='_blank' href='{$this->codepress_url}/sortorder-addon/'>Visit the Plugin Store</a>.</p>
3092
+ <table class='widefat addons'>
3093
+ <thead>
3094
+ <tr>
3095
+ <th class='activation_type'>".__('Addon', $this->textdomain)."</th>
3096
+ <th class='activation_status'>".__('Status', $this->textdomain)."</th>
3097
+ <th class='activation_code'>".__('Activation Code', $this->textdomain)."</th>
3098
+ <th class='activation_more'></th>
3099
+ </tr>
3100
+ </thead>
3101
+ <tbody>
3102
+ {$sortable}
3103
+ </tbody>
3104
+ </table>
3105
+ <div class='addon-translation-string hidden'>
3106
+ <span class='tstring-fill-in'>" . __('Enter your activation code', $this->textdomain) . "</span>
3107
+ <span class='tstring-unrecognised'>" . __('Activation code unrecognised', $this->textdomain) . "</span>
3108
+ </div>
3109
+ </td>
3110
+ </tr>
3111
+ <!--
3112
+ <tr class='last'>
3113
+ <td colspan='2'>
3114
+ <h2>Options</h2>
3115
+ <ul class='cpac-options'>
3116
+ <li>
3117
+ <div class='cpac-option-label'>Thumbnail size</div>
3118
+ <div class='cpac-option-inputs'>
3119
+ <input type='text' id='thumbnail_size_w' class='small-text' name='cpac_options[settings][thumb_width]' value='80'/>
3120
+ <label for='thumbnail_size_w'>Width</label>
3121
+ <br/>
3122
+ <input type='text' id='thumbnail_size_h' class='small-text' name='cpac_options[settings][thumb_height]' value='80'/>
3123
+ <label for='thumbnail_size_h'>Height</label>
3124
+ </div>
3125
+ </li>
3126
+ <li>
3127
+ <div class='cpac-option-label'>Excerpt length</div>
3128
+ <div class='cpac-option-inputs'>
3129
+
3130
+ <input type='text' id='excerpt_length' class='small-text' name='cpac_options[settings][excerpt_length]' value='15'/>
3131
+ <label for='excerpt_length'>Number of words</label>
3132
+ </div>
3133
+ </li>
3134
+ </ul>
3135
+ </td>
3136
+ </tr>
3137
+ -->
3138
+ </table>
3139
+ </td>
3140
+ </tr><!-- #cpac-box-plugin_settings -->
3141
+ ";
3142
+
3143
+ return $row;
3144
+ }
3145
+
3146
+ /**
3147
+ * Settings Page Template.
3148
+ *
3149
+ * This function in conjunction with others usei the WordPress
3150
+ * Settings API to create a settings page where users can adjust
3151
+ * the behaviour of this plugin.
3152
+ *
3153
+ * @since 1.0
3154
+ */
3155
+ public function plugin_settings_page()
3156
+ {
3157
+
3158
+ // loop through post types
3159
+ $rows = '';
3160
+ foreach ( $this->get_types() as $type ) {
3161
+
3162
+ // post type label
3163
+ $label = $this->get_singular_name($type);
3164
+
3165
+ // screen link
3166
+ $screen_link = '';
3167
+ //$screen_link = $this->get_type_screen_link($type);
3168
+ //$screen_link = "<a href='{$screen_link}' class='go-to-screen'>" . sprintf( __('go to %s screen'), strtolower($label) ) . "</a>";
3169
+
3170
+ // id
3171
+ $id = $this->sanitize_string($type);
3172
+
3173
+ // build draggable boxes
3174
+ $boxes = $this->get_column_boxes($type);
3175
+
3176
+ // class
3177
+ $class = $this->is_menu_type_current($type) ? ' current' : ' hidden';
3178
+
3179
+ $rows .= "
3180
+ <tr id='cpac-box-{$id}' valign='top' class='cpac-box-row{$class}'>
3181
+ <th class='cpac_post_type' scope='row'>
3182
+ {$label}{$screen_link}
3183
+ </th>
3184
+ <td>
3185
+ <h3 class='cpac_post_type hidden'>{$label}</h3>
3186
+ {$boxes}
3187
+ </td>
3188
+ </tr>
3189
+ ";
3190
+ }
3191
+
3192
+ // Activation
3193
+ $activation_settings = $this->activation_settings();
3194
+
3195
+ // Post Type Menu
3196
+ $menu = $this->get_menu();
3197
+
3198
+ // Help screen message
3199
+ $help_text = '';
3200
+ if ( version_compare( get_bloginfo('version'), '3.2', '>' ) )
3201
+ $help_text = '<p>'.__('You will find a short overview at the <strong>Help</strong> section in the top-right screen.', $this->textdomain).'</p>';
3202
+
3203
+ // find out more
3204
+ $find_out_more = "<a href='{$this->codepress_url}/sortorder-addon/' class='alignright green' target='_blank'>".__('find out more', $this->textdomain)." &raquo</a>";
3205
+
3206
+ ?>
3207
+ <div id="cpac" class="wrap">
3208
+ <?php screen_icon($this->slug) ?>
3209
+ <h2><?php _e('Codepress Admin Columns', $this->textdomain); ?></h2>
3210
+ <?php echo $menu ?>
3211
+
3212
+ <div class="postbox-container cpac-col-right">
3213
+ <div class="metabox-holder">
3214
+ <div class="meta-box-sortables">
3215
+
3216
+ <div id="addons-cpac-settings" class="postbox">
3217
+ <div title="Click to toggle" class="handlediv"><br></div>
3218
+ <h3 class="hndle">
3219
+ <span><?php _e('Addons', $this->textdomain) ?></span>
3220
+ </h3>
3221
+ <div class="inside">
3222
+ <p><?php _e('By default WordPress let\'s you only sort by title, date, comments and author.', $this->textdomain) ?></p>
3223
+ <p><?php _e('Make <strong>all columns</strong> of <strong>all types</strong> support sorting &#8212; with the sorting addon.', $this->textdomain) ?></p>
3224
+ <?php echo $find_out_more ?>
3225
+ </div>
3226
+ </div><!-- addons-cpac-settings -->
3227
+
3228
+ <div id="likethisplugin-cpac-settings" class="postbox">
3229
+ <div title="Click to toggle" class="handlediv"><br></div>
3230
+ <h3 class="hndle">
3231
+ <span><?php _e('Like this plugin?', $this->textdomain) ?></span>
3232
+ </h3>
3233
+ <div class="inside">
3234
+ <p><?php _e('Why not do any or all of the following', $this->textdomain) ?>:</p>
3235
+ <ul>
3236
+ <li><a href="<?php echo $this->codepress_url ?>/"><?php _e('Link to it so other folks can find out about it.', $this->textdomain) ?></a></li>
3237
+ <li><a href="<?php echo $this->wordpress_url ?>"><?php _e('Give it a 5 star rating on WordPress.org.', $this->textdomain) ?></a></li>
3238
+ <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>
3239
+ </ul>
3240
+ </div>
3241
+ </div><!-- likethisplugin-cpac-settings -->
3242
+
3243
+ <div id="side-cpac-settings" class="postbox">
3244
+ <div title="Click to toggle" class="handlediv"><br></div>
3245
+ <h3 class="hndle">
3246
+ <span><?php _e('Need support?', $this->textdomain) ?></span>
3247
+ </h3>
3248
+ <div class="inside">
3249
+ <?php echo $help_text ?>
3250
+ <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>
3251
+ <p><?php printf(__("If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>.", $this->textdomain), "{$this->codepress_url}/feedback");?></p>
3252
+ </div>
3253
+ </div><!-- side-cpac-settings -->
3254
+
3255
+ </div>
3256
+ </div>
3257
+ </div><!-- .postbox-container -->
3258
+
3259
+ <div class="postbox-container cpac-col-left">
3260
+ <div class="metabox-holder">
3261
+ <div class="meta-box-sortables">
3262
+
3263
+ <div id="general-cpac-settings" class="postbox">
3264
+ <div title="Click to toggle" class="handlediv"><br></div>
3265
+ <h3 class="hndle">
3266
+ <span><?php _e('Admin Columns', $this->textdomain ); ?></span>
3267
+ </h3>
3268
+ <div class="inside">
3269
+ <form method="post" action="options.php">
3270
+
3271
+ <?php settings_fields( 'cpac-settings-group' ); ?>
3272
+
3273
+ <table class="form-table">
3274
+ <!-- columns -->
3275
+ <?php echo $rows; ?>
3276
+
3277
+ <!-- activation -->
3278
+ <?php echo $activation_settings; ?>
3279
+
3280
+ <tr class="bottom" valign="top">
3281
+ <th scope="row"></th>
3282
+ <td>
3283
+ <p class="submit">
3284
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
3285
+ </p>
3286
+ </td>
3287
+ </tr>
3288
+ </table>
3289
+ </form>
3290
+ </div>
3291
+ </div><!-- general-settings -->
3292
+
3293
+ <div id="restore-cpac-settings" class="postbox">
3294
+ <div title="Click to toggle" class="handlediv"><br></div>
3295
+ <h3 class="hndle">
3296
+ <span><?php _e('Restore defaults', $this->textdomain) ?></span>
3297
+ </h3>
3298
+ <div class="inside">
3299
+ <form method="post" action="">
3300
+ <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); ?>');" />
3301
+ </form>
3302
+ <p class="description"><?php _e('This will delete all column settings and restore the default settings.', $this->textdomain); ?></p>
3303
+ </div>
3304
+ </div><!-- restore-cpac-settings -->
3305
+
3306
+ </div>
3307
+ </div>
3308
+ </div><!-- .postbox-container -->
3309
+ </div>
3310
+ <?php
3311
+ }
3312
  }
3313
+
3314
+ /**
3315
+ * Init Class Codepress_Admin_Columns
3316
+ *
3317
+ * @since 1.0
3318
+ */
3319
+ new Codepress_Admin_Columns();
3320
+
3321
+
3322
+ /**
3323
+ * Init Class Codepress_Sortable_Columns
3324
+ *
3325
+ * @since 1.3
3326
+ */
3327
+ new Codepress_Sortable_Columns();
3328
+
3329
  ?>
languages/codepress-admin-columns-nl_NL.mo CHANGED
Binary file
languages/codepress-admin-columns-nl_NL.po CHANGED
@@ -2,9 +2,9 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Codepress Admin Columns\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-11-26 23:47+0100\n"
6
- "PO-Revision-Date: 2011-11-26 23:47+0100\n"
7
- "Last-Translator: Tobias <tschutter@gmail.com>\n"
8
  "Language-Team: Codepress <info@codepress.nl>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -17,292 +17,442 @@ msgstr ""
17
  "X-Poedit-SearchPath-0: .\n"
18
  "X-Poedit-SearchPath-1: ..\n"
19
 
20
- #: ../codepress-admin-columns.php:132
21
  msgid "Settings"
22
  msgstr "Instellingen"
23
 
24
- #: ../codepress-admin-columns.php:225
25
- msgid "Codepress Admin Columns"
26
- msgstr ""
27
 
28
- #: ../codepress-admin-columns.php:234
29
- msgid "Admin Columns"
30
- msgstr ""
31
 
32
- #: ../codepress-admin-columns.php:249
33
- msgid "Save Changes"
34
- msgstr "Wijzigingen opslaan"
35
-
36
- #: ../codepress-admin-columns.php:261
37
- msgid "Restore defaults"
38
  msgstr "Herstel instellingen"
39
 
40
- #: ../codepress-admin-columns.php:265
41
- msgid "Restore default settings"
42
- msgstr "Herstel standaard instellingen"
43
-
44
- #: ../codepress-admin-columns.php:265
45
- msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
46
- msgstr "Waarschuwing! ALLE bewaarde instellingen worden verwijderd. Dit kan niet worden ongedaan. \\'OK\\' om te verwijderen, \\'Annuleren\\' om te stoppen"
47
-
48
- #: ../codepress-admin-columns.php:267
49
- msgid "This will delete all column settings and restore the default settings."
50
- msgstr "Hiermee worden alle kolommen instellingen verwijderd en de standaardinstellingen hersteld."
51
-
52
- #: ../codepress-admin-columns.php:282
53
- msgid "Need support?"
54
- msgstr "Hulp nodig?"
55
-
56
- #: ../codepress-admin-columns.php:285
57
- #, php-format
58
- msgid "If you are having problems with this plugin, please talk about them in the <a href=\"%s\">Support forums</a>."
59
- msgstr "Als je problem hebt met deze plugin, stel je vragen dan in de <a href=\"%s\">Support forums</a>."
60
-
61
- #: ../codepress-admin-columns.php:286
62
- #, php-format
63
- msgid "If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>."
64
- msgstr "Als een bug bent tegen gekomen, of een feature wil aanvragen, stuur ons dan <a href='%s'>je feedback</a>."
65
-
66
- #: ../codepress-admin-columns.php:324
67
- msgid "Add Custom Field Column"
68
- msgstr "Voeg custom field kolom toe"
69
 
70
- #: ../codepress-admin-columns.php:483
71
  msgid "Default"
72
  msgstr ""
73
 
74
- #: ../codepress-admin-columns.php:484
75
- #: ../codepress-admin-columns.php:1079
76
  msgid "Image"
77
  msgstr "Afbeelding"
78
 
79
- #: ../codepress-admin-columns.php:485
80
  msgid "Media Library Icon"
81
  msgstr "Media bibliotheek Icoon"
82
 
83
- #: ../codepress-admin-columns.php:486
84
- #: ../codepress-admin-columns.php:1087
85
- #: ../codepress-admin-columns.php:1089
86
  msgid "Excerpt"
87
  msgstr "Samenvatting"
88
 
89
- #: ../codepress-admin-columns.php:487
90
  msgid "Multiple Values"
91
  msgstr "Meerdere waarden"
92
 
93
- #: ../codepress-admin-columns.php:506
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  msgid "This field can not be removed"
95
  msgstr "Dit veld kan niet worden verwijderd"
96
 
97
- #: ../codepress-admin-columns.php:510
98
  msgid "Remove"
99
  msgstr "Verwijder"
100
 
101
- #: ../codepress-admin-columns.php:796
102
  msgid "Standard"
103
  msgstr "Standaard"
104
 
105
- #: ../codepress-admin-columns.php:1030
 
 
 
 
 
 
 
 
 
 
106
  msgid "Comments"
107
  msgstr "Reacties"
108
 
109
- #: ../codepress-admin-columns.php:1068
110
- msgid "Custom"
111
- msgstr ""
112
 
113
- #: ../codepress-admin-columns.php:1077
114
  msgid "Featured Image"
115
  msgstr "Uitgelichte afbeelding"
116
 
117
- #: ../codepress-admin-columns.php:1097
118
- #: ../codepress-admin-columns.php:1099
119
- msgid "Sticky"
120
- msgstr "Sticky"
121
-
122
- #: ../codepress-admin-columns.php:1107
123
  msgid "Page Order"
124
  msgstr "Pagina Volgorde"
125
 
126
- #: ../codepress-admin-columns.php:1110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  msgid "Order"
128
  msgstr "Volgorde"
129
 
130
- #: ../codepress-admin-columns.php:1118
131
- #: ../codepress-admin-columns.php:1121
132
  msgid "Page Template"
133
  msgstr "Pagina Template"
134
 
135
- #: ../codepress-admin-columns.php:1129
136
- #: ../codepress-admin-columns.php:1131
137
- msgid "Post Format"
138
  msgstr ""
139
 
140
- #: ../codepress-admin-columns.php:1144
141
- msgid "Taxonomy"
 
 
142
  msgstr ""
143
 
144
- #: ../codepress-admin-columns.php:1162
145
- #: ../codepress-admin-columns.php:1165
146
- msgid "Slug"
 
 
 
 
 
147
  msgstr ""
148
 
149
- #: ../codepress-admin-columns.php:1171
150
- #: ../codepress-admin-columns.php:1174
151
- msgid "Attachment"
152
  msgstr ""
153
 
154
- #: ../codepress-admin-columns.php:1181
155
- msgid "Custom Field"
 
 
 
 
 
 
 
 
156
  msgstr ""
157
 
158
- #: ../codepress-admin-columns.php:1185
159
- msgid "Field"
160
- msgstr "Veld"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
- #~ msgid "Title"
163
- #~ msgstr "Titel"
 
164
 
165
- #~ msgid "Description"
166
- #~ msgstr "Beschrijving"
 
167
 
168
- #~ msgid "Latitude"
169
- #~ msgstr "Breedtegraad"
 
170
 
171
- #~ msgid "Longitude"
172
- #~ msgstr "Lengtegraad"
 
173
 
174
- #~ msgid "Width"
175
- #~ msgstr "Breedte"
 
176
 
177
- #~ msgid "Height"
178
- #~ msgstr "Hoogte"
 
179
 
180
- #~ msgid "Dynamic"
181
- #~ msgstr "Dynamisch"
 
182
 
183
- #~ msgid "Geocoder - Pronamic Google Maps"
184
- #~ msgstr "Geocoder - Pronamic Google Maps"
 
185
 
186
- #~ msgid "Number posts to geocode: %s"
187
- #~ msgstr "Aantel berichten te geocoderen: %s"
 
188
 
189
- #~ msgid "ID"
190
- #~ msgstr "ID"
 
191
 
192
- #~ msgid "Address"
193
- #~ msgstr "Adres"
 
194
 
195
- #~ msgid "Status"
196
- #~ msgstr "Status"
 
197
 
198
- #~ msgid "Location"
199
- #~ msgstr "Locatie"
 
 
 
200
 
201
- #~ msgid "Geocode"
202
- #~ msgstr "Geocodeer"
 
 
203
 
204
- #~ msgid "Zero results"
205
- #~ msgstr "Geen resultaten"
 
206
 
207
- #~ msgid ""
208
- #~ "We found no geocoding results for the following %s posts, adjust them "
209
- #~ "manually if needed."
210
- #~ msgstr ""
211
- #~ "We konden geen gecode resultaten vinden voor de volgende%s berichten, pas "
212
- #~ "deze handmatig aan wanneer nodig."
213
 
214
- #~ msgid "Configuration - Pronamic Google Maps"
215
- #~ msgstr "Configuratie - Pronamic Google Maps"
 
216
 
217
- #~ msgid "Active"
218
- #~ msgstr "Actief"
 
 
219
 
220
- #~ msgid "Activate Google Maps"
221
- #~ msgstr "Activeer Google Maps"
 
 
222
 
223
- #~ msgid "Show Google Maps"
224
- #~ msgstr "Google Maps weergeven"
 
225
 
226
- #~ msgid "Geocoder"
227
- #~ msgstr "Geocoder"
 
228
 
229
- #~ msgid "Geocode &darr;"
230
- #~ msgstr "Geocoderen &darr;"
 
 
231
 
232
- #~ msgid "Reverse Geocode &uarr;"
233
- #~ msgstr "Omgekeerd geocoderen &uarr;"
 
 
234
 
235
- #~ msgid "Tip: Change the zoom level and map type to your own wishes."
236
- #~ msgstr "Tip: wijzig het zoomniveau en map type naar je eigen wens."
 
 
237
 
238
- #~ msgid "Delete plugin"
239
- #~ msgstr "Verwijder plugin"
 
240
 
241
- #~ msgid "Warning! This will delete all Pronamic Google Maps data and options."
242
- #~ msgstr ""
243
- #~ "Waarschuwing! Dit zal alle Pronamic Google Maps data en opties "
244
- #~ "verwijderen."
245
 
246
- #~ msgid "Uninstall"
247
- #~ msgstr "Verwijderen"
 
248
 
249
- #~ msgid "Google Maps"
250
- #~ msgstr "Google Maps"
 
251
 
252
- #~ msgid "General"
253
- #~ msgstr "Algemeen"
 
254
 
255
- #~ msgid "Use this widget to add an Google Maps as a widget."
256
- #~ msgstr "Gebruik deze widget om Google Maps toe te voegen."
 
257
 
258
- #~ msgid "pixels"
259
- #~ msgstr "pixels"
 
260
 
261
- #~ msgid "percent"
262
- #~ msgstr "procent"
 
263
 
264
- #~ msgid "Search"
265
- #~ msgstr "Zoeken"
 
266
 
267
- #~ msgid "Click to toggle"
268
- #~ msgstr "Klik om te wisselen"
 
269
 
270
- #~ msgid "Donate $10, $20 or $50!"
271
- #~ msgstr "Doneer $10, $20 of $50!"
 
272
 
273
- #~ msgid ""
274
- #~ "This plugin has cost us countless hours of work, if you use it, please "
275
- #~ "donate a token of your appreciation!"
276
- #~ msgstr ""
277
- #~ "Het ons veel uren werken gekost om deze plugin te ontwikkelen, als je het "
278
- #~ "gebruikt, doneer a.u.b. voor je waardering!"
279
 
280
- #~ msgid "Latest news from Pronamic"
281
- #~ msgstr "Laatste nieuws van Pronamic"
 
282
 
283
- #~ msgid "no news items, feed might be broken..."
284
- #~ msgstr "geen nieuws items, feed is waarschijnlijk niet bereikbaar..."
 
285
 
286
- #~ msgid "Subscribe with RSS"
287
- #~ msgstr "Aanmelden voor RSS"
 
288
 
289
- #~ msgid "Subscribe by e-mail"
290
- #~ msgstr "Aanmelden via e-mail"
 
 
291
 
292
- #~ msgid "Why not do any or all of the following:"
293
- #~ msgstr "Waarom doe je niet één van de volgende dingen:"
 
 
294
 
295
- #~ msgid "Link to it so other folks can find out about it."
296
- #~ msgstr "Link naar ons zodat anderen deze plugin ook ontdekken."
 
 
 
 
 
 
 
 
 
297
 
298
- #~ msgid "Give it a good rating on WordPress.org."
299
- #~ msgstr "Geef het een goede score op WordPress.org."
 
300
 
301
- #~ msgid "Let other people know that it works with your WordPress setup."
302
- #~ msgstr "Laat anderen weten dat het werk op je WordPress installatie."
 
303
 
304
- #~ msgid "Found a bug?"
305
- #~ msgstr "Bug gevonden?"
 
306
 
307
- #~ msgid "Configuration"
308
- #~ msgstr "Configuratie"
2
  msgstr ""
3
  "Project-Id-Version: Codepress Admin Columns\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-03-27 12:13+0100\n"
6
+ "PO-Revision-Date: 2012-04-20 21:13+0100\n"
7
+ "Last-Translator: Codepress <info@codepress.nl>\n"
8
  "Language-Team: Codepress <info@codepress.nl>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
  "X-Poedit-SearchPath-1: ..\n"
19
 
20
+ #: ../codepress-admin-columns.php:171
21
  msgid "Settings"
22
  msgstr "Instellingen"
23
 
24
+ #: ../codepress-admin-columns.php:363
25
+ msgid "Add Custom Field Column"
26
+ msgstr "Voeg custom field kolom toe"
27
 
28
+ #: ../codepress-admin-columns.php:371
29
+ msgid "drag and drop to reorder"
30
+ msgstr "sleep om de volgorde te veranderen"
31
 
32
+ #: ../codepress-admin-columns.php:511
33
+ #: ../codepress-admin-columns.php:536
34
+ #, fuzzy
35
+ msgid "default"
 
 
36
  msgstr "Herstel instellingen"
37
 
38
+ #: ../codepress-admin-columns.php:534
39
+ #: ../codepress-admin-columns.php:2125
40
+ msgid "Width"
41
+ msgstr "Breedte"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
+ #: ../codepress-admin-columns.php:593
44
  msgid "Default"
45
  msgstr ""
46
 
47
+ #: ../codepress-admin-columns.php:594
48
+ #: ../codepress-admin-columns.php:2165
49
  msgid "Image"
50
  msgstr "Afbeelding"
51
 
52
+ #: ../codepress-admin-columns.php:595
53
  msgid "Media Library Icon"
54
  msgstr "Media bibliotheek Icoon"
55
 
56
+ #: ../codepress-admin-columns.php:596
57
+ #: ../codepress-admin-columns.php:1935
58
+ #: ../codepress-admin-columns.php:2237
59
  msgid "Excerpt"
60
  msgstr "Samenvatting"
61
 
62
+ #: ../codepress-admin-columns.php:597
63
  msgid "Multiple Values"
64
  msgstr "Meerdere waarden"
65
 
66
+ #: ../codepress-admin-columns.php:598
67
+ msgid "Numeric"
68
+ msgstr "Numerieke"
69
+
70
+ #: ../codepress-admin-columns.php:599
71
+ #: ../codepress-admin-columns.php:2228
72
+ msgid "Date"
73
+ msgstr "Datum"
74
+
75
+ #: ../codepress-admin-columns.php:600
76
+ msgid "Post Title (Post ID's)"
77
+ msgstr "Post Titel (Post ID's)"
78
+
79
+ #: ../codepress-admin-columns.php:625
80
  msgid "This field can not be removed"
81
  msgstr "Dit veld kan niet worden verwijderd"
82
 
83
+ #: ../codepress-admin-columns.php:629
84
  msgid "Remove"
85
  msgstr "Verwijder"
86
 
87
+ #: ../codepress-admin-columns.php:974
88
  msgid "Standard"
89
  msgstr "Standaard"
90
 
91
+ #: ../codepress-admin-columns.php:1193
92
+ msgid "original"
93
+ msgstr "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,648 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-11 11:55+0100\n"
7
+ "Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
8
+ "Language-Team: Digital Factory <info@digitalfactory.pl>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-Language: Polish\n"
15
+ "X-Poedit-Country: POLAND\n"
16
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
+ "X-Poedit-SourceCharset: utf-8\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+ "X-Poedit-SearchPath-1: ..\n"
20
+
21
+ #: ../codepress-admin-columns.php:171
22
+ msgid "Settings"
23
+ msgstr "Ustawienia"
24
+
25
+ #: ../codepress-admin-columns.php:363
26
+ msgid "Add Custom Field Column"
27
+ msgstr "Dodaj kolumnę Własne pole"
28
+
29
+ #: ../codepress-admin-columns.php:371
30
+ msgid "drag and drop to reorder"
31
+ msgstr "przeciągnij i opuść aby zmienić kolejność"
32
+
33
+ #: ../codepress-admin-columns.php:511
34
+ #: ../codepress-admin-columns.php:536
35
+ msgid "default"
36
+ msgstr "domyśłny"
37
+
38
+ #: ../codepress-admin-columns.php:534
39
+ #: ../codepress-admin-columns.php: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
+
531
+ #~ msgid "User Field"
532
+ #~ msgstr "Veld"
533
+
534
+ #~ msgid ""
535
+ #~ "If you are having problems with this plugin, please talk about them in "
536
+ #~ "the <a href=\"%s\">Support forums</a>."
537
+ #~ msgstr ""
538
+ #~ "Als je problem hebt met deze plugin, stel je vragen dan in de <a href=\"%s"
539
+ #~ "\">Support forums</a>."
540
+
541
+ #~ msgid "Title"
542
+ #~ msgstr "Titel"
543
+
544
+ #~ msgid "Latitude"
545
+ #~ msgstr "Breedtegraad"
546
+
547
+ #~ msgid "Longitude"
548
+ #~ msgstr "Lengtegraad"
549
+
550
+ #~ msgid "Dynamic"
551
+ #~ msgstr "Dynamisch"
552
+
553
+ #~ msgid "Geocoder - Pronamic Google Maps"
554
+ #~ msgstr "Geocoder - Pronamic Google Maps"
555
+
556
+ #~ msgid "Number posts to geocode: %s"
557
+ #~ msgstr "Aantel berichten te geocoderen: %s"
558
+
559
+ #~ msgid "Geocode"
560
+ #~ msgstr "Geocodeer"
561
+
562
+ #~ msgid "Zero results"
563
+ #~ msgstr "Geen resultaten"
564
+
565
+ #~ msgid ""
566
+ #~ "We found no geocoding results for the following %s posts, adjust them "
567
+ #~ "manually if needed."
568
+ #~ msgstr ""
569
+ #~ "We konden geen gecode resultaten vinden voor de volgende%s berichten, pas "
570
+ #~ "deze handmatig aan wanneer nodig."
571
+
572
+ #~ msgid "Configuration - Pronamic Google Maps"
573
+ #~ msgstr "Configuratie - Pronamic Google Maps"
574
+
575
+ #~ msgid "Show Google Maps"
576
+ #~ msgstr "Google Maps weergeven"
577
+
578
+ #~ msgid "Geocoder"
579
+ #~ msgstr "Geocoder"
580
+
581
+ #~ msgid "Geocode &darr;"
582
+ #~ msgstr "Geocoderen &darr;"
583
+
584
+ #~ msgid "Reverse Geocode &uarr;"
585
+ #~ msgstr "Omgekeerd geocoderen &uarr;"
586
+
587
+ #~ msgid "Tip: Change the zoom level and map type to your own wishes."
588
+ #~ msgstr "Tip: wijzig het zoomniveau en map type naar je eigen wens."
589
+
590
+ #~ msgid "Warning! This will delete all Pronamic Google Maps data and options."
591
+ #~ msgstr ""
592
+ #~ "Waarschuwing! Dit zal alle Pronamic Google Maps data en opties "
593
+ #~ "verwijderen."
594
+
595
+ #~ msgid "Uninstall"
596
+ #~ msgstr "Verwijderen"
597
+
598
+ #~ msgid "Google Maps"
599
+ #~ msgstr "Google Maps"
600
+
601
+ #~ msgid "General"
602
+ #~ msgstr "Algemeen"
603
+
604
+ #~ msgid "Use this widget to add an Google Maps as a widget."
605
+ #~ msgstr "Gebruik deze widget om Google Maps toe te voegen."
606
+
607
+ #~ msgid "pixels"
608
+ #~ msgstr "pixels"
609
+
610
+ #~ msgid "percent"
611
+ #~ msgstr "procent"
612
+
613
+ #~ msgid "Search"
614
+ #~ msgstr "Zoeken"
615
+
616
+ #~ msgid "Click to toggle"
617
+ #~ msgstr "Klik om te wisselen"
618
+
619
+ #~ msgid "Donate $10, $20 or $50!"
620
+ #~ msgstr "Doneer $10, $20 of $50!"
621
+
622
+ #~ msgid ""
623
+ #~ "This plugin has cost us countless hours of work, if you use it, please "
624
+ #~ "donate a token of your appreciation!"
625
+ #~ msgstr ""
626
+ #~ "Het ons veel uren werken gekost om deze plugin te ontwikkelen, als je het "
627
+ #~ "gebruikt, doneer a.u.b. voor je waardering!"
628
+
629
+ #~ msgid "Latest news from Pronamic"
630
+ #~ msgstr "Laatste nieuws van Pronamic"
631
+
632
+ #~ msgid "no news items, feed might be broken..."
633
+ #~ msgstr "geen nieuws items, feed is waarschijnlijk niet bereikbaar..."
634
+
635
+ #~ msgid "Subscribe with RSS"
636
+ #~ msgstr "Aanmelden voor RSS"
637
+
638
+ #~ msgid "Subscribe by e-mail"
639
+ #~ msgstr "Aanmelden via e-mail"
640
+
641
+ #~ msgid "Let other people know that it works with your WordPress setup."
642
+ #~ msgstr "Laat anderen weten dat het werk op je WordPress installatie."
643
+
644
+ #~ msgid "Found a bug?"
645
+ #~ msgstr "Bug gevonden?"
646
+
647
+ #~ msgid "Configuration"
648
+ #~ msgstr "Configuratie"
readme.txt CHANGED
@@ -1,21 +1,21 @@
1
  === Codepress Admin Columns ===
2
  Contributors: codepress, tschutter
3
- Tags: plugins, wordpress, admin, column, columns, dashboard, sortable, filters, wp-admin
4
  Requires at least: 3.1
5
- Tested up to: 3.2.1
6
- Stable tag: 1.0.1
7
 
8
  == Description ==
9
 
10
- This plugin makes it easy to customize Admin Columns for your Posts, Pages and Custom Post Type Screens.
11
 
12
- = Intro =
13
 
14
- This plugin let's you visually customize the Admin Columns. You can add or remove columns, change their label and reorder them.
15
 
16
- = Custom Columns =
17
 
18
- The following custom columns are supported:
19
 
20
  * Featured Image
21
  * Excerpt
@@ -27,27 +27,95 @@ The following custom columns are supported:
27
  * ID
28
  * Slug
29
  * Sticky
 
 
 
 
30
  * Custom Fields
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  = Custom Fields =
33
 
34
- With the custom field column you can display custom field values. It will show the value as a default. You can also set your own type:
35
 
36
- * Icons for Media Library items
37
  * Image thumbnails
 
38
  * Excerpt
39
  * Multiple Values
 
40
 
41
- = Sortable Admin Columns =
42
 
43
- 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:
44
 
45
- * ID
46
- * page order
47
- * slug
48
- * page template
 
 
 
 
 
 
 
49
 
50
- I 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>.
 
 
 
 
 
 
 
 
51
 
52
  **Related Links:**
53
 
@@ -59,25 +127,108 @@ I will be adding more in coming releases. You can leave any <a href='http://www.
59
  2. Activate Codepress Admin Columns through the 'Plugins' menu in WordPress
60
  3. Configure the plugin by going to the Admin Column settings that appears under the Settings menu.
61
 
62
-
63
  == Frequently Asked Questions ==
64
 
65
  = I have an idea for a great way to improve this plugin =
66
 
67
  Great! I'd love to hear from you.
68
- Leave your feedback at http://www.codepress.nl/plugins/codepress-admin-columns#feedback.
69
 
70
  == Screenshots ==
71
 
72
- 1. Settings page of the Codepress Admin columns plugin.
73
- 2. Options for the Custom Field Column.
74
- 3. Posts Screen with custom columns.
 
 
 
 
75
 
76
  == Changelog ==
77
 
78
- = 1.0.1 =
79
-
80
- Settings link corrected
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  = 1.0 =
83
 
1
  === Codepress Admin Columns ===
2
  Contributors: codepress, tschutter
3
+ Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, posts, media, users, pages, posttypes, manage columns, wp-admin
4
  Requires at least: 3.1
5
+ Tested up to: 3.3.1
6
+ Stable tag: 1.4.3
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
 
20
  * Featured Image
21
  * Excerpt
27
  * ID
28
  * Slug
29
  * Sticky
30
+ * Word count
31
+ * Roles
32
+ * Status
33
+ * Number of Attachments
34
  * Custom Fields
35
 
36
+ = User Columns =
37
+
38
+ You can also change the User Columns. The following user columns are added:
39
+
40
+ * User ID
41
+ * First name
42
+ * Last name
43
+ * Url
44
+ * Register date
45
+ * Biographical Info ( description )
46
+ * User Custom Fields
47
+ * Number of Posts Types
48
+
49
+ Some of the user custom fields that are included: user level, capabilities, admin color, nickname... many more.
50
+
51
+ = Media Columns =
52
+
53
+ Customise the Media Library Columns. The following media columns are added:
54
+
55
+ * Media ID
56
+ * File name
57
+ * Height
58
+ * Width
59
+ * Dimensions ( width x height )
60
+ * Description, Caption and Alternate tekst
61
+ * Mime-Type
62
+
63
+ = Comment Columns =
64
+
65
+ A lot more comment colums are added, here are a few examples:
66
+
67
+ * Avatar
68
+ * Author IP
69
+ * Agent
70
+ * ID
71
+ * Comment excerpt
72
+ * Comment Meta data
73
+
74
+ = Link Columns =
75
+
76
+ A few examples of added Link columns:
77
+
78
+ * ID
79
+ * Target
80
+ * Description
81
+ * Notes
82
+ * Owner
83
+
84
  = Custom Fields =
85
 
86
+ 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:
87
 
 
88
  * Image thumbnails
89
+ * Icons for Media Library items
90
  * Excerpt
91
  * Multiple Values
92
+ * Numeric value ( this also works for sorting by meta_value_num )
93
 
94
+ = Sortable Custom Columns for all Screens =
95
 
96
+ 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>.
97
 
98
+ 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>.
99
+
100
+ = Third party plugin support =
101
+
102
+ 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.
103
+
104
+ = Translations =
105
+
106
+ If you like to contrinute a language, please send them to <a href="mailto:info@codepress.nl">info@codepress.nl</a>.
107
+
108
+ * Polish (pl_PL) - Thanks for contributing the polish language goes to Bartosz
109
 
110
+
111
+ = Upcoming releases =
112
+
113
+ The next upcoming release will have the option to set default sorting per screen.
114
+
115
+
116
+ **Feedback**
117
+
118
+ You can leave any <a href='http://www.codepress.nl/plugins/codepress-admin-columns/feedback'>requests or feedback</a>.
119
 
120
  **Related Links:**
121
 
127
  2. Activate Codepress Admin Columns through the 'Plugins' menu in WordPress
128
  3. Configure the plugin by going to the Admin Column settings that appears under the Settings menu.
129
 
 
130
  == Frequently Asked Questions ==
131
 
132
  = I have an idea for a great way to improve this plugin =
133
 
134
  Great! I'd love to hear from you.
135
+ Leave your feedback at http://www.codepress.nl/plugins/codepress-admin-columns/feedback.
136
 
137
  == Screenshots ==
138
 
139
+ 1. Settings page for Post(type) columns.
140
+ 2. Posts Screen with the customized sortable columns.
141
+ 3. Settings page for the Media Library columns.
142
+ 4. Media Screen with the customized sortable columns.
143
+ 5. Settings page for Users columns.
144
+ 6. Users Screen with the customized sortable columns.
145
+ 7. Settings page showing the different displaying types for custom field.
146
 
147
  == Changelog ==
148
 
149
+ = 1.4.3 =
150
+ * removed taxonomy filtering ( this will return in next patch with an option to show/hide )
151
+
152
+ = 1.4.2 =
153
+ * added fix for unexpected output in the column value
154
+ * added fix for better 3rd party plugin support
155
+ * added column for Comment status
156
+ * added column for Ping/Trackback status
157
+ * added column for Posts Actions (delete, view etc.)
158
+ * added column for Users Actions (delete, view etc.)
159
+ * added sorting taxonomies ( only on first one )
160
+ * added bug fix for sorting
161
+ * added taxonomy filtering
162
+
163
+ = 1.4.1 =
164
+ * added polish translation, thanks to Bartosz.
165
+ * changed the license key validation proces
166
+ * removed non-breaking-space-character from column output
167
+
168
+ = 1.4 =
169
+
170
+ * added support for comment columns
171
+ * added support for link columns
172
+ * added links to taxonomies
173
+ * added sorting user custom fields
174
+ * added sorting to links columns
175
+ * added user columns so you can see how many articles an author has published of a certain post type
176
+ * added Textual help
177
+ * added the option to specify column width
178
+ * added role column to all posts screens
179
+ * added posts status column to all posts screens
180
+ * added image path to media library
181
+ * added added apply_filters('cpac-get-post-types', $post_types) to filter out certain post types
182
+ * added option to enter license key for activating sorting on ALL columns
183
+ * fixed a php5 warning
184
+ * fixed a conflict with the Co-Authors plugin
185
+
186
+ = 1.3 =
187
+
188
+ * added support for Media columns
189
+ * added Media columns: filename, width, height, dimensions, description, alt, caption and mime-type
190
+ * added date type to posts custom fields
191
+ * added title type to posts custom fields
192
+ * sorting has changed. when sorting; only results are shown which contain a value
193
+ * str_word_count is used for excerpts
194
+
195
+ = 1.2.1 =
196
+
197
+ * added word count sorting
198
+ * added attachment count sorting
199
+ * added template name sorting
200
+ * minor styling changes
201
+ * bug fix with sorting by slug
202
+ * bug fix with sorting by attachment
203
+
204
+ = 1.2 =
205
+
206
+ * added support for third party plugins
207
+ * added user custom fields
208
+ * added extra image check
209
+ * bug fix with javascript (jquery) enqueue
210
+
211
+ = 1.1.3 =
212
+
213
+ * added bug fix for WP3.3beta ( thanks to raonip and ronbme for pointing this out )
214
+
215
+ = 1.1.2 =
216
+
217
+ * added dutch translation
218
+
219
+ = 1.1.1 =
220
+
221
+ * Bug fix: path separator for require_once
222
+ * Added word count
223
+
224
+ = 1.1 =
225
+
226
+ * Added User Columns.
227
+ * Added before / after text for custom fields
228
+ * Added custom field type 'Numeric'.
229
+ * Added custom field sortables.
230
+ * Fixed domain path
231
+ * Fixed settings link
232
 
233
  = 1.0 =
234
 
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