Admin Columns - Version 1.4.4

Version Description

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

Release Info

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

Code changes from version 1.1.3 to 1.4.4

Files changed (50) hide show
  1. assets/css/admin-column.css +314 -20
  2. assets/css/column.css +38 -0
  3. assets/images/addon_sortable_1.png +0 -0
  4. assets/images/arrows.png +0 -0
  5. assets/images/comment_edit.png +0 -0
  6. assets/images/cross.png +0 -0
  7. assets/images/information.png +0 -0
  8. assets/images/loading.gif +0 -0
  9. assets/images/no.png +0 -0
  10. assets/images/reorder_arrow.png +0 -0
  11. assets/images/settings.png +0 -0
  12. assets/images/sort.png +0 -0
  13. assets/images/square.png +0 -0
  14. assets/images/trash.png +0 -0
  15. assets/js/admin-column.js +238 -6
  16. assets/js/jquery.qtip.js +19 -0
  17. assets/ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  18. assets/ui-theme/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  19. assets/ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  20. assets/ui-theme/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  21. assets/ui-theme/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  22. assets/ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  23. assets/ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  24. assets/ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  25. assets/ui-theme/images/ui-icons_222222_256x240.png +0 -0
  26. assets/ui-theme/images/ui-icons_2e83ff_256x240.png +0 -0
  27. assets/ui-theme/images/ui-icons_454545_256x240.png +0 -0
  28. assets/ui-theme/images/ui-icons_888888_256x240.png +0 -0
  29. assets/ui-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  30. assets/ui-theme/jquery-ui-1.8.18.custom.css +120 -0
  31. classes/sortable.php +1076 -0
  32. classes/values.php +529 -0
  33. classes/values/comments.php +139 -0
  34. classes/values/link.php +97 -0
  35. classes/values/media.php +170 -0
  36. classes/values/posts.php +231 -0
  37. classes/values/users.php +116 -0
  38. codepress-admin-columns.php +1501 -817
  39. languages/codepress-admin-columns-nl_NL.mo +0 -0
  40. languages/codepress-admin-columns-nl_NL.po +342 -125
  41. languages/codepress-admin-columns-pl_PL.mo +0 -0
  42. languages/codepress-admin-columns-pl_PL.po +530 -0
  43. readme.txt +161 -26
  44. screenshot-1.png +0 -0
  45. screenshot-2.png +0 -0
  46. screenshot-3.png +0 -0
  47. screenshot-4.png +0 -0
  48. screenshot-5.png +0 -0
  49. screenshot-6.png +0 -0
  50. screenshot-7.png +0 -0
assets/css/admin-column.css CHANGED
@@ -1,15 +1,58 @@
1
- #general-cpac-settings {}
2
#cpac .postbox {
3
margin: 0 10px 10px 0;
4
}
5
#cpac .cpac-menu {
6
clear: both;
7
- float: left;
8
- width: 100%;
9
}
10
#icon-codepress-admin-columns {
11
background: transparent url('../images/icon.png') no-repeat 0 0;
12
}
13
#general-cpac-settings > .inside {
14
padding: 0;
15
margin: 0;
@@ -34,18 +77,30 @@
34
#general-cpac-settings table.form-table tr.bottom td {
35
border-bottom: none;
36
}
37
#general-cpac-settings .cpac-box {
38
position: relative;
39
}
40
#general-cpac-settings .cpac-option-list {
41
overflow: hidden;
42
- width: 360px;
43
}
44
#general-cpac-settings .cpac-reorder-msg {
45
- background: transparent url('../images/reorder.png') no-repeat scroll 0 0;
46
margin-left: 5px;
47
height: 23px;
48
- width: 171px;
49
clear: both;
50
}
51
#general-cpac-settings .cpac-option-list li {
@@ -63,19 +118,9 @@
63
background-image: -webkit-linear-gradient(top, #f9f9f9, #ececec);
64
background-image: linear-gradient(top, #f9f9f9, #ececec);
65
border-radius: 3px 3px 3px 3px;
66
- border: 1px solid #DFDFDF;
67
margin-top: 1px;
68
}
69
- #general-cpac-settings .cpac-option-list li.active {
70
- background-color: #d8d8d8;
71
- background-image: -ms-linear-gradient(top, #f0f0f0, #d8d8d8);
72
- background-image: -moz-linear-gradient(top, #f0f0f0, #d8d8d8);
73
- background-image: -o-linear-gradient(top, #f0f0f0, #d8d8d8);
74
- background-image: -webkit-gradient(linear, left top, left bottom, from(#f0f0f0), to(#d8d8d8));
75
- background-image: -webkit-linear-gradient(top, #f0f0f0, #d8d8d8);
76
- background-image: linear-gradient(top, #f0f0f0, #d8d8d8);
77
- border-color: #c5c5c5;
78
- }
79
#general-cpac-settings .cpac-option-list li .cpac-sort-handle {
80
background: transparent url('../images/sort.png') no-repeat 5px 5px;
81
width: 20px;
@@ -110,6 +155,7 @@
110
margin-right: 30px;
111
overflow: hidden;
112
height: 17px;
113
}
114
#general-cpac-settings .cpac-option-list li .cpac-type-options input {
115
margin-top: 6px;
@@ -130,6 +176,11 @@
130
text-indent: -999em;
131
overflow: hidden;
132
}
133
#general-cpac-settings .cpac-option-list li div.cpac-meta-title span {
134
display: inline-block;
135
margin: 5px 5px 0 0;
@@ -165,6 +216,31 @@
165
#general-cpac-settings .cpac-option-list li .cpac-type-inside select {
166
min-width: 184px;
167
}
168
#general-cpac-settings .cpac-add-column a {
169
display: block;
170
}
@@ -187,6 +263,123 @@
187
color: #832525;
188
text-shadow: none;
189
}
190
#restore-cpac-settings .inside {
191
padding: 10px;
192
}
@@ -207,8 +400,33 @@
207
#restore-cpac-settings .inside .description {
208
color: #832525;
209
}
210
#likethisplugin-cpac-settings {
211
- padding: 0 0 10px;
212
}
213
#likethisplugin-cpac-settings ul {
214
margin-left: 20px;
@@ -221,9 +439,85 @@
221
text-decoration: none;
222
}
223
#likethisplugin-cpac-settings li.donate_link a {
224
- color: green;
225
- text-decoration: underline;
226
}
227
#likethisplugin-cpac-settings li.donate_link a:hover {
228
color: darkgreen;
229
}
1
+ #cpac {
2
+ /* overflow: hidden; */
3
+ }
4
#cpac .postbox {
5
margin: 0 10px 10px 0;
6
}
7
#cpac .cpac-menu {
8
clear: both;
9
+ overflow: hidden;
10
+ margin-right: 276px;
11
+ }
12
+ #cpac .cpac-menu .subsubsub {
13
+ white-space: normal;
14
+ margin-right: 14px;
15
+ }
16
+ #cpac .cpac-settings-link {
17
+ float: right;
18
+ float: right;
19
+ margin: 12px 14px 5px 0;
20
+ background: transparent url('../images/settings.png') no-repeat 0 0;
21
+ padding-left: 20px;
22
+ text-decoration: none;
23
+ display: inline-block;
24
+ line-height: 16px;
25
+ }
26
+ #cpac .cpac-settings-link.current {
27
+ font-weight: bold;
28
+ }
29
+ #cpac .cpac-col-left {
30
+ /* width: 70%; */
31
+ clear: left;
32
+ float: left;
33
+ margin-right: -2000px;
34
+ width: 100%;
35
+ }
36
+ #cpac .cpac-col-left .metabox-holder {
37
+ margin-right: 276px;
38
+ }
39
+ #cpac .cpac-col-right {
40
+ /* width: 20%; */
41
+ margin-right: auto;
42
+ width: 266px;
43
+ float: right;
44
+ position: relative;
45
+ clear: right;
46
+ }
47
+ #cpac .cpac-col-right .inside {
48
+ padding: 0 10px;
49
}
50
#icon-codepress-admin-columns {
51
background: transparent url('../images/icon.png') no-repeat 0 0;
52
}
53
+
54
+ /* =General settings
55
+ -------------------------------------------------------------- */
56
#general-cpac-settings > .inside {
57
padding: 0;
58
margin: 0;
77
#general-cpac-settings table.form-table tr.bottom td {
78
border-bottom: none;
79
}
80
+ #general-cpac-settings a.go-to-screen {
81
+ display: block;
82
+ padding: 5px 0;
83
+ font-weight: normal;
84
+ text-decoration: none;
85
+ }
86
#general-cpac-settings .cpac-box {
87
position: relative;
88
}
89
#general-cpac-settings .cpac-option-list {
90
overflow: hidden;
91
+ width: 360px;
92
+ margin-bottom: 5px;
93
}
94
#general-cpac-settings .cpac-reorder-msg {
95
+ background: transparent url('../images/reorder_arrow.png') no-repeat scroll 0 0;
96
margin-left: 5px;
97
height: 23px;
98
+ line-height: 25px;
99
+ padding-left: 25px;
100
+ color: #727272;
101
+ font-size: 12px;
102
+ font-family: 'Trebuchet MS', Arial, Verdana;
103
+ font-style: italic;
104
clear: both;
105
}
106
#general-cpac-settings .cpac-option-list li {
118
background-image: -webkit-linear-gradient(top, #f9f9f9, #ececec);
119
background-image: linear-gradient(top, #f9f9f9, #ececec);
120
border-radius: 3px 3px 3px 3px;
121
+ border: 1px solid #cbcbcb;
122
margin-top: 1px;
123
}
124
#general-cpac-settings .cpac-option-list li .cpac-sort-handle {
125
background: transparent url('../images/sort.png') no-repeat 5px 5px;
126
width: 20px;
155
margin-right: 30px;
156
overflow: hidden;
157
height: 17px;
158
+ line-height: 17px;
159
}
160
#general-cpac-settings .cpac-option-list li .cpac-type-options input {
161
margin-top: 6px;
176
text-indent: -999em;
177
overflow: hidden;
178
}
179
+ #general-cpac-settings .cpac-option-list li.opened a.cpac-action {}
180
+ #general-cpac-settings .cpac-option-list li.active a.cpac-action {
181
+ background-position: 50% -66px;
182
+ }
183
+ #general-cpac-settings .cpac-option-list li.active.opened a.cpac-action {}
184
#general-cpac-settings .cpac-option-list li div.cpac-meta-title span {
185
display: inline-block;
186
margin: 5px 5px 0 0;
216
#general-cpac-settings .cpac-option-list li .cpac-type-inside select {
217
min-width: 184px;
218
}
219
+ #general-cpac-settings .cpac-option-list li .cpac-type-inside input.input-width {
220
+ min-width: 25px;
221
+ width: 25px;
222
+ border: none;
223
+ background: transparent;
224
+ padding: 0;
225
+ margin-left: 0px;
226
+ text-align: right;
227
+ }
228
+ #general-cpac-settings .cpac-option-list li .cpac-type-inside div.input-width-range {
229
+ display: inline-block;
230
+ min-width: 136px;
231
+ width: 136px;
232
+ margin: 8px 0 0;
233
+ position: relative;
234
+ }
235
+ #general-cpac-settings .cpac-option-list li .cpac-type-inside div.input-width-range .ui-slider-handle {
236
+ cursor:e-resize;
237
+ }
238
+ #general-cpac-settings .cpac-option-list li .cpac-type-inside div.description {
239
+ display: inline-block;
240
+ font-size: 11px;
241
+ padding: 0 4px 0 0;
242
+ width: 36px;
243
+ }
244
#general-cpac-settings .cpac-add-column a {
245
display: block;
246
}
263
color: #832525;
264
text-shadow: none;
265
}
266
+ #general-cpac-settings .cpac-option-list li.active {
267
+ background-color: #c7c7c7;
268
+ background-image: -ms-linear-gradient(top, #e9e9e9, #c7c7c7);
269
+ background-image: -moz-linear-gradient(top, #e9e9e9, #c7c7c7);
270
+ background-image: -o-linear-gradient(top, #e9e9e9, #c7c7c7);
271
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#e9e9e9), to(#c7c7c7));
272
+ background-image: -webkit-linear-gradient(top, #e9e9e9, #c7c7c7);
273
+ background-image: linear-gradient(top, #e9e9e9, #c7c7c7);
274
+ border-color: #aeaeae;
275
+ }
276
+ #general-cpac-settings .cpac-option-list li.active .cpac-sort-handle {
277
+ background-position: 5px -19px;
278
+ }
279
+ #general-cpac-settings .cpac-option-list li.active div.cpac-meta-title {
280
+ color: #151515;
281
+ }
282
+ #general-cpac-settings .cpac-option-list li.active div.cpac-meta-title span {
283
+ color: #5c5c5c
284
+ }
285
+
286
+ /* =Plugin settings (Options)
287
+ -------------------------------------------------------------- */
288
+ #cpac-box-plugin_settings {}
289
+ #cpac-box-plugin_settings > td {
290
+ border: none;
291
+ padding: 0;
292
+ margin: 0;
293
+ }
294
+ #cpac-box-plugin_settings table.nopadding {
295
+ border-collapse: separate;
296
+ border-spacing: 0;
297
+ border: none;
298
+ width: 100%;
299
+ }
300
+ #cpac-box-plugin_settings table.nopadding tr.last > td {
301
+ border-bottom: none;
302
+ border-top: none;
303
+ }
304
+ #cpac-box-plugin_settings table.addons {
305
+ /* max-width: 620px; */
306
+ }
307
+ #cpac-box-plugin_settings table.addons th.activation_type {
308
+ width: 110px;
309
+ }
310
+ #cpac-box-plugin_settings table.addons th.activation_status {
311
+ width: 90px;
312
+ }
313
+ #cpac-box-plugin_settings table.addons th.activation_code {
314
+ /* width: auto; */
315
+ min-width: 260px;
316
+ }
317
+ #cpac-box-plugin_settings table.addons th.activation_more {
318
+ /* min-width: 120px; */
319
+ text-align: left;
320
+ width: auto;
321
+ }
322
+ #cpac-box-plugin_settings table.addons td.activation_type span {
323
+ font-size: 14px;
324
+ display: inline-block;
325
+ background: transparent url('../images/information.png') no-repeat right 50%;
326
+ padding-right: 20px;
327
+ }
328
+ #cpac-box-plugin_settings table.addons td {
329
+ background: #ffffff;
330
+ /* vertical-align: middle; */
331
+ padding: 18px 10px;
332
+ }
333
+ #cpac-box-plugin_settings table.addons td.activation_code input {
334
+ width: 176px;
335
+ color: #555555;
336
+ font-family: Arial;
337
+ font-size: 12px;
338
+ }
339
+ #cpac-box-plugin_settings table.addons td.activation_more {
340
+ text-align: left;
341
+ }
342
+ #cpac-box-plugin_settings table.addons td.activation_more a{
343
+ float: none;
344
+ display: inline-block;
345
+ margin-top: 1px;
346
+ }
347
+ #cpac-box-plugin_settings table.addons tr.last td {
348
+ border-bottom: none;
349
+ }
350
+ #cpac-box-plugin_settings table.addons .masked_key {
351
+ padding: 0;
352
+ }
353
+ #cpac-box-plugin_settings .cpac-options {}
354
+ #cpac-box-plugin_settings .cpac-options li {
355
+ overflow: hidden;
356
+ }
357
+ #cpac-box-plugin_settings .cpac-option-label {
358
+ float: left;
359
+ width: 140px;
360
+ }
361
+ #cpac-box-plugin_settings .cpac-option-inputs {
362
+ float: left;
363
+ width: 220px;
364
+ }
365
+ #cpac-box-plugin_settings table.addons .button {
366
+ position: relative;
367
+ }
368
+ #cpac-box-plugin_settings table.addons .button.loading {
369
+ padding-right: 25px;
370
+ }
371
+ #cpac-box-plugin_settings table.addons .button.loading span {
372
+ position: absolute;
373
+ top: 2px;
374
+ right: 6px;
375
+ background: transparent url('../images/loading.gif') no-repeat right 50%;
376
+ width: 16px;
377
+ height: 16px;
378
+ display: inline-block;
379
+ }
380
+
381
+ /* =Restore settings
382
+ -------------------------------------------------------------- */
383
#restore-cpac-settings .inside {
384
padding: 10px;
385
}
400
#restore-cpac-settings .inside .description {
401
color: #832525;
402
}
403
+
404
+ /* =Addons settings
405
+ -------------------------------------------------------------- */
406
+ #addons-cpac-settings {
407
+ overflow: hidden;
408
+ }
409
+ #addons-cpac-settings h2 {
410
+ font-size: 14px;
411
+ line-height: 14px;
412
+ margin-bottom: 0;
413
+ padding-bottom: 0;
414
+ }
415
+ #addons-cpac-settings a {
416
+ padding: 0 10px 10px;
417
+ text-decoration: none;
418
+ color: green;
419
+ text-decoration: underline;
420
+ }
421
+ #addons-cpac-settings a:hover {
422
+ color: darkgreen;
423
+ }
424
+
425
+
426
+ /* =Like this plugin settings
427
+ -------------------------------------------------------------- */
428
#likethisplugin-cpac-settings {
429
+ padding: 0;
430
}
431
#likethisplugin-cpac-settings ul {
432
margin-left: 20px;
439
text-decoration: none;
440
}
441
#likethisplugin-cpac-settings li.donate_link a {
442
+ /* color: green;
443
+ text-decoration: underline; */
444
}
445
#likethisplugin-cpac-settings li.donate_link a:hover {
446
color: darkgreen;
447
+ }
448
+
449
+ /* =Activation
450
+ -------------------------------------------------------------- */
451
+ #cpac-box-plugin_settings .addons .activation_code .activate,
452
+ #cpac-box-plugin_settings .addons .activation_code .deactivate {
453
+ min-height: 25px;
454
+ }
455
+ #cpac-box-plugin_settings .activation_status .activate {
456
+ color: #CC0000;
457
+ }
458
+ #cpac-box-plugin_settings .activation_status .deactivate {
459
+ color: darkgreen;
460
+ }
461
+ #cpac-box-plugin_settings .activation-error-msg {
462
+ color: #CC0000;
463
+ line-height: 20px;
464
+ padding: 0 6px;
465
+ }
466
+
467
+ /* =Tooltip
468
+ -------------------------------------------------------------- */
469
+ .qtip .qtip-tip {
470
+ left: 74px !important;
471
+ top: 1px !important;
472
+ }
473
+ .qtip .qtip-wrapper {
474
+ background: #fff;
475
+ border-style: solid;
476
+ border-width: 1px;
477
+ border-color: #dfdfdf;
478
+ border-color: rgba(0,0,0,.125);
479
+ border-top: none;
480
+ -webkit-border-radius: 3px;
481
+ border-radius: 3px;
482
+ border-radius: 5px;
483
+ -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.19);
484
+ -moz-box-shadow: 0 2px 4px rgba(0,0,0,.19);
485
+ box-shadow: 0 2px 4px rgba(0,0,0,.19);
486
+
487
+ }
488
+ .qtip .qtip-wrapper .qtip_title {
489
+ padding: 15px 18px 14px 15px;
490
+ clear: both;
491
+ line-height: 1.4em;
492
+ font-size: 14px;
493
+ color: #fff;
494
+ border-radius: 3px 3px 0 0;
495
+ text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
496
+ background-color: #8cc1e9;
497
+ background-image: -webkit-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
498
+ background-image: -moz-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
499
+ background-image: -ms-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
500
+ background-image: -o-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
501
+ background-image: linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
502
+ }
503
+ .qtip .qtip-wrapper .qtip_content {
504
+ padding: 0 14px 14px;
505
+ margin: 0;
506
+ overflow: hidden;
507
+ clear: both;
508
+ min-height: 40px;
509
+ font-size: 13px;
510
+ background: #fff;
511
+ }
512
+ .qtip .qtip-wrapper .qtip_content .button-primary {
513
+ margin: 6px 0 0;
514
+ }
515
+
516
+ /* =Responsive Design
517
+ -------------------------------------------------------------- */
518
+ body.folded #cpac .cpac-col-left .metabox-holder {
519
+ margin-right: 0;
520
+ }
521
+ body.folded #cpac .cpac-col-right {
522
+ display: none;
523
}
assets/css/column.css CHANGED
@@ -1,4 +1,42 @@
1
.column-column-attachment img {
2
padding-right: 5px;
3
padding-bottom: 4px;
4
}
1
+ .cpac-column-value-image,
2
.column-column-attachment img {
3
padding-right: 5px;
4
padding-bottom: 4px;
5
+ }
6
+ .cpac-divider {
7
+ display: inline-block;
8
+ width: 14px;
9
+ height: 12px;
10
+ background: transparent url(../images/square.png) no-repeat 50% 7px;
11
+ }
12
+ span.status-open {}
13
+ span.status-closed {
14
+ color: red;
15
+ }
16
+
17
+ /* =Comment Counts column
18
+ -------------------------------------------------------------- */
19
+ .column-comment-count a.post-com-count {
20
+ display: inline-block;
21
+ }
22
+ .column-comment-count .description a {
23
+ display: inline-block;
24
+ height: 16px;
25
+ line-height: 16px;
26
+ padding: 3px 5px 3px 22px;
27
+ margin: 0 4px 4px 0;
28
+ background: #e4e4e4;
29
+ border-radius: 3px;
30
+ }
31
+ .column-comment-count a.cp-approved {
32
+ background: #e4e4e4 url(../images/checkmark.png) no-repeat 3px 50%;
33
+ }
34
+ .column-comment-count a.cp-moderated {
35
+ background: #e4e4e4 url(../images/comment_edit.png) no-repeat 3px 50%;
36
+ }
37
+ .column-comment-count a.cp-spam {
38
+ background: #e4e4e4 url(../images/no.png) no-repeat 3px 50%;
39
+ }
40
+ .column-comment-count a.cp-trash {
41
+ background: #e4e4e4 url(../images/trash.png) no-repeat 3px 50%;
42
}
assets/images/addon_sortable_1.png ADDED
Binary file
assets/images/arrows.png CHANGED
Binary file
assets/images/comment_edit.png ADDED
Binary file
assets/images/cross.png ADDED
Binary file
assets/images/information.png ADDED
Binary file
assets/images/loading.gif ADDED
Binary file
assets/images/no.png ADDED
Binary file
assets/images/reorder_arrow.png ADDED
Binary file
assets/images/settings.png ADDED
Binary file
assets/images/sort.png CHANGED
Binary file
assets/images/square.png ADDED
Binary file
assets/images/trash.png ADDED
Binary file
assets/js/admin-column.js CHANGED
@@ -2,12 +2,20 @@
2
* fires when the dom is ready
3
*
4
*/
5
- jQuery(document).ready(function(){
6
cpac_sortable();
7
cpac_checked();
8
cpac_box_events();
9
cpac_menu();
10
cpac_add_custom_column();
11
});
12
13
/**
@@ -15,7 +23,7 @@ jQuery(document).ready(function(){
15
*
16
*/
17
function cpac_sortable()
18
- {
19
jQuery('ul.cpac-option-list').sortable({
20
handle: 'div.cpac-sort-handle',
21
placeholder: 'cpac-placeholder',
@@ -38,7 +46,7 @@ function cpac_checked()
38
// toggle on
39
if ( value != 'on') {
40
li.addClass('active');
41
- state.attr('value', 'on');
42
}
43
44
// toggle off
@@ -59,7 +67,10 @@ function cpac_box_events()
59
// fold in/out
60
jQuery('#cpac .cpac-option-list .cpac-action').unbind('click').click(function(e){
61
e.preventDefault();
62
- jQuery(this).closest('li').find('.cpac-type-inside').slideToggle(150);
63
});
64
65
// remove custom field box
@@ -72,8 +83,7 @@ function cpac_box_events()
72
height: 0
73
}, 350, function() {
74
el.remove();
75
- });
76
-
77
});
78
}
79
@@ -189,4 +199,226 @@ function cpac_add_custom_column()
189
// retrigger click events
190
cpac_box_events();
191
});
192
}
2
* fires when the dom is ready
3
*
4
*/
5
+ jQuery(document).ready(function()
6
+ {
7
+ if (jQuery('#cpac').length == 0)
8
+ return false;
9
+
10
cpac_sortable();
11
cpac_checked();
12
cpac_box_events();
13
cpac_menu();
14
cpac_add_custom_column();
15
+ cpac_clear_input_defaults();
16
+ cpac_tooltips();
17
+ cpac_addon_activation();
18
+ cpac_width_range();
19
});
20
21
/**
23
*
24
*/
25
function cpac_sortable()
26
+ {
27
jQuery('ul.cpac-option-list').sortable({
28
handle: 'div.cpac-sort-handle',
29
placeholder: 'cpac-placeholder',
46
// toggle on
47
if ( value != 'on') {
48
li.addClass('active');
49
+ state.attr('value', 'on');
50
}
51
52
// toggle off
67
// fold in/out
68
jQuery('#cpac .cpac-option-list .cpac-action').unbind('click').click(function(e){
69
e.preventDefault();
70
+ var li = jQuery(this).closest('li');
71
+ li.find('.cpac-type-inside').slideToggle(150, function() {
72
+ li.toggleClass('opened');
73
+ });
74
});
75
76
// remove custom field box
83
height: 0
84
}, 350, function() {
85
el.remove();
86
+ });
87
});
88
}
89
199
// retrigger click events
200
cpac_box_events();
201
});
202
+ }
203
+
204
+ /**
205
+ * Clear Input Defaults
206
+ *
207
+ */
208
+ function cpac_clear_input_defaults()
209
+ {
210
+ jQuery.fn.cleardefault = function() {
211
+ return this.focus(function() {
212
+ if( this.value == this.defaultValue ) {
213
+ this.value = "";
214
+ }
215
+ }).blur(function() {
216
+ if( !this.value.length ) {
217
+ this.value = this.defaultValue;
218
+ }
219
+ });
220
+ };
221
+ jQuery("#cpac-box-plugin_settings .addons input").cleardefault();
222
+ }
223
+
224
+
225
+ /**
226
+ * Tooltip
227
+ *
228
+ */
229
+ function cpac_tooltips()
230
+ {
231
+ jQuery('#cpac .activation_type span').each(function() {
232
+ var info = jQuery(this).next('.cpac-tooltip').html();
233
+
234
+ if ( ! info )
235
+ return;
236
+
237
+ jQuery('#cpac .activation_type span').qtip({
238
+ content: info,
239
+ title: 'title',
240
+ style: {
241
+ width: 400,
242
+ padding: 0,
243
+ background: 'transparent',
244
+ color: 'black',
245
+ textAlign: 'left',
246
+ border: {
247
+ width: 0,
248
+ radius: 0
249
+ },
250
+ tip: {
251
+ corner: 'topMiddle',
252
+ color: '#8cc1e9',
253
+ size: {
254
+ x: 32,
255
+ y : 15
256
+ }
257
+ }
258
+ },
259
+ position: {
260
+ corner: {
261
+ target: 'bottomRight'
262
+ },
263
+ adjust: {
264
+ x: -80,
265
+ y: 0
266
+ }
267
+ },
268
+ hide: {
269
+ when: 'mouseout',
270
+ fixed: true ,
271
+ delay: 100
272
+ }
273
+ });
274
+ });
275
+ }
276
+
277
+ /**
278
+ * Width range
279
+ *
280
+ */
281
+ function cpac_width_range()
282
+ {
283
+ if ( jQuery('.input-width-range').length == false )
284
+ return;
285
+
286
+ // loop through all width-range-sliders
287
+ jQuery('.input-width-range').each( function(){
288
+
289
+ var input = jQuery(this).closest('.cpac-type-inside').find('.input-width');
290
+ var descr = jQuery(this).closest('.cpac-type-inside').find('.width-decription');
291
+ var input_default = jQuery(input)[0].defaultValue;
292
+ var translation_default = descr.attr('title');
293
+
294
+ // add slider
295
+ jQuery(this).slider({
296
+ range: 'min',
297
+ value: 1,
298
+ min: 0,
299
+ max: 100,
300
+ value: input_default,
301
+ slide: function( event, ui ) {
302
+
303
+ // set default
304
+ var descr_value = ui.value > 0 ? ui.value + '%' : translation_default;
305
+
306
+ // set input value
307
+ jQuery(input).val( ui.value );
308
+
309
+ // set description
310
+ jQuery(descr).text( descr_value );
311
+ }
312
+ });
313
+ });
314
+ }
315
+
316
+ /**
317
+ * Addon actviate/deactivate
318
+ *
319
+ */
320
+ function cpac_addon_activation()
321
+ {
322
+ jQuery('#cpac-box-plugin_settings .addons .activation_code a.button').click(function(e) {
323
+ e.preventDefault();
324
+
325
+ // get input values
326
+ var row = jQuery(this).closest('tr');
327
+ var type = jQuery(row).attr('id').replace('cpac-activation-','');
328
+ var parent_class = jQuery(this).parent('div');
329
+ var msg = jQuery(row).find('.activation-error-msg');
330
+
331
+ // get translated string
332
+ var translations = jQuery('#cpac-box-plugin_settings .addon-translation-string');
333
+ var msg_fillin = jQuery('.tstring-fill-in',translations).text();
334
+ var msg_unrecognised = jQuery('.tstring-unrecognised',translations).text();
335
+
336
+ // reset
337
+ jQuery(msg).empty();
338
+
339
+ // Activate
340
+ if ( parent_class.hasClass('activate') ) {
341
+
342
+ // get input values
343
+ var input = jQuery('.activate input', row);
344
+ var button = jQuery('.activate .button', row);
345
+ var key = input.val();
346
+ var default_val = jQuery(input)[0].defaultValue;
347
+
348
+ // make sure the input value has changed
349
+ if ( key == default_val ) {
350
+ jQuery(msg).text(msg_fillin).hide().fadeIn();
351
+ return false;
352
+ }
353
+
354
+ // set loading icon
355
+ button.addClass('loading');
356
+
357
+ // update key
358
+ jQuery.ajax({
359
+ url : ajaxurl,
360
+ type : 'POST',
361
+ dataType : 'json',
362
+ data : {
363
+ action : 'cpac_addon_activation',
364
+ type : 'sortable',
365
+ key : key
366
+ },
367
+ success: function(data) {
368
+ if ( data != null ) {
369
+ jQuery('div.activate', row).hide(); // hide activation button
370
+ jQuery('div.deactivate', row).show(); // show deactivation button
371
+ jQuery('div.deactivate span.masked_key', row).text(data); // display the returned masked key
372
+ } else {
373
+ jQuery(msg).text(msg_unrecognised).hide().fadeIn();
374
+ }
375
+ },
376
+ error: function(xhr, ajaxOptions, thrownError) {
377
+ //console.log(xhr);
378
+ //console.log(ajaxOptions);
379
+ //console.log(thrownError);
380
+ jQuery(msg).text(msg_unrecognised).hide().fadeIn();
381
+ },
382
+ complete: function() {
383
+ button.removeClass('loading');
384
+ }
385
+ });
386
+ }
387
+
388
+ // Deactivate
389
+ if ( parent_class.hasClass('deactivate') ) {
390
+
391
+ var button = jQuery('.deactivate .button', row);
392
+ var input = jQuery('.activate input', row);
393
+
394
+ // set loading icon
395
+ button.addClass('loading');
396
+
397
+ // update key
398
+ jQuery.ajax({
399
+ url : ajaxurl,
400
+ type : 'POST',
401
+ dataType : 'json',
402
+ data : {
403
+ action : 'cpac_addon_activation',
404
+ type : 'sortable',
405
+ key : 'remove'
406
+ },
407
+ success: function(data) {
408
+ jQuery('div.activate', row).show(); // show activation button
409
+ jQuery('div.deactivate', row).hide(); // hide deactivation button
410
+ jQuery('div.deactivate span.masked_key', row).empty(); // remove masked key
411
+ input.val('');
412
+ },
413
+ error: function(xhr, ajaxOptions, thrownError) {
414
+ //console.log(xhr);
415
+ //console.log(ajaxOptions);
416
+ //console.log(thrownError);
417
+ },
418
+ complete: function() {
419
+ button.removeClass('loading');
420
+ }
421
+ });
422
+ }
423
+ });
424
}
assets/js/jquery.qtip.js ADDED
@@ -0,0 +1,19 @@
1
+ /*
2
+ * jquery.qtip. The jQuery tooltip plugin
3
+ *
4
+ * Copyright (c) 2009 Craig Thompson
5
+ * http://craigsworks.com
6
+ *
7
+ * Licensed under MIT
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ *
10
+ * Launch : February 2009
11
+ * Version : 1.0.0-rc3
12
+ * Released: Tuesday 12th May, 2009 - 00:00
13
+ * Debug: jquery.qtip.debug.js
14
+ */
15
+ (function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y<A.length;y++){if(w=="destroy"){A[y].destroy()}else{if(A[y].status.rendered===true){if(w=="show"){A[y].show()}else{if(w=="hide"){A[y].hide()}else{if(w=="focus"){A[y].focus()}else{if(w=="disable"){A[y].disable(true)}else{if(w=="enable"){A[y].disable(false)}}}}}}}}}}}else{v=f.extend(true,{},s);v.hide.effect.length=s.hide.effect.length;v.show.effect.length=s.show.effect.length;if(v.position.container===false){v.position.container=f(document.body)}if(v.position.target===false){v.position.target=f(this)}if(v.show.when.target===false){v.show.when.target=f(this)}if(v.hide.when.target===false){v.hide.when.target=f(this)}t=f.fn.qtip.interfaces.length;for(y=0;y<t;y++){if(typeof f.fn.qtip.interfaces[y]=="undefined"){t=y;break}}x=new d(f(this),v,t);f.fn.qtip.interfaces[t]=x;if(typeof f(this).data("qtip")=="object"){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(x)}else{f(this).data("qtip",{current:0,interfaces:[x]})}if(v.content.prerender===false&&v.show.when.event!==false&&v.show.ready!==true){v.show.when.target.bind(v.show.when.event+".qtip-"+t+"-create",{qtip:t},function(C){z=f.fn.qtip.interfaces[C.data.qtip];z.options.show.when.target.unbind(z.options.show.when.event+".qtip-"+C.data.qtip+"-create");z.cache.mouse={x:C.pageX,y:C.pageY};p.call(z);z.options.show.when.target.trigger(z.options.show.when.event)})}else{x.cache.mouse={x:v.show.when.target.offset().left,y:v.show.when.target.offset().top};p.call(x)}}})};function d(u,t,v){var s=this;s.id=v;s.options=t;s.status={animated:false,rendered:false,disabled:false,focused:false};s.elements={target:u.addClass(s.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};s.cache={mouse:{},position:{},toggle:0};s.timers={};f.extend(s,s.options.api,{show:function(y){var x,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(s.elements.tooltip.css("display")!=="none"){return s}s.elements.tooltip.stop(true,false);x=s.beforeShow.call(s,y);if(x===false){return s}function w(){if(s.options.position.type!=="static"){s.focus()}s.onShow.call(s,y);if(f.browser.msie){s.elements.tooltip.get(0).style.removeAttribute("filter")}}s.cache.toggle=1;if(s.options.position.type!=="static"){s.updatePosition(y,(s.options.show.effect.length>0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;C<J.length;C++){J[C]=parseInt(J[C])}H=s.options.position.target.parent("map").attr("name");E=f('img[usemap="#'+H+'"]:first').offset();G.position={left:Math.floor(E.left+J[0]),top:Math.floor(E.top+J[1])};switch(s.options.position.target.attr("shape").toLowerCase()){case"rect":G.dimensions={width:Math.ceil(Math.abs(J[2]-J[0])),height:Math.ceil(Math.abs(J[3]-J[1]))};break;case"circle":G.dimensions={width:J[2]+1,height:J[2]+1};break;case"poly":G.dimensions={width:J[0],height:J[1]};for(C=0;C<J.length;C++){if(C%2==0){if(J[C]>G.dimensions.width){G.dimensions.width=J[C]}if(J[C]<J[0]){G.position.left=Math.floor(E.left+J[C])}}else{if(J[C]>G.dimensions.height){G.dimensions.height=J[C]}if(J[C]<J[1]){G.position.top=Math.floor(E.top+J[C])}}}G.dimensions.width=G.dimensions.width-(G.position.left-E.left);G.dimensions.height=G.dimensions.height-(G.position.top-E.top);break;default:return f.fn.qtip.log.error.call(s,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}G.dimensions.width-=2;G.dimensions.height-=2}else{if(s.options.position.target.add(document.body).length===1){G.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};G.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof s.options.position.target.attr("qtip")!=="undefined"){G.position=s.options.position.target.qtip("api").cache.position}else{G.position=s.options.position.target.offset()}G.dimensions={height:s.options.position.target.outerHeight(),width:s.options.position.target.outerWidth()}}}y=f.extend({},G.position);if(G.corner.search(/right/i)!==-1){y.left+=G.dimensions.width}if(G.corner.search(/bottom/i)!==-1){y.top+=G.dimensions.height}if(G.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left+=(G.dimensions.width/2)}if(G.corner.search(/((left|right)Middle)|center/)!==-1){y.top+=(G.dimensions.height/2)}}else{G.position=y={left:s.cache.mouse.x,top:s.cache.mouse.y};G.dimensions={height:1,width:1}}if(L.corner.search(/right/i)!==-1){y.left-=L.dimensions.width}if(L.corner.search(/bottom/i)!==-1){y.top-=L.dimensions.height}if(L.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left-=(L.dimensions.width/2)}if(L.corner.search(/((left|right)Middle)|center/)!==-1){y.top-=(L.dimensions.height/2)}I=(f.browser.msie)?1:0;B=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(s.options.style.border.radius>0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w<s.options.style.width.min){w=s.options.style.width.min}}}}if(w%2!==0){w-=1}s.elements.tooltip.width(w);x.show();if(s.options.style.border.radius){s.elements.tooltip.find(".qtip-betweenCorners").each(function(y){f(this).width(w-(s.options.style.border.radius*2))})}if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"1"});s.elements.wrapper.width(w);if(s.elements.bgiframe){s.elements.bgiframe.width(w).height(s.getDimensions.height)}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(w){var z,A,x,y,B;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof w!=="string"||!f.fn.qtip.styles[w]){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}s.options.style=a.call(s,f.fn.qtip.styles[w],s.options.user.style);s.elements.content.css(q(s.options.style));if(s.options.content.title.text!==false){s.elements.title.css(q(s.options.style.title,true))}s.elements.contentWrapper.css({borderColor:s.options.style.border.color});if(s.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("<canvas>").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w<y.length-1;w++){if(y[w].id==s.id){y.splice(w,1)}}}}delete f.fn.qtip.interfaces[s.id];if(typeof y=="object"&&y.length>0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='<div qtip="'+s.id+'" class="qtip '+(s.options.style.classes.tooltip||s.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+s.options.position.type+';"> <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;"> <div class="qtip-contentWrapper" style="overflow:hidden;"> <div class="qtip-content '+s.options.style.classes.content+'"></div></div></div></div>';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","<br />");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","<br />");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='<div rel="'+z+'" style="'+((z.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+B+"px; width:"+B+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){u[z]+='<canvas height="'+B+'" width="'+B+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){G=B*2+3;u[z]+='<v:arc stroked="false" fillcolor="'+x+'" startangle="'+E[z][0]+'" endangle="'+E[z][1]+'" style="width:'+G+"px; height:"+G+"px; margin-top:"+((z.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((z.search(/Right/)!==-1)?E[z][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}u[z]+="</div>"}D=F.getDimensions().width-(Math.max(t,B)*2);y='<div class="qtip-betweenCorners" style="height:'+B+"px; width:"+D+"px; overflow:hidden; background-color:"+x+'; line-height:0.1px; font-size:1px;">';w='<div class="qtip-borderTop" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='<div class="qtip-borderBottom" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("<canvas>").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='<div class="'+t.options.style.classes.tip+'" dir="ltr" rel="'+v+'" style="position:absolute; height:'+t.options.style.tip.size.height+"px; width:"+t.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){t.elements.tip+='<canvas height="'+t.options.style.tip.size.height+'" width="'+t.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='<v:shape fillcolor="'+s+'" stroked="false" filled="true" path="'+w+'" coordsize="'+u+'" style="width:'+t.options.style.tip.size.width+"px; height:"+t.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((v.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';t.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"</div>");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('<div class="'+s.options.style.classes.title+'">').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('<a class="'+s.options.style.classes.button+'" style="float:right; position: relative"></a>').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left<f.fn.qtip.cache.screen.scroll.left),right:(s.left+A.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top<f.fn.qtip.cache.screen.scroll.top),bottom:(s.top+A.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t<arguments.length;t++){u.push(arguments[t])}x=[f.extend.apply(f,u)];while(typeof x[0].name=="string"){x.unshift(c(f.fn.qtip.styles[x[0].name]))}x.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);v=f.extend.apply(f,x);w=(f.browser.msie)?1:0;v.tip.size.width+=w;v.tip.size.height+=w;if(v.tip.size.width%2>0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("<canvas>").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+u.height+"px; width:"+u.width+'px" />';s.elements.bgiframe=s.elements.wrapper.prepend(t).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var s;f(window).bind("resize scroll",function(t){clearTimeout(s);s=setTimeout(function(){if(t.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var u=f.fn.qtip.interfaces[i];if(u.status.rendered===true&&(u.options.position.type!=="static"||u.options.position.adjust.scroll&&t.type==="scroll"||u.options.position.adjust.resize&&t.type==="resize")){u.updatePosition(t,true)}}},100)});f(document).bind("mousedown.qtip",function(t){if(f(t.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var u=f(this).qtip("api");if(f(this).is(":visible")&&!u.status.disabled&&f(t.target).add(u.elements.target).length>1){u.hide(t)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}})(jQuery);
16
+
17
+
18
+
19
+
assets/ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
assets/ui-theme/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
assets/ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
assets/ui-theme/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
assets/ui-theme/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
assets/ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
assets/ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
assets/ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
assets/ui-theme/images/ui-icons_222222_256x240.png ADDED
Binary file
assets/ui-theme/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
assets/ui-theme/images/ui-icons_454545_256x240.png ADDED
Binary file
assets/ui-theme/images/ui-icons_888888_256x240.png ADDED
Binary file
assets/ui-theme/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
assets/ui-theme/jquery-ui-1.8.18.custom.css ADDED
@@ -0,0 +1,120 @@
1
+ /*
2
+ * jQuery UI CSS Framework 1.8.18
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Theming/API
9
+ */
10
+
11
+ /* Layout helpers
12
+ ----------------------------------*/
13
+ .ui-helper-hidden { display: none; }
14
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
+ .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
17
+ .ui-helper-clearfix:after { clear: both; }
18
+ .ui-helper-clearfix { zoom: 1; }
19
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
20
+
21
+
22
+ /* Interaction Cues
23
+ ----------------------------------*/
24
+ .ui-state-disabled { cursor: default !important; }
25
+
26
+
27
+ /* Icons
28
+ ----------------------------------*/
29
+
30
+ /* states and images */
31
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
32
+
33
+
34
+ /* Misc visuals
35
+ ----------------------------------*/
36
+
37
+ /* Overlays */
38
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
39
+
40
+
41
+ /*
42
+ * jQuery UI CSS Framework 1.8.18
43
+ *
44
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
45
+ * Dual licensed under the MIT or GPL Version 2 licenses.
46
+ * http://jquery.org/license
47
+ *
48
+ * http://docs.jquery.com/UI/Theming/API
49
+ *
50
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
51
+ */
52
+
53
+
54
+ /* Component containers
55
+ ----------------------------------*/
56
+ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
57
+ .ui-widget .ui-widget { font-size: 1em; }
58
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
59
+ .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
60
+ .ui-widget-content a { color: #222222; }
61
+ .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
62
+ .ui-widget-header a { color: #222222; }
63
+
64
+ /* Interaction states
65
+ ----------------------------------*/
66
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
67
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
68
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
69
+ .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
70
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
71
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
72
+ .ui-widget :active { outline: none; }
73
+
74
+ /* Interaction Cues
75
+ ----------------------------------*/
76
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
77
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
78
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
79
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
80
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
81
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
82
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
83
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
84
+
85
+
86
+ /* Misc visuals
87
+ ----------------------------------*/
88
+
89
+ /* Corner radius */
90
+ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
91
+ .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
92
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
93
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
94
+
95
+ /* Overlays */
96
+ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
97
+ .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
98
+ * jQuery UI Slider 1.8.18
99
+ *
100
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
101
+ * Dual licensed under the MIT or GPL Version 2 licenses.
102
+ * http://jquery.org/license
103
+ *
104
+ * http://docs.jquery.com/UI/Slider#theming
105
+ */
106
+ .ui-slider { position: relative; text-align: left; }
107
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 12px; height: 12px; cursor: default; }
108
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
109
+
110
+ .ui-slider-horizontal { height: 8px; }
111
+ .ui-slider-horizontal .ui-slider-handle { top: -3px; margin-left: -4px; }
112
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
113
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
114
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
115
+
116
+ .ui-slider-vertical { width: .8em; height: 100px; }
117
+ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
118
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
119
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
120
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }
classes/sortable.php ADDED
@@ -0,0 +1,1076 @@
1
+ <?php
2
+
3
+ /**
4
+ * Coderess Sortable Columns Class
5
+ *
6
+ * @since 1.3
7
+ *
8
+ */
9
+ class Codepress_Sortable_Columns extends Codepress_Admin_Columns
10
+ {
11
+ private $post_types,
12
+ $unlocked,
13
+ $show_all_results;
14
+
15
+ /**
16
+ * Constructor
17
+ *
18
+ * @since 1.0
19
+ */
20
+ function __construct()
21
+ {
22
+ add_action( 'wp_loaded', array( $this, 'init') );
23
+ }
24
+
25
+ /**
26
+ * Initialize
27
+ *
28
+ * @since 1.0
29
+ */
30
+ public function init()
31
+ {
32
+ // vars
33
+ $this->unlocked = $this->is_unlocked('sortable');
34
+ $this->post_types = Codepress_Admin_Columns::get_post_types();
35
+ $this->show_all_results = false;
36
+
37
+ // init sorting
38
+ add_action( 'admin_init', array( $this, 'register_sortable_columns' ) );
39
+
40
+ // init filtering
41
+ // add_action( 'admin_init', array( $this, 'register_filtering_columns' ) );
42
+
43
+ // handle requests for sorting columns
44
+ add_filter( 'request', array( $this, 'handle_requests_orderby_column'), 1 );
45
+ add_action( 'pre_user_query', array( $this, 'handle_requests_orderby_users_column'), 1 );
46
+ add_action( 'admin_init', array( $this, 'handle_requests_orderby_links_column'), 1 );
47
+ add_action( 'admin_init', array( $this, 'handle_requests_orderby_comments_column'), 1 );
48
+ }
49
+
50
+ /**
51
+ * Register sortable columns
52
+ *
53
+ * Hooks into apply_filters( "manage_{$screen->id}_sortable_columns" ) which is found in class-wp-list-table.php
54
+ *
55
+ * @since 1.0
56
+ */
57
+ function register_sortable_columns()
58
+ {
59
+ if ( ! $this->unlocked )
60
+ return false;
61
+
62
+ /** Posts */
63
+ foreach ( $this->post_types as $post_type )
64
+ add_filter( "manage_edit-{$post_type}_sortable_columns", array($this, 'callback_add_sortable_posts_column'));
65
+
66
+ /** Users */
67
+ add_filter( "manage_users_sortable_columns", array($this, 'callback_add_sortable_users_column'));
68
+
69
+ /** Media */
70
+ add_filter( "manage_upload_sortable_columns", array($this, 'callback_add_sortable_media_column'));
71
+
72
+ /** Links */
73
+ add_filter( "manage_link-manager_sortable_columns", array($this, 'callback_add_sortable_links_column'));
74
+
75
+ /** Comments */
76
+ add_filter( "manage_edit-comments_sortable_columns", array($this, 'callback_add_sortable_comments_column'));
77
+ }
78
+
79
+ /**
80
+ * Callback add Posts sortable column
81
+ *
82
+ * @since 1.0
83
+ */
84
+ public function callback_add_sortable_posts_column($columns)
85
+ {
86
+ global $post_type;
87
+
88
+ return $this->add_managed_sortable_columns($post_type, $columns);
89
+ }
90
+
91
+ /**
92
+ * Callback add Users sortable column
93
+ *
94
+ * @since 1.1
95
+ */
96
+ public function callback_add_sortable_users_column($columns)
97
+ {
98
+ return $this->add_managed_sortable_columns('wp-users', $columns);
99
+ }
100
+
101
+ /**
102
+ * Callback add Media sortable column
103
+ *
104
+ * @since 1.3
105
+ */
106
+ public function callback_add_sortable_media_column($columns)
107
+ {
108
+ return $this->add_managed_sortable_columns('wp-media', $columns);
109
+ }
110
+
111
+ /**
112
+ * Callback add Links sortable column
113
+ *
114
+ * @since 1.3.1
115
+ */
116
+ public function callback_add_sortable_links_column($columns)
117
+ {
118
+ return $this->add_managed_sortable_columns('wp-links', $columns);
119
+ }
120
+
121
+ /**
122
+ * Callback add Comments sortable column
123
+ *
124
+ * @since 1.3.1
125
+ */
126
+ public function callback_add_sortable_comments_column($columns)
127
+ {
128
+ return $this->add_managed_sortable_columns('wp-comments', $columns);
129
+ }
130
+
131
+ /**
132
+ * Add managed sortable columns by Type
133
+ *
134
+ * @since 1.1
135
+ */
136
+ private function add_managed_sortable_columns( $type = 'post', $columns )
137
+ {
138
+ $display_columns = $this->get_merged_columns($type);
139
+
140
+ if ( ! $display_columns )
141
+ return $columns;
142
+
143
+ foreach ( $display_columns as $id => $vars ) {
144
+ if ( isset($vars['options']['sortorder']) && $vars['options']['sortorder'] == 'on' ){
145
+
146
+ // register format
147
+ $columns[$id] = $this->sanitize_string($vars['label']);
148
+ }
149
+ }
150
+
151
+ return $columns;
152
+ }
153
+
154
+ /**
155
+ * Admin requests for orderby column
156
+ *
157
+ * Only works for WP_Query objects ( such as posts and media )
158
+ *
159
+ * @since 1.0
160
+ */
161
+ public function handle_requests_orderby_column( $vars )
162
+ {
163
+ if ( ! isset( $vars['orderby'] ) )
164
+ return $vars;
165
+
166
+ /** Users */
167
+ // You would expect to see get_orderby_users_vars(), but sorting for
168
+ // users is handled through a different filter. Not 'request', but 'pre_user_query'.
169
+ // See handle_requests_orderby_users_column().
170
+
171
+ /** Media */
172
+ elseif ( $this->request_uri_is('upload') )
173
+ $vars = $this->get_orderby_media_vars($vars);
174
+
175
+ /** Posts */
176
+ elseif ( !empty($vars['post_type']) )
177
+ $vars = $this->get_orderby_posts_vars($vars);
178
+
179
+ return $vars;
180
+ }
181
+
182
+ /**
183
+ * Orderby Users column
184
+ *
185
+ * @since 1.3
186
+ */
187
+ public function handle_requests_orderby_users_column($user_query)
188
+ {
189
+ //print_r($user_query); exit;
190
+
191
+ // query vars
192
+ $vars = $user_query->query_vars;
193
+
194
+ // Column
195
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-users' );
196
+
197
+ if ( empty($column) )
198
+ return $vars;
199
+
200
+ // id
201
+ $id = key($column);
202
+
203
+ // type
204
+ $type = $id;
205
+
206
+ // Check for user custom fields: column-meta-[customfieldname]
207
+ if ( Codepress_Admin_Columns::is_column_meta($type) )
208
+ $type = 'column-user-meta';
209
+
210
+ // Check for post count: column-user_postcount-[posttype]
211
+ if ( $this->get_posttype_by_postcount_column($type) )
212
+ $type = 'column-user_postcount';
213
+
214
+ // var
215
+ $cusers = array();
216
+ switch( $type ) :
217
+
218
+ case 'column-user_id':
219
+ $user_query->query_orderby = "ORDER BY ID {$user_query->query_vars['order']}";
220
+ $user_query->query_vars['orderby'] = 'ID';
221
+ break;
222
+
223
+ case 'column-user_registered':
224
+ $user_query->query_orderby = "ORDER BY user_registered {$user_query->query_vars['order']}";
225
+ $user_query->query_vars['orderby'] = 'registered';
226
+ break;
227
+
228
+ case 'column-nickname' :
229
+ $sort_flag = SORT_REGULAR;
230
+ foreach ( $this->get_users_data() as $u ) {
231
+ if ($u->nickname || $this->show_all_results ) {
232
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->nickname);
233
+ }
234
+ }
235
+ break;
236
+
237
+ case 'column-first_name' :
238
+ $sort_flag = SORT_REGULAR;
239
+ foreach ( $this->get_users_data() as $u ) {
240
+ if ($u->first_name || $this->show_all_results ) {
241
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->first_name);
242
+ }
243
+ }
244
+ break;
245
+
246
+ case 'column-last_name' :
247
+ $sort_flag = SORT_REGULAR;
248
+ foreach ( $this->get_users_data() as $u ) {
249
+ if ($u->last_name || $this->show_all_results ) {
250
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->last_name);
251
+ }
252
+ }
253
+ break;
254
+
255
+ case 'column-user_url' :
256
+ $sort_flag = SORT_REGULAR;
257
+ foreach ( $this->get_users_data() as $u ) {
258
+ if ($u->user_url || $this->show_all_results ) {
259
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->user_url);
260
+ }
261
+ }
262
+ break;
263
+
264
+ case 'column-user_description' :
265
+ $sort_flag = SORT_REGULAR;
266
+ foreach ( $this->get_users_data() as $u ) {
267
+ if ($u->user_description || $this->show_all_results ) {
268
+ $cusers[$u->ID] = $this->prepare_sort_string_value($u->user_description);
269
+ }
270
+ }
271
+ break;
272
+
273
+ case 'column-user_postcount' :
274
+ $post_type = $this->get_posttype_by_postcount_column($id);
275
+ if ( $post_type ) {
276
+ $sort_flag = SORT_REGULAR;
277
+ foreach ( $this->get_users_data() as $u ) {
278
+ $count = $this->get_post_count( $post_type, $u->ID );
279
+ $cusers[$u->ID] = $this->prepare_sort_string_value($count);
280
+ }
281
+ }
282
+ break;
283
+
284
+ case 'role' :
285
+ $sort_flag = SORT_REGULAR;
286
+ foreach ( $this->get_users_data() as $u ) {
287
+ $role = !empty($u->roles[0]) ? $u->roles[0] : '';
288
+ if ($role || $this->show_all_results ) {
289
+ $cusers[$u->ID] = $this->prepare_sort_string_value($role);
290
+ }
291
+ }
292
+ break;
293
+
294
+ case 'column-user-meta' :
295
+ $field = $column[$id]['field'];
296
+ if ( $field ) {
297
+
298
+ // order numeric or string
299
+ $sort_flag = SORT_REGULAR;
300
+ if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' ) {
301
+ $sort_flag = SORT_NUMERIC;
302
+ }
303
+
304
+ // sort by metavalue
305
+ foreach ( $this->get_users_data() as $u ) {
306
+ $value = get_metadata('user', $u->ID, $field, true);
307
+ $cusers[$u->ID] = $this->prepare_sort_string_value($value);
308
+ }
309
+ }
310
+ break;
311
+
312
+ endswitch;
313
+
314
+ if ( isset($sort_flag) ) {
315
+ $user_query = $this->get_users_query_vars( $user_query, $cusers, $sort_flag );
316
+ }
317
+
318
+ return $user_query;
319
+ }
320
+
321
+ /**
322
+ * Orderby Links column
323
+ *
324
+ * Makes use of filter 'get_bookmarks' from bookmark.php to change the result set of the links
325
+ *
326
+ * @since 1.3.1
327
+ */
328
+ public function handle_requests_orderby_links_column()
329
+ {
330
+ // fire only when we are in the admins link-manager
331
+ if ( $this->request_uri_is('link-manager') )
332
+ add_filter( 'get_bookmarks', array( $this, 'callback_requests_orderby_links_column'), 10, 2);
333
+ }
334
+
335
+ /**
336
+ * Orderby Links column
337
+ *
338
+ * @since 1.3.1
339
+ */
340
+ public function callback_requests_orderby_links_column($results, $vars)
341
+ {
342
+ global $wpdb;
343
+
344
+ // Column
345
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-links' );
346
+
347
+ if ( empty($column) )
348
+ return $results;
349
+
350
+ // id
351
+ $type = $id = key($column);
352
+
353
+ // var
354
+ $length = '';
355
+ switch( $type ) :
356
+
357
+ case 'column-link_id':
358
+ if ( version_compare( get_bloginfo('version'), '3.2', '>' ) )
359
+ $vars['orderby'] = 'link_id';
360
+ else
361
+ $vars['orderby'] = 'id';
362
+ break;
363
+
364
+ case 'column-owner':
365
+ $vars['orderby'] = 'link_owner';
366
+ break;
367
+
368
+ case 'column-length':
369
+ $vars['orderby'] = 'length';
370
+ $length = ", CHAR_LENGTH(link_name) AS length";
371
+ break;
372
+
373
+ case 'column-target':
374
+ $vars['orderby'] = 'link_target';
375
+ break;
376
+
377
+ case 'column-description':
378
+ $vars['orderby'] = 'link_description';
379
+ break;
380
+
381
+ case 'column-notes':
382
+ $vars['orderby'] = 'link_notes';
383
+ break;
384
+
385
+ case 'column-rss':
386
+ $vars['orderby'] = 'link_rss';
387
+ break;
388
+
389
+ /** native WP columns */
390
+
391
+ // Relationship
392
+ case 'rel':
393
+ $vars['orderby'] = 'link_rel';
394
+ break;
395
+
396
+ default:
397
+ $vars['orderby'] = '';
398
+
399
+ endswitch;
400
+
401
+ // get bookmarks by orderby vars
402
+ if ( $vars['orderby'] ) {
403
+ $vars['order'] = mysql_escape_string($vars['order']);
404
+ $sql = "SELECT * {$length} FROM {$wpdb->links} WHERE 1=1 ORDER BY {$vars['orderby']} {$vars['order']}";
405
+ $results = $wpdb->get_results($sql);
406
+
407
+ // check for errors
408
+ if( is_wp_error($results) )
409
+ return false;
410
+ }
411
+
412
+ return $results;
413
+ }
414
+
415
+ /**
416
+ * Orderby Comments column
417
+ *
418
+ * @since 1.3.1
419
+ */
420
+ public function callback_requests_orderby_comments_column($pieces, $ref_comment)
421
+ {
422
+ // get query vars
423
+ $vars = $ref_comment->query_vars;
424
+
425
+ // Column
426
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-comments' );
427
+
428
+ if ( empty($column) )
429
+ return $pieces;
430
+
431
+ // id
432
+ $type = $id = key($column);
433
+
434
+ // var
435
+ switch( $type ) :
436
+
437
+ case 'column-comment_id':
438
+ $pieces['orderby'] = 'comment_ID';
439
+ break;
440
+
441
+ case 'column-author_author':
442
+ $pieces['orderby'] = 'comment_author';
443
+ break;
444
+
445
+ case 'column-author_ip':
446
+ $pieces['orderby'] = 'comment_author_IP';
447
+ break;
448
+
449
+ case 'column-author_url':
450
+ $pieces['orderby'] = 'comment_author_url';
451
+ break;
452
+
453
+ case 'column-author_email':
454
+ $pieces['orderby'] = 'comment_author_email';
455
+ break;
456
+
457
+ case 'column-reply_to':
458
+ break;
459
+
460
+ case 'column-approved':
461
+ $pieces['orderby'] = 'comment_approved';
462
+ break;
463
+
464
+ case 'column-date':
465
+ $pieces['orderby'] = 'comment_date';
466
+ break;
467
+
468
+ case 'column-agent':
469
+ $pieces['orderby'] = 'comment_agent';
470
+ break;
471
+
472
+ case 'column-excerpt':
473
+ $pieces['orderby'] = 'comment_content';
474
+ break;
475
+
476
+ case 'column-date_gmt':
477
+ // is default
478
+ break;
479
+
480
+ /** native WP columns */
481
+
482
+ // Relationship
483
+ case 'comment':
484
+ $pieces['orderby'] = 'comment_content';
485
+ break;
486
+
487
+ default:
488
+ $vars['orderby'] = '';
489
+
490
+ endswitch;
491
+
492
+ return $pieces;
493
+ }
494
+
495
+ /**
496
+ * Orderby Comments column
497
+ *
498
+ * @since 1.3.1
499
+ */
500
+ public function handle_requests_orderby_comments_column()
501
+ {
502
+ // fire only when we are in the admins edit-comments
503
+ if ( $this->request_uri_is('edit-comments') ) {
504
+ add_filter('comments_clauses', array( $this, 'callback_requests_orderby_comments_column'), 10, 2);
505
+ }
506
+ }
507
+
508
+ /**
509
+ * Get sorting vars in User Query Object
510
+ *
511
+ * @since 1.3
512
+ */
513
+ private function get_users_query_vars( $user_query, $sortusers, $sort_flags = SORT_REGULAR )
514
+ {
515
+ global $wpdb;
516
+
517
+ // vars
518
+ $vars = $user_query->query_vars;
519
+
520
+ // sorting
521
+ if ( $vars['order'] == 'ASC' )
522
+ asort($sortusers, $sort_flags);
523
+ else
524
+ arsort($sortusers, $sort_flags);
525
+
526
+ // alter orderby SQL
527
+ if ( ! empty ( $sortusers ) ) {
528
+ $ids = implode(',', array_keys($sortusers));
529
+ $user_query->query_where .= " AND {$wpdb->prefix}users.ID IN ({$ids})";
530
+ $user_query->query_orderby = "ORDER BY FIELD({$wpdb->prefix}users.ID,{$ids})";
531
+ }
532
+
533
+ // cleanup the vars we dont need
534
+ $vars['order'] = '';
535
+ $vars['orderby'] = '';
536
+
537
+ // set query vars
538
+ $user_query->query_vars = $vars;
539
+
540
+ return $user_query;
541
+ }
542
+
543
+ /**
544
+ * Orderby Media column
545
+ *
546
+ * @since 1.3
547
+ */
548
+ private function get_orderby_media_vars($vars)
549
+ {
550
+ // Column
551
+ $column = $this->get_orderby_type( $vars['orderby'], 'wp-media' );
552
+
553
+ if ( empty($column) )
554
+ return $vars;
555
+
556
+ // var
557
+ $cposts = array();
558
+ switch( key($column) ) :
559
+
560
+ case 'column-mediaid' :
561
+ $vars['orderby'] = 'ID';
562
+ break;
563
+
564
+ case 'column-width' :
565
+ $sort_flag = SORT_NUMERIC;
566
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
567
+ $meta = wp_get_attachment_metadata($p->ID);
568
+ $width = !empty($meta['width']) ? $meta['width'] : 0;
569
+ if ( $width || $this->show_all_results )
570
+ $cposts[$p->ID] = $width;
571
+ }
572
+ break;
573
+
574
+ case 'column-height' :
575
+ $sort_flag = SORT_NUMERIC;
576
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
577
+ $meta = wp_get_attachment_metadata($p->ID);
578
+ $height = !empty($meta['height']) ? $meta['height'] : 0;
579
+ if ( $height || $this->show_all_results )
580
+ $cposts[$p->ID] = $height;
581
+ }
582
+ break;
583
+
584
+ case 'column-dimensions' :
585
+ $sort_flag = SORT_NUMERIC;
586
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
587
+ $meta = wp_get_attachment_metadata($p->ID);
588
+ $height = !empty($meta['height']) ? $meta['height'] : 0;
589
+ $width = !empty($meta['width']) ? $meta['width'] : 0;
590
+ $surface = $height*$width;
591
+
592
+ if ( $surface || $this->show_all_results )
593
+ $cposts[$p->ID] = $surface;
594
+ }
595
+ break;
596
+
597
+ case 'column-caption' :
598
+ $sort_flag = SORT_STRING;
599
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
600
+ if ( $p->post_excerpt || $this->show_all_results ) {
601
+ $cposts[$p->ID] = $this->prepare_sort_string_value($p->post_excerpt);
602
+ }
603
+ }
604
+ break;
605
+
606
+ case 'column-description' :
607
+ $sort_flag = SORT_STRING;
608
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
609
+ if ( $p->post_content || $this->show_all_results ) {
610
+ $cposts[$p->ID] = $this->prepare_sort_string_value( $p->post_content );
611
+ }
612
+ }
613
+ break;
614
+
615
+ case 'column-mime_type' :
616
+ $sort_flag = SORT_STRING;
617
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
618
+ if ( $p->post_mime_type || $this->show_all_results ) {
619
+ $cposts[$p->ID] = $this->prepare_sort_string_value( $p->post_mime_type );
620
+ }
621
+ }
622
+ break;
623
+
624
+ case 'column-file_name' :
625
+ $sort_flag = SORT_STRING;
626
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
627
+ $meta = get_post_meta($p->ID, '_wp_attached_file', true);
628
+ $file = !empty($meta) ? basename($meta) : '';
629
+ if ( $file || $this->show_all_results ) {
630
+ $cposts[$p->ID] = $file;
631
+ }
632
+ }
633
+ break;
634
+
635
+ case 'column-alternate_text' :
636
+ $sort_flag = SORT_STRING;
637
+ foreach ( $this->get_any_posts_by_posttype('attachment') as $p ) {
638
+ $alt = get_post_meta($p->ID, '_wp_attachment_image_alt', true);
639
+ if ( $alt || $this->show_all_results ) {
640
+ $cposts[$p->ID] = $this->prepare_sort_string_value( $alt );
641
+ }
642
+ }
643
+ break;
644
+
645
+ endswitch;
646
+
647
+ // we will add the sorted post ids to vars['post__in'] and remove unused vars
648
+ if ( isset($sort_flag) ) {
649
+ $vars = $this->get_vars_post__in( $vars, $cposts, $sort_flag );
650
+ }
651
+
652
+ return $vars;
653
+ }
654
+
655
+ /**
656
+ * Orderby Posts column
657
+ *
658
+ * @since 1.3
659
+ */
660
+ private function get_orderby_posts_vars($vars)
661
+ {
662
+ $post_type = $vars['post_type'];
663
+
664
+ // Column
665
+ $column = $this->get_orderby_type( $vars['orderby'], $post_type );
666
+
667
+ if ( empty($column) )
668
+ return $vars;
669
+
670
+ // id
671
+ $id = key($column);
672
+
673
+ // type
674
+ $type = $id;
675
+
676
+ // Check for taxonomies, such as column-taxonomy-[taxname]
677
+ if ( strpos($type, 'column-taxonomy-') !== false )
678
+ $type = 'column-taxonomy';
679
+
680
+ // custom fields
681
+ if ( Codepress_Admin_Columns::is_column_meta($type) )
682
+ $type = 'column-post-meta';
683
+
684
+ // attachments
685
+ if ( $type == 'column-attachment-count' )
686
+ $type = 'column-attachment';
687
+
688
+ // var
689
+ $cposts = array();
690
+ switch( $type ) :
691
+
692
+ case 'column-postid' :
693
+ $vars['orderby'] = 'ID';
694
+ break;
695
+
696
+ case 'column-order' :
697
+ $vars['orderby'] = 'menu_order';
698
+ break;
699
+
700
+ case 'column-modified' :
701
+ $vars['orderby'] = 'modified';
702
+ break;
703
+
704
+ case 'column-comment-count' :
705
+ $vars['orderby'] = 'comment_count';
706
+ break;
707
+
708
+ case 'column-post-meta' :
709
+ $field = $column[$id]['field'];
710
+
711
+ // orderby type
712
+ $field_type = 'meta_value';
713
+ if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' )
714
+ $field_type = 'meta_value_num';
715
+
716
+ $vars = array_merge($vars, array(
717
+ 'meta_key' => $field,
718
+ 'orderby' => $field_type
719
+ ));
720
+ break;
721
+
722
+ case 'column-excerpt' :
723
+ $sort_flag = SORT_STRING;
724
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
725
+ $cposts[$p->ID] = $this->prepare_sort_string_value($p->post_content);
726
+ }
727
+ break;
728
+
729
+ case 'column-word-count' :
730
+ $sort_flag = SORT_NUMERIC;
731
+ foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
732
+ $cposts[$p->ID] = str_word_count( Codepress_Admin_Columns::strip_trim( $p->post_content ) );
733
+ }
734
+ break;
735