Admin Columns - Version 2.5.2

Version Description

  • [Fixed] Fixes an issue where some of the WordPress default columns did not display correctly
Download this release

Release Info

Developer tschutter
Plugin Icon 128x128 Admin Columns
Version 2.5.2
Comparing to
See all releases

Code changes from version 2.4.10 to 2.5.2

Files changed (67) hide show
  1. api.php +0 -37
  2. assets/css/admin-column.css +140 -38
  3. assets/css/admin-column.min.css +1 -1
  4. assets/css/column.css +24 -1
  5. assets/css/column.min.css +1 -1
  6. assets/images/switch_bw.png +0 -0
  7. assets/js/admin-settings.js +365 -265
  8. assets/js/admin-settings.min.js +1 -1
  9. classes/column.php +78 -78
  10. classes/column/actions.php +22 -19
  11. classes/column/comment/approved.php +5 -3
  12. classes/column/comment/status.php +50 -0
  13. classes/column/comment/type.php +4 -2
  14. classes/column/custom-field.php +11 -10
  15. classes/column/default.php +3 -4
  16. classes/column/media/actions.php +4 -0
  17. classes/column/media/description.php +3 -4
  18. classes/column/media/dimensions.php +3 -2
  19. classes/column/media/full-path.php +8 -10
  20. classes/column/media/height.php +8 -17
  21. classes/column/media/width.php +7 -17
  22. classes/column/post/actions.php +17 -12
  23. classes/column/post/attachment-count.php +11 -24
  24. classes/column/post/author-name.php +11 -16
  25. classes/column/post/comment-count.php +2 -10
  26. classes/column/post/comment-status.php +7 -11
  27. classes/column/post/depth.php +1 -6
  28. classes/column/post/estimated-reading-time.php +14 -22
  29. classes/column/post/featured-image.php +8 -12
  30. classes/column/post/formats.php +4 -11
  31. classes/column/post/order.php +1 -3
  32. classes/column/post/page-template.php +4 -11
  33. classes/column/post/parent.php +7 -9
  34. classes/column/post/ping-status.php +7 -11
  35. classes/column/post/shortcodes.php +24 -6
  36. classes/column/post/sticky.php +5 -18
  37. classes/column/post/word-count.php +3 -10
  38. classes/column/used-by-menu.php +5 -9
  39. classes/column/user/ID.php +3 -6
  40. classes/column/user/actions.php +16 -9
  41. classes/column/user/comment-count.php +4 -7
  42. classes/column/user/description.php +3 -8
  43. classes/column/user/display-name.php +0 -4
  44. classes/column/user/first-name.php +3 -6
  45. classes/column/user/last-name.php +3 -6
  46. classes/column/user/nickname.php +4 -6
  47. classes/column/user/post-count.php +15 -16
  48. classes/column/user/registered.php +3 -6
  49. classes/column/user/rich-editing.php +4 -17
  50. classes/column/user/url.php +3 -6
  51. classes/column/wc-placeholder.php +7 -8
  52. classes/settings.php +246 -126
  53. classes/storage_model.php +537 -323
  54. classes/storage_model/comment.php +10 -2
  55. classes/storage_model/link.php +7 -8
  56. classes/storage_model/media.php +30 -9
  57. classes/storage_model/post.php +14 -2
  58. classes/storage_model/user.php +10 -1
  59. classes/third_party.php +1 -4
  60. classes/third_party/all-in-seo.php +0 -13
  61. classes/third_party/bbpress.php +0 -21
  62. classes/third_party/wpml.php +23 -35
  63. classes/third_party/yoast_seo.php +0 -40
  64. classes/utility.php +28 -13
  65. codepress-admin-columns.php +116 -147
  66. languages/codepress-admin-columns.pot +359 -319
  67. readme.txt +51 -1
api.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- /**
3
- * If you like to register a column of your own please have a look at our documentation.
4
- * We also have a free start-kit available, which contains all the necessary files.
5
- *
6
- * Documentation: https://www.admincolumns.com/documentation/developer-docs/creating-new-column-type/
7
- * Starter-kit: https://github.com/codepress/cac-column-template/
8
- *
9
- */
10
-
11
- /**
12
- * Manually set the columns for a storage model
13
- * This overrides the database settings and thus renders the settings screen for this storage model useless
14
- *
15
- * @since 2.2
16
- *
17
- * @param string $storage_model Storage model key
18
- * @param array $columns List of columns ([column_name] => [column_options])
19
- */
20
- function ac_register_columns( $storage_model, $columns ) {
21
- global $cpac;
22
-
23
- $storage_models = (array) $storage_model;
24
-
25
- foreach ( $storage_models as $storage_model ) {
26
- if ( isset( $cpac->exported_columns[ $storage_model ] ) ) {
27
- $cpac->exported_columns[ $storage_model ] = array_merge( $cpac->exported_columns[ $storage_model ], $columns );
28
- }
29
- else {
30
- $cpac->exported_columns[ $storage_model ] = $columns;
31
- }
32
- }
33
- }
34
-
35
- function cpac_set_storage_model_columns( $storage_model, $columns ) {
36
- ac_register_columns( $storage_model, $columns );
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/admin-column.css CHANGED
@@ -64,6 +64,9 @@ a.help {
64
  .cpac_message.error.warning {
65
  border-left: 4px solid #ffba00;
66
  }
 
 
 
67
  /**
68
  * Icons
69
  * ----------------------------------------------------------------------------
@@ -129,6 +132,15 @@ a.help {
129
  font-weight: bold;
130
  min-width: 100px;
131
  }
 
 
 
 
 
 
 
 
 
132
  /**
133
  * Structure
134
  * ----------------------------------------------------------------------------
@@ -141,16 +153,35 @@ a.help {
141
  float: left;
142
  width: 100%;
143
  }
 
 
 
 
 
 
144
  .columns-container .columns-right {
145
  float: right;
146
  margin-right: -300px;
147
  width: 280px;
148
  }
149
  .columns-container .columns-right .columns-right-inside.fixed {
150
- position: fixed;
151
- top: 40px;
152
  width: 280px;
153
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  /**
155
  * UI Sortable Plugin
156
  * ----------------------------------------------------------------------------
@@ -176,12 +207,65 @@ a.help {
176
  .cpac-placeholder :first-child {
177
  border: none;
178
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  /**
180
  * Columns
181
  * ----------------------------------------------------------------------------
182
  */
 
 
 
 
 
 
 
 
183
  .columns-left .cpac-boxes .cpac-columns form {
184
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  }
186
  /**
187
  * Column
@@ -275,6 +359,9 @@ a.help {
275
  cursor: auto;
276
  color: #737373;
277
  }
 
 
 
278
  .cpac-column .column-meta table tr td.column_label span.vers {
279
  float: left;
280
  }
@@ -461,10 +548,10 @@ a.help {
461
  font-size: 12px;
462
  }
463
  .cpac-column .column-form table tr.column_width .input div.width-slider {
464
- margin-left: 60px;
465
- margin-right: 100px;
466
  position: relative;
467
- margin-top: 4px;
468
  }
469
  .cpac-column .column-form table tr.column_width .input div.width-slider .ui-slider-handle {
470
  cursor: ew-resize;
@@ -510,6 +597,7 @@ a.help {
510
  width: 40px !important;
511
  }
512
  .cpac-column .column-form table tr.column_action td {
 
513
  background: #f9f9f9;
514
  }
515
  .cpac-column .column-form table tr.column_action td p {
@@ -613,6 +701,7 @@ a.help {
613
  .column-footer .button-container a {
614
  display: inline-block;
615
  margin-top: 5px;
 
616
  }
617
  /**
618
  * Welcome Screen
@@ -693,9 +782,6 @@ a.help {
693
  * Sidebar
694
  * ----------------------------------------------------------------------------
695
  */
696
- .columns-right {
697
- margin-top: 54px;
698
- }
699
  .columns-right .sidebox {
700
  background: none repeat scroll 0 0 #FFFFFF;
701
  border: 1px solid #E1E1E1;
@@ -707,6 +793,7 @@ a.help {
707
  .columns-right .sidebox h3 {
708
  padding: 10px;
709
  margin: 0;
 
710
  }
711
  .columns-right .sidebox h3.title {
712
  font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
@@ -728,33 +815,63 @@ a.help {
728
  border-bottom-style: solid;
729
  border-bottom-width: 1px;
730
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731
  .columns-right .sidebox .inside {
732
  padding: 10px;
733
  }
734
  .columns-right .sidebox .inside p {
735
  margin-top: 0;
736
  }
737
- .columns-right .sidebox#form-actions .form-reset {
 
738
  border-bottom: 1px solid #F5F5F5;
739
  padding: 8px;
740
  }
741
- .columns-right .sidebox#form-actions .reset-column-type {
742
  text-decoration: none;
743
  color: #BC0B0B;
744
  line-height: 25px;
745
  display: inline-block;
 
 
 
 
 
 
746
  }
747
- .columns-right .sidebox#form-actions .form-update {
 
 
 
748
  padding: 8px;
749
  overflow: hidden;
750
  }
751
- .columns-right .sidebox#form-actions .submit-update {
752
- display: block;
753
  width: 100%;
754
  height: 28px;
755
  line-height: 28px;
756
  text-align: center;
757
  }
 
 
 
758
  .columns-right .sidebox#pro-version .cta {
759
  background: transparent url(../images/get_the_addon.png) no-repeat 0 0;
760
  background-size: cover;
@@ -838,6 +955,7 @@ a.help {
838
  height: 120px;
839
  }
840
  .columns-right .sidebox#direct-feedback .inside form input[type="submit"] {
 
841
  float: right;
842
  border-radius: 4px;
843
  border: 1px solid #CCC;
@@ -848,7 +966,6 @@ a.help {
848
  font-size: 12px;
849
  padding: 0 32px;
850
  color: #CCC;
851
- display: inline-block;
852
  background: none;
853
  text-decoration: none;
854
  cursor: pointer;
@@ -905,25 +1022,6 @@ table.cpac-form-table > tbody > tr > th {
905
  table.cpac-form-table td.padding-22 {
906
  padding-top: 22px;
907
  }
908
- table.cpac-form-table td .cpac_export .ms-container {
909
- background: transparent url('../images/switch_bw.png') no-repeat 50% 50%;
910
- }
911
- table.cpac-form-table td .cpac_export .ms-container .ms-selectable {
912
- width: 48%;
913
- margin-right: 0;
914
- }
915
- table.cpac-form-table td .cpac_export .ms-container .ms-selection {
916
- float: right;
917
- width: 48%;
918
- }
919
- table.cpac-form-table td .cpac_export .ms-container ul.ms-list {
920
- width: 100%;
921
- }
922
- table.cpac-form-table td .cpac_export .ms-container ul.ms-list li {
923
- margin: 0;
924
- padding-top: 5px;
925
- padding-bottom: 5px;
926
- }
927
  table.cpac-form-table.settings tr td {
928
  padding-top: 74px;
929
  }
@@ -947,6 +1045,9 @@ table.cpac-form-table.settings tr:first-child td {
947
  .wp-pointer-right {
948
  margin-right: 15px;
949
  }
 
 
 
950
  /* =RTL language
951
  -------------------------------------------------------------- */
952
  body.rtl .wp-pointer-right {
@@ -1023,6 +1124,9 @@ body.rtl .columns-left .column-footer .order-message {
1023
  body.rtl .columns-left .column-footer .button-container {
1024
  float: left;
1025
  }
 
 
 
1026
  body.rtl .columns-right {
1027
  float: left;
1028
  margin-left: -300px;
@@ -1040,6 +1144,9 @@ body.rtl .cpac_export .ms-container .ms-selection {
1040
  .columns-container {
1041
  margin-right: 0;
1042
  }
 
 
 
1043
  .columns-container .columns-left {
1044
  float: none;
1045
  }
@@ -1049,11 +1156,6 @@ body.rtl .cpac_export .ms-container .ms-selection {
1049
  margin-right: 0;
1050
  width: 100%;
1051
  }
1052
- .columns-container .columns-right .columns-right-inside.fixed {
1053
- position: relative;
1054
- top: 0;
1055
- width: 100%;
1056
- }
1057
  }
1058
  /* =Addons
1059
  -------------------------------------------------------------- */
64
  .cpac_message.error.warning {
65
  border-left: 4px solid #ffba00;
66
  }
67
+ .ajax-message {
68
+ display: none;
69
+ }
70
  /**
71
  * Icons
72
  * ----------------------------------------------------------------------------
132
  font-weight: bold;
133
  min-width: 100px;
134
  }
135
+ .cpac-menu label {
136
+ font-weight: bold;
137
+ margin-right: 5px;
138
+ }
139
+ .cpac-menu .spinner {
140
+ float: none;
141
+ margin-top: 0;
142
+ margin-left: 0;
143
+ }
144
  /**
145
  * Structure
146
  * ----------------------------------------------------------------------------
153
  float: left;
154
  width: 100%;
155
  }
156
+ .columns-container .columns-left .column-footer .submit.save {
157
+ display: inline-block;
158
+ }
159
+ .columns-container .columns-left .column-footer .submit.update {
160
+ display: none;
161
+ }
162
  .columns-container .columns-right {
163
  float: right;
164
  margin-right: -300px;
165
  width: 280px;
166
  }
167
  .columns-container .columns-right .columns-right-inside.fixed {
 
 
168
  width: 280px;
169
  }
170
+ .columns-container.stored .columns-right .sidebox.form-actions .submit.save {
171
+ display: none;
172
+ }
173
+ .columns-container.stored .columns-right .sidebox.form-actions .submit.update {
174
+ display: block;
175
+ }
176
+ .columns-container.stored .columns-right .sidebox.form-actions .form-reset {
177
+ display: block;
178
+ }
179
+ .columns-container.stored .column-footer .submit.save {
180
+ display: none;
181
+ }
182
+ .columns-container.stored .column-footer .submit.update {
183
+ display: inline-block;
184
+ }
185
  /**
186
  * UI Sortable Plugin
187
  * ----------------------------------------------------------------------------
207
  .cpac-placeholder :first-child {
208
  border: none;
209
  }
210
+ .menu {
211
+ position: relative;
212
+ margin-bottom: 16px;
213
+ }
214
+ .menu select {
215
+ display: inline-block;
216
+ margin: 0;
217
+ }
218
+ .menu .spinner {
219
+ display: none;
220
+ float: none;
221
+ visibility: visible;
222
+ margin: 0 0 0 14px;
223
+ }
224
+ .menu .view-link,
225
+ .menu .view-link:active {
226
+ display: inline-block;
227
+ margin: 0 0 0 12px;
228
+ top: 2px;
229
+ }
230
  /**
231
  * Columns
232
  * ----------------------------------------------------------------------------
233
  */
234
+ .columns-left .cpac-notice {
235
+ background: #fff;
236
+ border-left: 4px solid #ffba00;
237
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
238
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
239
+ margin-bottom: 15px;
240
+ padding: 1px 12px;
241
+ }
242
  .columns-left .cpac-boxes .cpac-columns form {
243
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
244
+ margin: 0;
245
+ }
246
+ .columns-left .cpac-boxes.disabled {
247
+ opacity: 0.7;
248
+ }
249
+ .columns-left .cpac-boxes.disabled a.edit-button,
250
+ .columns-left .cpac-boxes.disabled a.remove-button,
251
+ .columns-left .cpac-boxes.disabled a.clone-button,
252
+ .columns-left .cpac-boxes.disabled .column_action {
253
+ display: none !important;
254
+ }
255
+ .columns-left .cpac-boxes.disabled .column-meta td.column_sort {
256
+ display: none;
257
+ }
258
+ .columns-left .cpac-boxes.disabled .meta span {
259
+ cursor: default !important;
260
+ }
261
+ .columns-left .cpac-boxes.disabled .meta span:before {
262
+ color: #808080 !important;
263
+ }
264
+ .columns-left .cpac-boxes.disabled .meta span.off {
265
+ opacity: 0.5;
266
+ }
267
+ .columns-left .cpac-boxes.disabled .column-footer {
268
+ display: none;
269
  }
270
  /**
271
  * Column
359
  cursor: auto;
360
  color: #737373;
361
  }
362
+ .cpac-column .column-meta table tr td.column_label .inner .meta span.disabled {
363
+ cursor: default;
364
+ }
365
  .cpac-column .column-meta table tr td.column_label span.vers {
366
  float: left;
367
  }
548
  font-size: 12px;
549
  }
550
  .cpac-column .column-form table tr.column_width .input div.width-slider {
551
+ margin-left: 68px;
552
+ margin-right: 90px;
553
  position: relative;
554
+ margin-top: 5px;
555
  }
556
  .cpac-column .column-form table tr.column_width .input div.width-slider .ui-slider-handle {
557
  cursor: ew-resize;
597
  width: 40px !important;
598
  }
599
  .cpac-column .column-form table tr.column_action td {
600
+ border-top: 1px solid #ebebeb;
601
  background: #f9f9f9;
602
  }
603
  .cpac-column .column-form table tr.column_action td p {
701
  .column-footer .button-container a {
702
  display: inline-block;
703
  margin-top: 5px;
704
+ margin-left: 5px;
705
  }
706
  /**
707
  * Welcome Screen
782
  * Sidebar
783
  * ----------------------------------------------------------------------------
784
  */
 
 
 
785
  .columns-right .sidebox {
786
  background: none repeat scroll 0 0 #FFFFFF;
787
  border: 1px solid #E1E1E1;
793
  .columns-right .sidebox h3 {
794
  padding: 10px;
795
  margin: 0;
796
+ position: relative;
797
  }
798
  .columns-right .sidebox h3.title {
799
  font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
815
  border-bottom-style: solid;
816
  border-bottom-width: 1px;
817
  }
818
+ .columns-right .sidebox h3 span.left {
819
+ position: relative;
820
+ background: #fff;
821
+ z-index: 2;
822
+ padding-right: 8px;
823
+ }
824
+ .columns-right .sidebox h3 span.right {
825
+ position: absolute;
826
+ display: inline-block;
827
+ line-height: 20px;
828
+ z-index: 1;
829
+ right: 10px;
830
+ font-size: 12px;
831
+ text-transform: uppercase;
832
+ color: #808080;
833
+ text-align: right;
834
+ }
835
  .columns-right .sidebox .inside {
836
  padding: 10px;
837
  }
838
  .columns-right .sidebox .inside p {
839
  margin-top: 0;
840
  }
841
+ .columns-right .sidebox.form-actions .form-reset {
842
+ display: none;
843
  border-bottom: 1px solid #F5F5F5;
844
  padding: 8px;
845
  }
846
+ .columns-right .sidebox.form-actions .reset-column-type {
847
  text-decoration: none;
848
  color: #BC0B0B;
849
  line-height: 25px;
850
  display: inline-block;
851
+ background: none;
852
+ border: none;
853
+ padding: 0;
854
+ font-size: 13px;
855
+ cursor: pointer;
856
+ margin: 0;
857
  }
858
+ .columns-right .sidebox.form-actions .reset-column-type:hover {
859
+ color: #f00;
860
+ }
861
+ .columns-right .sidebox.form-actions .form-update {
862
  padding: 8px;
863
  overflow: hidden;
864
  }
865
+ .columns-right .sidebox.form-actions .submit {
866
+ display: none;
867
  width: 100%;
868
  height: 28px;
869
  line-height: 28px;
870
  text-align: center;
871
  }
872
+ .columns-right .sidebox.form-actions .submit.save {
873
+ display: block;
874
+ }
875
  .columns-right .sidebox#pro-version .cta {
876
  background: transparent url(../images/get_the_addon.png) no-repeat 0 0;
877
  background-size: cover;
955
  height: 120px;
956
  }
957
  .columns-right .sidebox#direct-feedback .inside form input[type="submit"] {
958
+ display: inline-block;
959
  float: right;
960
  border-radius: 4px;
961
  border: 1px solid #CCC;
966
  font-size: 12px;
967
  padding: 0 32px;
968
  color: #CCC;
 
969
  background: none;
970
  text-decoration: none;
971
  cursor: pointer;
1022
  table.cpac-form-table td.padding-22 {
1023
  padding-top: 22px;
1024
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1025
  table.cpac-form-table.settings tr td {
1026
  padding-top: 74px;
1027
  }
1045
  .wp-pointer-right {
1046
  margin-right: 15px;
1047
  }
1048
+ .wp-pointer.noclick .wp-pointer-buttons {
1049
+ display: none;
1050
+ }
1051
  /* =RTL language
1052
  -------------------------------------------------------------- */
1053
  body.rtl .wp-pointer-right {
1124
  body.rtl .columns-left .column-footer .button-container {
1125
  float: left;
1126
  }
1127
+ body.rtl .columns-left .column-footer .submit {
1128
+ display: none;
1129
+ }
1130
  body.rtl .columns-right {
1131
  float: left;
1132
  margin-left: -300px;
1144
  .columns-container {
1145
  margin-right: 0;
1146
  }
1147
+ .columns-container .menu {
1148
+ float: none;
1149
+ }
1150
  .columns-container .columns-left {
1151
  float: none;
1152
  }
1156
  margin-right: 0;
1157
  width: 100%;
1158
  }
 
 
 
 
 
1159
  }
1160
  /* =Addons
1161
  -------------------------------------------------------------- */
assets/css/admin-column.min.css CHANGED
@@ -1 +1 @@
1
- .button.loading span,.cpac-column .comment-grey-bubble,.icon-no,.icon-yes,a.help{height:16px;width:16px}#cpac a:active,#cpac a:focus{outline:0}#cpac h2.cpac-nav-tab-wrapper{margin-bottom:10px}#icon-codepress-admin-columns{background:url(../images/icon.png) no-repeat}.cpac-settings-link{float:right;margin:12px 14px 5px 0;background:url(../images/settings.png) no-repeat;padding-left:20px;text-decoration:none;display:inline-block;line-height:16px}.cpac-settings-link.current{font-weight:700}.rtl .cpac-settings-link{float:left;margin:12px 0 5px 14px;padding-right:20px;padding-left:0}a.help{background:url(../images/help.png) no-repeat;display:inline-block}.button.loading{padding-right:25px;position:relative}.rtl .button.loading{padding-left:25px;padding-right:0}.button.loading span{position:absolute;top:2px;right:6px;background:url(../images/loading.gif) right 50% no-repeat;display:inline-block}.icon-no,.icon-yes{display:inline-block;position:relative}.rtl .button.loading span{left:6px;right:auto}.cpac_message.error.warning{border-left:4px solid #ffba00}.icon-yes{background:url(../images/yes.png) no-repeat;top:2px}.icon-no{background:url(../images/no.png) no-repeat;top:2px}.cpac-column .comment-grey-bubble:before{content:'\f101';font:400 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:4px;left:0;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.rtl .cpac-column .comment-grey-bubble:before{right:0;left:auto}.cpac-menu{clear:both;overflow:hidden;margin-bottom:10px}.cpac-menu .subsubsub{white-space:normal;width:100%;margin:0 14px 0 0}.cpac-menu .subsubsub li.first{font-weight:700;min-width:100px}.columns-container{margin-right:300px;max-width:700px}.columns-container .columns-left{float:left;width:100%}.columns-container .columns-right{float:right;margin-right:-300px;width:280px}.columns-container .columns-right .columns-right-inside.fixed{position:fixed;top:40px;width:280px}.ui-sortable-helper{-webkit-box-shadow:1px 3px 6px 0 rgba(1,1,1,.4);box-shadow:1px 3px 6px 0 rgba(1,1,1,.4)}.columns-left .cpac-boxes .cpac-columns form,.columns-right .sidebox{box-shadow:0 1px 3px rgba(0,0,0,.1)}.ui-sortable-helper .column-meta{border-width:1px}.cpac-placeholder{visibility:visible!important;border-top:1px solid #dfdfdf;padding:5px 4px 7px 0}.cpac-placeholder .inner-placeholder{border:1px dashed grey;background:#eee;width:100%;height:100%}.cpac-placeholder :first-child{border:none}.cpac-column .column-meta{border-style:solid;border-color:#dfdfdf;border-width:1px 1px 0;background:#fcfcfc}.cpac-column .column-meta:nth-child(2n) .column-meta{background:#f9f9f9}.cpac-column .column-meta img{margin-right:3px}.cpac-column .column-meta table{border:none;background:0 0;border-radius:0}.cpac-column .column-meta table tr td{vertical-align:top;height:18px;border:none solid transparent;padding:11px 8px;border-width:1px 0 0}.cpac-column .column-meta table tr td.column_sort{width:10px;background:url(../images/drag.png) 8px 8px no-repeat;cursor:move}.cpac-column .column-meta table tr td.column_label{width:70%;font-weight:700;vertical-align:middle;position:relative}.cpac-column .column-meta table tr td.column_label .inner{position:relative;overflow:hidden;height:18px}.cpac-column .column-meta table tr td.column_label .inner>a{color:#5a5a5a;padding:0 4px}.cpac-column .column-meta table tr td.column_label .inner>a:hover{color:#333}.cpac-column .column-meta table tr td.column_label .inner>a.clone-button,.cpac-column .column-meta table tr td.column_label .inner>a.edit-button,.cpac-column .column-meta table tr td.column_label .inner>a.remove-button{display:none;color:#a00;text-decoration:none;text-shadow:none;font-weight:400;margin-left:5px;font-size:12px}.cpac-column .column-meta table tr td.column_label .inner>a.clone-button:hover,.cpac-column .column-meta table tr td.column_label .inner>a.edit-button:hover,.cpac-column .column-meta table tr td.column_label .inner>a.remove-button:hover{color:red}.cpac-column .column-meta table tr td.column_label .inner>a.clone-button,.cpac-column .column-meta table tr td.column_label .inner>a.edit-button{color:#0074a2}.cpac-column .column-meta table tr td.column_label .inner>a.clone-button:hover,.cpac-column .column-meta table tr td.column_label .inner>a.edit-button:hover{color:#2ea2cc}.cpac-column .column-meta table tr td.column_label .inner .meta{display:inline-block;float:right;font-weight:400;color:#b2b2b2;font-size:12px}.cpac-column .column-meta table tr td.column_label .inner .meta span{cursor:pointer}.cpac-column .column-meta table tr td.column_label .inner .meta span.width{margin-right:5px;cursor:auto;color:#737373}.cpac-column .column-meta table tr td.column_label span.vers{float:left}.cpac-column .column-meta table tr td.column_type{width:auto;min-width:120px;text-align:right;vertical-align:middle;color:#999;padding-right:0}.cpac-column .column-meta table tr td.column_type .inner{height:18px;overflow:hidden}.cpac-column .column-meta table tr td.column_type .inner a{color:#999}.cpac-column .column-meta table tr td.column_edit{width:38px;min-width:38px;background:url(../images/arrow.png) 23px 18px no-repeat;cursor:pointer}.cpac-column .column-meta:hover .column_label .inner>a.clone-button,.cpac-column .column-meta:hover .column_label .inner>a.edit-button,.cpac-column .column-meta:hover .column_label .inner>a.remove-button{display:inline-block}.cpac-column .column-meta span.vers{padding-top:2px}.cpac-column .column-meta span.vers .comment-grey-bubble{float:right}.cpac-column .column-form{display:none;border-width:1px 1px 0;border-style:solid;border-color:#dfdfdf;position:relative}.cpac-column .column-form table{border:none;background:#fcfcfc}.cpac-column .column-form table tr.hide{display:none}.cpac-column .column-form table tr td{vertical-align:top;border:none;padding:8px;background:#fff;border-top:1px solid #F5F5F5}.cpac-column .column-form table tr td input[type=text],.cpac-column .column-form table tr td select{width:99.95%}.cpac-column .column-form table tr td input[type=text].small,.cpac-column .column-form table tr td select.small{width:100px}.cpac-column .column-form table tr td span.suffix{line-height:40px;color:grey}.cpac-column .column-form table tr td select optgroup:nth-child(2n){background:#F9F9F9}.cpac-column .column-form table tr td.label{position:relative;overflow:visible;background:#f5f5f5;border-right:1px solid #E1E1E1;vertical-align:top;width:34%;border-top:1px solid #F0F0F0}.column-footer,.wp-pointer-content{overflow:hidden}.cpac-column .column-form table tr td.label label{font-weight:700;color:#333;display:block;position:relative}.cpac-column .column-form table tr td.label p{color:#666;display:block;font-size:12px;font-style:normal;line-height:16px;margin:0!important}.cpac-column .column-form table tr td.label p.description{display:none;position:absolute;z-index:99;top:30px;left:0;background:#eaf2fa;border-radius:5px;border:1px solid #c7d7e2;padding:5px 8px!important;font-weight:400}.cpac-column .column-form table tr td.label p.description em{display:block;color:#999}.cpac-column .column-form table tr td.label .info{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1}.cpac-column .column-form table tr td.label .info:before{position:absolute;z-index:1;right:10px;top:50%;margin-top:-7px;content:'';display:block;border-radius:32px;border:1px solid #E6E6E6;width:12px;height:12px}.cpac-column .column-form table tr td.label .info:after{position:absolute;z-index:1;right:10px;top:50%;margin-top:-6px;content:'?';display:block;width:14px;height:14px;color:#E6E6E6;font:700 10px Arial;text-align:center;vertical-align:middle;line-height:14px}.cpac-column .column-form table tr td.input label{padding-left:10px;padding-right:0}.cpac-column .column-form table tr td.input div.msg{margin-top:5px;display:none;color:#333;padding:6px 8px;background-color:#ffebe8;border:1px solid #fff;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.cpac-column .column-form table tr td.input .section{padding:12px}.cpac-column .column-form table tr.column_width .input{position:relative}.cpac-column .column-form table tr.column_width .input div.description{font-size:11px;width:54px;position:absolute;left:10px;text-align:middle}.cpac-column .column-form table tr.column_width .input div.description input{background:#efefef;border:none;height:20px;line-height:20px;text-align:right;width:36px;font-size:12px}.cpac-column .column-form table tr.column_width .input div.width-slider{margin-left:60px;margin-right:100px;position:relative;margin-top:4px}.cpac-column .column-form table tr.column_width .input div.width-slider .ui-slider-handle{cursor:ew-resize}.cpac-column .column-form table tr.column_width .input div.unit-select{position:absolute;top:8px;right:10px;width:90px;text-align:right}.cpac-column .column-form table tr.column_width .input div.unit-select label{padding-left:5px}.cpac-column .column-form table tr.column_image_size{border:10px solid red}.cpac-column .column-form table tr.column_image_size td.input label.custom-size{display:inline-block;margin-top:4px;margin-bottom:4px}.cpac-column .column-form table tr.column_image_size td.input label.custom-size input{margin-right:3px}.cpac-column .column-form table tr.column_image_size td.input .custom_image_size{display:inline-block}.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-h.hidden,.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-w.hidden,.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .hidden{display:none}.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-h,.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-w{margin:0}.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-h input[type=text],.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-w input[type=text]{margin-right:3px;width:40px!important}.cpac-column .column-form table tr.column_action td{background:#f9f9f9}.cpac-column .column-form table tr.column_action td p{margin:0}.cpac-column .column-form table tr.column_action td p a.remove-button{color:#a00;text-decoration:none;text-shadow:none;font-weight:400;margin-left:5px;font-size:12px;padding:0 5px}.cpac-column .column-form table tr.column_action td p a.remove-button:hover{color:#fff;background:red}.cpac-column .column-form table tr:first-child td{border-top:none}.cpac-column.loading .column-form>.spinner{position:absolute;left:50%;top:50%;z-index:200;margin-left:-10px;margin-top:-10px;display:block}.cpac-column.loading .column-form:before{content:'';position:absolute;width:100%;height:100%;background:#FFF;z-index:100;opacity:.5}.cpac-column.opened .column-meta{background-color:#c7c7c7;background-image:-ms-linear-gradient(top,#e9e9e9,#c7c7c7);background-image:-moz-linear-gradient(top,#e9e9e9,#c7c7c7);background-image:-o-linear-gradient(top,#e9e9e9,#c7c7c7);background-image:-webkit-gradient(linear,left top,left bottom,from(#e9e9e9),to(#c7c7c7));background-image:-webkit-linear-gradient(top,#e9e9e9,#c7c7c7);background-image:linear-gradient(top,#e9e9e9,#c7c7c7);border-color:#aeaeae}.cpac-column.opened .column-meta table{background:0 0}.cpac-column.opened .column-meta table td{border-color:#f8f8f8;color:#333;text-shadow:0 1px 0 #FFF}.cpac-column.opened .column-meta table td a{color:#333;text-shadow:0 1px 0 #FFF}.cpac-column.opened .column-meta table td.column_sort{background-position:8px -39px}.cpac-column.opened .column-meta table td.column_label .inner .meta span{color:grey;text-shadow:none}.cpac-column.opened .column-meta table td.column_type{color:#5C5C5C}.column-footer{background:#EAF2FA;border:1px solid #c7d7e2;min-height:26px;padding:8px}.column-footer .order-message{background:url(../images/order_arrow.png) no-repeat;color:#7A9BBE;float:left;font-family:Comic Sans MS,sans-serif;font-size:11px;height:13px;line-height:1em;margin-left:4px;padding:7px 0 0 22px;text-shadow:0 1px 0 #FFF;display:inline-block}.column-footer .button-container{float:right;display:inline-block;margin-top:-5px}.column-footer .button-container a{display:inline-block;margin-top:5px}.cpac-content-body hr{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background:none;border-color:#DFDFDF -moz-use-text-color -moz-use-text-color;border-image:none;border-right:0 none;border-style:solid none none;border-width:1px 0 0;clear:both;margin:30px 0;opacity:.2}#cpac-welcome.about-wrap div.error{display:block!important}.cpac-alert{display:inline-block;background:#FCF8E3;border:1px solid #FBEED5;border-radius:4px;color:#C09853;margin:20px 0;padding:16px 14px;text-shadow:0 1px 0 rgba(255,255,255,.5)}.cpac-alert p{margin:0}.cpac-alert.cpac-alert-success{background-color:#DFF0D8;border-color:#D6E9C6;color:#468847}.cpac-alert.cpac-alert-error{background-color:#F2DEDE;border-color:#EED3D7;color:#B94A48}.cpac-alert a.button-primary{height:28px;line-height:28px;display:inline-block}#cpac-download-add-ons-table{max-width:600px}.wp-core-ui .button-large{height:40px;line-height:40px;font-size:16px;padding:0 15px;text-shadow:0 1px 0 rgba(0,0,0,.5)}.cac-notification.updated{border-left-color:#0071aa}.cac-notification.updated .learnmore{float:right}.cac-notification.updated .learnmore:after{content:"\f139";font:400 20px/1 dashicons;float:right}.columns-right{margin-top:54px}.columns-right .sidebox{background:#FFF;border:1px solid #E1E1E1;border-radius:0;position:relative;margin-bottom:14px}.columns-right .sidebox h3{padding:10px;margin:0}.columns-right .sidebox h3.title{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:15px;font-weight:400;line-height:1;margin:0;padding:7px 10px;background:#f1f1f1;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-moz-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-o-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(to top,#ececec,#f9f9f9);border-bottom-color:#dfdfdf;text-shadow:#fff 0 1px 0;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff;border-bottom-style:solid;border-bottom-width:1px}.columns-right .sidebox .inside{padding:10px}.columns-right .sidebox .inside p{margin-top:0}.columns-right .sidebox#form-actions .form-reset{border-bottom:1px solid #F5F5F5;padding:8px}.columns-right .sidebox#form-actions .reset-column-type{text-decoration:none;color:#BC0B0B;line-height:25px;display:inline-block}.columns-right .sidebox#form-actions .form-update{padding:8px;overflow:hidden}.columns-right .sidebox#form-actions .submit-update{display:block;width:100%;height:28px;line-height:28px;text-align:center}.columns-right .sidebox#pro-version .cta{background:url(../images/get_the_addon.png) no-repeat;background-size:cover}.columns-right .sidebox#pro-version .padding-box{padding:8px 15px 0}.columns-right .sidebox#pro-version h3 a{color:#fff;font-size:19px;text-decoration:none;font-weight:400;margin-top:6px}.columns-right .sidebox#pro-version .inside ul{margin:0 0 10px}.columns-right .sidebox#pro-version .inside ul li{margin:0;padding:0}.columns-right .sidebox#pro-version .inside ul li a{display:inline-block;min-height:24px;font-size:19px;line-height:24px;margin-bottom:1px;padding:0 5px;background:#000;color:#fff;text-decoration:none}.columns-right .sidebox#pro-version .inside ul li.acf a{background-color:#5ee8bf;color:grey}.columns-right .sidebox#pro-version .inside p{color:#fff;font-size:12px}.columns-right .sidebox#pro-version .inside p a{color:#fff;display:inline-block;background:#a4c518;padding:0 2px;font-size:15px;text-decoration:none}.columns-right .sidebox#add-acf{background-color:#5ee8bf}.columns-right .sidebox#add-acf h3{padding:0}.columns-right .sidebox#add-acf h3 a{color:#fff;text-decoration:none;font-size:15px}.columns-right .sidebox#direct-feedback #feedback-rate,.columns-right .sidebox#direct-feedback #feedback-support{display:none}.columns-right .sidebox#direct-feedback .inside>a{border-radius:4px;border:1px solid #CCC;width:48%;height:64px;text-align:center;line-height:64px;font-weight:700;color:#222;display:inline-block;text-decoration:none}.columns-right .sidebox#direct-feedback .inside>a:hover{background:#FAFAFA}.columns-right .sidebox#direct-feedback .inside form textarea{width:100%;height:120px}.columns-right .sidebox#direct-feedback .inside form input[type=submit]{float:right;border-radius:4px;border:1px solid #CCC;height:32px;text-align:center;line-height:32px;font-weight:700;font-size:12px;padding:0 32px;color:#CCC;display:inline-block;background:0 0;text-decoration:none;cursor:pointer}.columns-right .sidebox#direct-feedback .inside form input[type=submit]:hover,.columns-right .sidebox#direct-feedback .inside ul.share li a:hover{background:#FAFAFA}.columns-right .sidebox#direct-feedback .inside form p.description{float:left;font-size:10px}.columns-right .sidebox#direct-feedback .inside ul{margin:0}.columns-right .sidebox#direct-feedback .inside ul.share li{margin:0 0 0 9px;display:block;float:left;width:30%}.columns-right .sidebox#direct-feedback .inside ul.share li a{text-decoration:none;vertical-align:middle;line-height:20px;padding:16px 0;width:100%;text-align:center;border:1px solid #CCC;border-radius:4px;display:block}.columns-right .sidebox#direct-feedback .inside ul.share li:first-child{margin-left:0}.columns-right .sidebox#direct-feedback #feedback-support .inside ul.share li{width:48%}table.cpac-form-table{max-width:1100px;margin-top:20px}table.cpac-form-table>tbody>tr>td,table.cpac-form-table>tbody>tr>th{vertical-align:top}table.cpac-form-table td.padding-22{padding-top:22px}table.cpac-form-table td .cpac_export .ms-container{background:url(../images/switch_bw.png) 50% 50% no-repeat}table.cpac-form-table td .cpac_export .ms-container .ms-selectable{width:48%;margin-right:0}table.cpac-form-table td .cpac_export .ms-container .ms-selection{float:right;width:48%}table.cpac-form-table td .cpac_export .ms-container ul.ms-list{width:100%}table.cpac-form-table td .cpac_export .ms-container ul.ms-list li{margin:0;padding-top:5px;padding-bottom:5px}table.cpac-form-table.settings tr td{padding-top:74px}table.cpac-form-table.settings tr:first-child th{padding-top:0}table.cpac-form-table.settings tr:first-child td{padding-top:54px}.wp-pointer-content ol{margin-left:1.5em;padding:0 15px}.wp-pointer-right{margin-right:15px}body.rtl .wp-pointer-right{margin-left:15px;margin-right:0}body.rtl .wp-pointer-right ol{margin-right:1.5em;margin-left:0}body.rtl .cpac-menu .subsubsub{margin-left:14px;margin-right:0}body.rtl .columns-container{margin-left:300px;margin-right:0}body.rtl .columns-left{float:right}body.rtl .columns-left .cpac-columns .cpac-column .column-meta img{margin-left:3px;margin-right:0}body.rtl .columns-left .cpac-columns .cpac-column .column-meta .column_label .inner>a.remove-button{margin-right:12px;margin-left:0}body.rtl .columns-left .cpac-columns .cpac-column .column-meta .column_label .inner .meta{float:left}body.rtl .columns-left .cpac-columns .cpac-column .column-meta .column_label span.vers{float:right}body.rtl .columns-left .cpac-columns .cpac-column .column-form table tr td.label a.more-info,body.rtl .columns-left .cpac-columns .cpac-column .column-meta span.vers .comment-grey-bubble{float:left}body.rtl .columns-left .cpac-columns .cpac-column .column-meta .column_type{text-align:left;padding-left:0;padding-right:auto}body.rtl .columns-left .cpac-columns .cpac-column .column-form table tr.column_image_size td.input label input{margin-left:3px;margin-right:0}body.rtl .columns-left .cpac-columns .cpac-column .column-form table tr td.label p.description{right:0;left:auto}body.rtl .columns-left .cpac-columns .cpac-column .column-form div.description,body.rtl .columns-left .cpac-columns .cpac-column .column-form div.input-width-range{float:right}body.rtl .columns-left .cpac-columns .cpac-column .column-form tr td.input label{padding-left:10px;padding-right:0}body.rtl .columns-left .cpac-columns .cpac-column .column-form a.help{float:left}body.rtl .columns-left .column-footer .order-message{float:right;padding-right:22px;padding-left:0;background:url(../images/order_arrow-rtl.png) right top no-repeat}body.rtl .columns-left .column-footer .button-container,body.rtl .cpac_export .ms-container .ms-selection{float:left}body.rtl .columns-right{float:left;margin-left:-300px;margin-right:0}body.rtl .cpac-placeholder{padding:5px 0 7px 4px}@media only screen and (max-width:900px){.columns-container{margin-right:0}.columns-container .columns-left{float:none}.columns-container .columns-right{float:none;margin-top:0;margin-right:0;width:100%}.columns-container .columns-right .columns-right-inside.fixed{position:relative;top:0;width:100%}}.cpac-addons li{width:200px;background:#FFF;float:left;margin-right:16px;margin-bottom:16px;border:1px solid #DDD;-webkit-box-shadow:0 3px 10px 0 rgba(0,0,0,.15);-moz-box-shadow:0 3px 10px 0 rgba(0,0,0,.15);box-shadow:0 3px 10px 0 rgba(0,0,0,.15)}.cpac-addons li:hover{-webkit-box-shadow:0 3px 10px 0 rgba(0,0,0,.25);-moz-box-shadow:0 3px 10px 0 rgba(0,0,0,.25);box-shadow:0 3px 10px 0 rgba(0,0,0,.25)}.cpac-addons li a{color:#444}.cpac-addons li .cpac-addon-content{display:table;width:100%;height:125px;text-align:center;vertical-align:middle;border-top:1px solid #DDD;background:#0069a4;background:-moz-radial-gradient(center,ellipse cover,#0069a4 0,#085079 100%);background:-webkit-gradient(radial,center center,0,center center,100%,color-stop(0,#0069a4),color-stop(100%,#085079));background:-webkit-radial-gradient(center,ellipse cover,#0069a4 0,#085079 100%);background:-o-radial-gradient(center,ellipse cover,#0069a4 0,#085079 100%);background:-ms-radial-gradient(center,ellipse cover,#0069a4 0,#085079 100%);background:radial-gradient(ellipse at center,#0069a4 0,#085079 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0069a4', endColorstr='#085079', GradientType=1)}.cpac-addons li .cpac-addon-content>*{display:table-cell;vertical-align:middle}.cpac-addons li .cpac-addon-content h3{padding:0 16px;color:#FFF;line-height:150%}.cpac-addons li .cpac-addon-content img{width:100%}.cpac-addons li .cpac-addon-header{width:100%;padding:25px 15px;-moz-box-sizing:border-box;box-sizing:border-box}.cpac-addons li .cpac-addon-header>:first-child{margin-top:0}.cpac-addons li .cpac-addon-header>:last-child{margin-bottom:0}.cpac-addons li .cpac-addon-actions{background:#EEE;border-top:1px solid #DDD;padding:8px}.cpac-addons li .cpac-addon-actions .cpac-installed:before{content:"\f147";font-family:dashicons;vertical-align:middle;margin-left:-5px;margin-right:3px}
1
+ .button.loading span,.cpac-column .comment-grey-bubble,.icon-no,.icon-yes,a.help{height:16px;width:16px}#cpac a:active,#cpac a:focus{outline:0}#cpac h2.cpac-nav-tab-wrapper{margin-bottom:10px}#icon-codepress-admin-columns{background:url(../images/icon.png) no-repeat}.cpac-settings-link{float:right;margin:12px 14px 5px 0;background:url(../images/settings.png) no-repeat;padding-left:20px;text-decoration:none;display:inline-block;line-height:16px}.cpac-settings-link.current{font-weight:700}.rtl .cpac-settings-link{float:left;margin:12px 0 5px 14px;padding-right:20px;padding-left:0}a.help{background:url(../images/help.png) no-repeat;display:inline-block}.button.loading{padding-right:25px;position:relative}.rtl .button.loading{padding-left:25px;padding-right:0}.button.loading span{position:absolute;top:2px;right:6px;background:url(../images/loading.gif) right 50% no-repeat;display:inline-block}.rtl .button.loading span{left:6px;right:auto}.cpac_message.error.warning{border-left:4px solid #ffba00}.ajax-message{display:none}.columns-container .columns-left .column-footer .submit.save,.icon-no,.icon-yes{display:inline-block}.icon-yes{background:url(../images/yes.png) no-repeat;position:relative;top:2px}.icon-no{background:url(../images/no.png) no-repeat;position:relative;top:2px}.cpac-column .comment-grey-bubble:before{content:'\f101';font:400 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:4px;left:0;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.rtl .cpac-column .comment-grey-bubble:before{right:0;left:auto}.cpac-menu{clear:both;overflow:hidden;margin-bottom:10px}.cpac-menu .subsubsub{white-space:normal;width:100%;margin:0 14px 0 0}.cpac-menu .subsubsub li.first{font-weight:700;min-width:100px}.cpac-menu label{font-weight:700;margin-right:5px}.cpac-menu .spinner{float:none;margin-top:0;margin-left:0}.columns-container{margin-right:300px;max-width:700px}.columns-container .columns-left{float:left;width:100%}.columns-container .columns-left .column-footer .submit.update,.columns-container.stored .columns-right .sidebox.form-actions .submit.save{display:none}.columns-container .columns-right{float:right;margin-right:-300px;width:280px}.columns-container .columns-right .columns-right-inside.fixed{width:280px}.columns-container.stored .columns-right .sidebox.form-actions .form-reset,.columns-container.stored .columns-right .sidebox.form-actions .submit.update{display:block}.columns-container.stored .column-footer .submit.save{display:none}.columns-container.stored .column-footer .submit.update,.menu select{display:inline-block}.ui-sortable-helper{-webkit-box-shadow:1px 3px 6px 0 rgba(1,1,1,.4);box-shadow:1px 3px 6px 0 rgba(1,1,1,.4)}.ui-sortable-helper .column-meta{border-width:1px}.cpac-placeholder{visibility:visible!important;border-top:1px solid #dfdfdf;padding:5px 4px 7px 0}.cpac-placeholder .inner-placeholder{border:1px dashed grey;background:#eee;width:100%;height:100%}.cpac-placeholder :first-child{border:none}.menu{position:relative;margin-bottom:16px}.menu select{margin:0}.menu .spinner{display:none;float:none;visibility:visible;margin:0 0 0 14px}.menu .view-link,.menu .view-link:active{display:inline-block;margin:0 0 0 12px;top:2px}.columns-left .cpac-notice{background:#fff;border-left:4px solid #ffba00;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin-bottom:15px;padding:1px 12px}.columns-left .cpac-boxes .cpac-columns form{box-shadow:0 1px 3px rgba(0,0,0,.1);margin:0}.columns-left .cpac-boxes.disabled{opacity:.7}.columns-left .cpac-boxes.disabled .column_action,.columns-left .cpac-boxes.disabled a.clone-button,.columns-left .cpac-boxes.disabled a.edit-button,.columns-left .cpac-boxes.disabled a.remove-button{display:none!important}.columns-left .cpac-boxes.disabled .column-footer,.columns-left .cpac-boxes.disabled .column-meta td.column_sort{display:none}.columns-left .cpac-boxes.disabled .meta span{cursor:default!important}.columns-left .cpac-boxes.disabled .meta span:before{color:grey!important}.columns-left .cpac-boxes.disabled .meta span.off{opacity:.5}.cpac-column .column-meta{border-style:solid;border-color:#dfdfdf;border-width:1px 1px 0;background:#fcfcfc}.cpac-column .column-meta:nth-child(2n) .column-meta{background:#f9f9f9}.cpac-column .column-meta img{margin-right:3px}.cpac-column .column-meta table{border:none;background:0 0;border-radius:0}.cpac-column .column-meta table tr td{vertical-align:top;height:18px;border:solid transparent;padding:11px 8px;border-width:1px 0 0}.cpac-column .column-meta table tr td.column_sort{width:10px;background:url(../images/drag.png) 8px 8px no-repeat;cursor:move}.cpac-column .column-meta table tr td.column_label{width:70%;font-weight:700;vertical-align:middle;position:relative}.cpac-column .column-meta table tr td.column_label .inner{position:relative;overflow:hidden;height:18px}.cpac-column .column-meta table tr td.column_label .inner>a{color:#5a5a5a;padding:0 4px}.cpac-column .column-meta table tr td.column_label .inner>a:hover{color:#333}.cpac-column .column-meta table tr td.column_label .inner>a.clone-button,.cpac-column .column-meta table tr td.column_label .inner>a.edit-button,.cpac-column .column-meta table tr td.column_label .inner>a.remove-button{display:none;color:#a00;text-decoration:none;text-shadow:none;font-weight:400;margin-left:5px;font-size:12px}.cpac-column .column-meta table tr td.column_label .inner>a.clone-button:hover,.cpac-column .column-meta table tr td.column_label .inner>a.edit-button:hover,.cpac-column .column-meta table tr td.column_label .inner>a.remove-button:hover{color:red}.cpac-column .column-meta table tr td.column_label .inner>a.clone-button,.cpac-column .column-meta table tr td.column_label .inner>a.edit-button{color:#0074a2}.cpac-column .column-meta table tr td.column_label .inner>a.clone-button:hover,.cpac-column .column-meta table tr td.column_label .inner>a.edit-button:hover{color:#2ea2cc}.cpac-column .column-meta table tr td.column_label .inner .meta{display:inline-block;float:right;font-weight:400;color:#b2b2b2;font-size:12px}.cpac-column .column-meta table tr td.column_label .inner .meta span{cursor:pointer}.cpac-column .column-meta table tr td.column_label .inner .meta span.width{margin-right:5px;cursor:auto;color:#737373}.cpac-column .column-meta table tr td.column_label .inner .meta span.disabled{cursor:default}.cpac-column .column-meta table tr td.column_label span.vers{float:left}.cpac-column .column-meta table tr td.column_type{width:auto;min-width:120px;text-align:right;vertical-align:middle;color:#999;padding-right:0}.cpac-column .column-meta table tr td.column_type .inner{height:18px;overflow:hidden}.cpac-column .column-meta table tr td.column_type .inner a{color:#999}.cpac-column .column-meta table tr td.column_edit{width:38px;min-width:38px;background:url(../images/arrow.png) 23px 18px no-repeat;cursor:pointer}.cpac-column .column-meta:hover .column_label .inner>a.clone-button,.cpac-column .column-meta:hover .column_label .inner>a.edit-button,.cpac-column .column-meta:hover .column_label .inner>a.remove-button{display:inline-block}.cpac-column .column-meta span.vers{padding-top:2px}.cpac-column .column-meta span.vers .comment-grey-bubble{float:right}.cpac-column .column-form{display:none;border-width:1px 1px 0;border-style:solid;border-color:#dfdfdf;position:relative}.cpac-column .column-form table{border:none;background:#fcfcfc}.cpac-column .column-form table tr.hide{display:none}.cpac-column .column-form table tr td{vertical-align:top;border:none;padding:8px;background:#fff;border-top:1px solid #F5F5F5}.cpac-column .column-form table tr td input[type=text],.cpac-column .column-form table tr td select{width:99.95%}.cpac-column .column-form table tr td input[type=text].small,.cpac-column .column-form table tr td select.small{width:100px}.cpac-column .column-form table tr td span.suffix{line-height:40px;color:grey}.cpac-column .column-form table tr td select optgroup:nth-child(2n){background:#F9F9F9}.cpac-column .column-form table tr td.label{position:relative;overflow:visible;background:#f5f5f5;border-right:1px solid #E1E1E1;vertical-align:top;width:34%;border-top:1px solid #F0F0F0}.column-footer,.wp-pointer-content{overflow:hidden}.cpac-column .column-form table tr td.label label{font-weight:700;color:#333;display:block;position:relative}.cpac-column .column-form table tr td.label p{color:#666;display:block;font-size:12px;font-style:normal;line-height:16px;margin:0!important}.cpac-column .column-form table tr td.label p.description{display:none;position:absolute;z-index:99;top:30px;left:0;background:#eaf2fa;border-radius:5px;border:1px solid #c7d7e2;padding:5px 8px!important;font-weight:400}.cpac-column .column-form table tr td.label p.description em{display:block;color:#999}.cpac-column .column-form table tr td.label .info{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1}.cpac-column .column-form table tr td.label .info:before{position:absolute;z-index:1;right:10px;top:50%;margin-top:-7px;content:'';display:block;border-radius:32px;border:1px solid #E6E6E6;width:12px;height:12px}.cpac-column .column-form table tr td.label .info:after{position:absolute;z-index:1;right:10px;top:50%;margin-top:-6px;content:'?';display:block;width:14px;height:14px;color:#E6E6E6;font:700 10px Arial;text-align:center;vertical-align:middle;line-height:14px}.cpac-column .column-form table tr td.input label{padding-left:10px;padding-right:0}.cpac-column .column-form table tr td.input div.msg{margin-top:5px;display:none;color:#333;padding:6px 8px;background-color:#ffebe8;border:1px solid #fff;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.cpac-column .column-form table tr td.input .section{padding:12px}.cpac-column .column-form table tr.column_width .input{position:relative}.cpac-column .column-form table tr.column_width .input div.description{font-size:11px;width:54px;position:absolute;left:10px;text-align:middle}.cpac-column .column-form table tr.column_width .input div.description input{background:#efefef;border:none;height:20px;line-height:20px;text-align:right;width:36px;font-size:12px}.cpac-column .column-form table tr.column_width .input div.width-slider{margin-left:68px;margin-right:90px;position:relative;margin-top:5px}.cpac-column .column-form table tr.column_width .input div.width-slider .ui-slider-handle{cursor:ew-resize}.cpac-column .column-form table tr.column_width .input div.unit-select{position:absolute;top:8px;right:10px;width:90px;text-align:right}.cpac-column .column-form table tr.column_width .input div.unit-select label{padding-left:5px}.cpac-column .column-form table tr.column_image_size{border:10px solid red}.cpac-column .column-form table tr.column_image_size td.input label.custom-size{display:inline-block;margin-top:4px;margin-bottom:4px}.cpac-column .column-form table tr.column_image_size td.input label.custom-size input{margin-right:3px}.cpac-column .column-form table tr.column_image_size td.input .custom_image_size{display:inline-block}.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-h.hidden,.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-w.hidden,.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .hidden{display:none}.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-h,.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-w{margin:0}.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-h input[type=text],.cpac-column .column-form table tr.column_image_size td.input .custom_image_size .custom-size-w input[type=text]{margin-right:3px;width:40px!important}.cpac-column .column-form table tr.column_action td{border-top:1px solid #ebebeb;background:#f9f9f9}.cpac-column .column-form table tr.column_action td p{margin:0}.cpac-column .column-form table tr.column_action td p a.remove-button{color:#a00;text-decoration:none;text-shadow:none;font-weight:400;margin-left:5px;font-size:12px;padding:0 5px}.cpac-column .column-form table tr.column_action td p a.remove-button:hover{color:#fff;background:red}.cpac-column .column-form table tr:first-child td{border-top:none}.cpac-column.loading .column-form>.spinner{position:absolute;left:50%;top:50%;z-index:200;margin-left:-10px;margin-top:-10px;display:block}.cpac-column.loading .column-form:before{content:'';position:absolute;width:100%;height:100%;background:#FFF;z-index:100;opacity:.5}.cpac-column.opened .column-meta{background-color:#c7c7c7;background-image:-ms-linear-gradient(top,#e9e9e9,#c7c7c7);background-image:-moz-linear-gradient(top,#e9e9e9,#c7c7c7);background-image:-o-linear-gradient(top,#e9e9e9,#c7c7c7);background-image:-webkit-gradient(linear,left top,left bottom,from(#e9e9e9),to(#c7c7c7));background-image:-webkit-linear-gradient(top,#e9e9e9,#c7c7c7);background-image:linear-gradient(top,#e9e9e9,#c7c7c7);border-color:#aeaeae}.cpac-column.opened .column-meta table{background:0 0}.cpac-column.opened .column-meta table td{border-color:#f8f8f8;color:#333;text-shadow:0 1px 0 #FFF}.cpac-column.opened .column-meta table td a{color:#333;text-shadow:0 1px 0 #FFF}.cpac-column.opened .column-meta table td.column_sort{background-position:8px -39px}.cpac-column.opened .column-meta table td.column_label .inner .meta span{color:grey;text-shadow:none}.cpac-column.opened .column-meta table td.column_type{color:#5C5C5C}.column-footer{background:#EAF2FA;border:1px solid #c7d7e2;min-height:26px;padding:8px}.column-footer .order-message{background:url(../images/order_arrow.png) no-repeat;color:#7A9BBE;float:left;font-family:Comic Sans MS,sans-serif;font-size:11px;height:13px;line-height:1em;margin-left:4px;padding:7px 0 0 22px;text-shadow:0 1px 0 #FFF;display:inline-block}.column-footer .button-container{float:right;display:inline-block;margin-top:-5px}.column-footer .button-container a{display:inline-block;margin-top:5px;margin-left:5px}.cpac-content-body hr{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background:none;border-color:#DFDFDF -moz-use-text-color -moz-use-text-color;border-image:none;border-right:0 none;border-style:solid none none;border-width:1px 0 0;clear:both;margin:30px 0;opacity:.2}#cpac-welcome.about-wrap div.error{display:block!important}.cpac-alert{display:inline-block;background:#FCF8E3;border:1px solid #FBEED5;border-radius:4px;color:#C09853;margin:20px 0;padding:16px 14px;text-shadow:0 1px 0 rgba(255,255,255,.5)}.cpac-alert p{margin:0}.cpac-alert.cpac-alert-success{background-color:#DFF0D8;border-color:#D6E9C6;color:#468847}.cpac-alert.cpac-alert-error{background-color:#F2DEDE;border-color:#EED3D7;color:#B94A48}.cpac-alert a.button-primary{height:28px;line-height:28px;display:inline-block}#cpac-download-add-ons-table{max-width:600px}.wp-core-ui .button-large{height:40px;line-height:40px;font-size:16px;padding:0 15px;text-shadow:0 1px 0 rgba(0,0,0,.5)}.cac-notification.updated{border-left-color:#0071aa}.cac-notification.updated .learnmore{float:right}.cac-notification.updated .learnmore:after{content:"\f139";font:400 20px/1 dashicons;float:right}.columns-right .sidebox{background:#FFF;border:1px solid #E1E1E1;border-radius:0;box-shadow:0 1px 3px rgba(0,0,0,.1);position:relative;margin-bottom:14px}.columns-right .sidebox h3{padding:10px;margin:0;position:relative}.columns-right .sidebox h3.title{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:15px;font-weight:400;line-height:1;margin:0;padding:7px 10px;background:#f1f1f1;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-moz-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-o-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(to top,#ececec,#f9f9f9);border-bottom-color:#dfdfdf;text-shadow:#fff 0 1px 0;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff;border-bottom-style:solid;border-bottom-width:1px}.columns-right .sidebox h3 span.left{position:relative;background:#fff;z-index:2;padding-right:8px}.columns-right .sidebox h3 span.right{position:absolute;display:inline-block;line-height:20px;z-index:1;right:10px;font-size:12px;text-transform:uppercase;color:grey;text-align:right}.columns-right .sidebox .inside{padding:10px}.columns-right .sidebox .inside p{margin-top:0}.columns-right .sidebox.form-actions .form-reset{display:none;border-bottom:1px solid #F5F5F5;padding:8px}.columns-right .sidebox.form-actions .reset-column-type{text-decoration:none;color:#BC0B0B;line-height:25px;display:inline-block;background:0 0;border:none;padding:0;font-size:13px;cursor:pointer;margin:0}.columns-right .sidebox.form-actions .reset-column-type:hover{color:red}.columns-right .sidebox.form-actions .form-update{padding:8px;overflow:hidden}.columns-right .sidebox.form-actions .submit{display:none;width:100%;height:28px;line-height:28px;text-align:center}.columns-right .sidebox.form-actions .submit.save{display:block}.columns-right .sidebox#pro-version .cta{background:url(../images/get_the_addon.png) no-repeat;background-size:cover}.columns-right .sidebox#pro-version .padding-box{padding:8px 15px 0}.columns-right .sidebox#pro-version h3 a{color:#fff;font-size:19px;text-decoration:none;font-weight:400;margin-top:6px}.columns-right .sidebox#pro-version .inside ul{margin:0 0 10px}.columns-right .sidebox#pro-version .inside ul li{margin:0;padding:0}.columns-right .sidebox#pro-version .inside ul li a{display:inline-block;min-height:24px;font-size:19px;line-height:24px;margin-bottom:1px;padding:0 5px;background:#000;color:#fff;text-decoration:none}.columns-right .sidebox#pro-version .inside ul li.acf a{background-color:#5ee8bf;color:grey}.columns-right .sidebox#pro-version .inside p{color:#fff;font-size:12px}.columns-right .sidebox#pro-version .inside p a{color:#fff;display:inline-block;background:#a4c518;padding:0 2px;font-size:15px;text-decoration:none}.columns-right .sidebox#add-acf{background-color:#5ee8bf}.columns-right .sidebox#add-acf h3{padding:0}.columns-right .sidebox#add-acf h3 a{color:#fff;text-decoration:none;font-size:15px}.columns-right .sidebox#direct-feedback #feedback-rate,.columns-right .sidebox#direct-feedback #feedback-support{display:none}.columns-right .sidebox#direct-feedback .inside>a{border-radius:4px;border:1px solid #CCC;width:48%;height:64px;text-align:center;line-height:64px;font-weight:700;color:#222;display:inline-block;text-decoration:none}.columns-right .sidebox#direct-feedback .inside>a:hover{background:#FAFAFA}.columns-right .sidebox#direct-feedback .inside form textarea{width:100%;height:120px}.columns-right .sidebox#direct-feedback .inside form input[type=submit]{display:inline-block;float:right;border-radius:4px;border:1px solid #CCC;height:32px;text-align:center;line-height:32px;font-weight:700;font-size:12px;padding:0 32px;color:#CCC;background:0 0;text-decoration:none;cursor:pointer}.columns-right .sidebox#direct-feedback .inside form input[type=submit]:hover,.columns-right .sidebox#direct-feedback .inside ul.share li a:hover{background:#FAFAFA}.columns-right .sidebox#direct-feedback .inside form p.description{float:left;font-size:10px}.columns-right .sidebox#direct-feedback .inside ul{margin:0}.columns-right .sidebox#direct-feedback .inside ul.share li{margin:0 0 0 9px;display:block;float:left;width:30%}.columns-right .sidebox#direct-feedback .inside ul.share li a{text-decoration:none;vertical-align:middle;line-height:20px;padding:16px 0;width:100%;text-align:center;border:1px solid #CCC;border-radius:4px;display:block}.wp-pointer.noclick .wp-pointer-buttons,body.rtl .columns-left .column-footer .submit{display:none}.columns-right .sidebox#direct-feedback .inside ul.share li:first-child{margin-left:0}.columns-right .sidebox#direct-feedback #feedback-support .inside ul.share li{width:48%}table.cpac-form-table{max-width:1100px;margin-top:20px}table.cpac-form-table>tbody>tr>td,table.cpac-form-table>tbody>tr>th{vertical-align:top}table.cpac-form-table td.padding-22{padding-top:22px}table.cpac-form-table.settings tr td{padding-top:74px}table.cpac-form-table.settings tr:first-child th{padding-top:0}table.cpac-form-table.settings tr:first-child td{padding-top:54px}.wp-pointer-content ol{margin-left:1.5em;padding:0 15px}.wp-pointer-right{margin-right:15px}body.rtl .wp-pointer-right{margin-left:15px;margin-right:0}body.rtl .wp-pointer-right ol{margin-right:1.5em;margin-left:0}body.rtl .cpac-menu .subsubsub{margin-left:14px;margin-right:0}body.rtl .columns-container{margin-left:300px;margin-right:0}body.rtl .columns-left{float:right}body.rtl .columns-left .cpac-columns .cpac-column .column-meta img{margin-left:3px;margin-right:0}body.rtl .columns-left .cpac-columns .cpac-column .column-meta .column_label .inner>a.remove-button{margin-right:12px;margin-left:0}body.rtl .columns-left .cpac-columns .cpac-column .column-meta .column_label .inner .meta{float:left}body.rtl .columns-left .cpac-columns .cpac-column .column-meta .column_label span.vers{float:right}body.rtl .columns-left .cpac-columns .cpac-column .column-form table tr td.label a.more-info,body.rtl .columns-left .cpac-columns .cpac-column .column-meta span.vers .comment-grey-bubble{float:left}body.rtl .columns-left .cpac-columns .cpac-column .column-meta .column_type{text-align:left;padding-left:0;padding-right:auto}body.rtl .columns-left .cpac-columns .cpac-column .column-form table tr.column_image_size td.input label input{margin-left:3px;margin-right:0}body.rtl .columns-left .cpac-columns .cpac-column .column-form table tr td.label p.description{right:0;left:auto}body.rtl .columns-left .cpac-columns .cpac-column .column-form div.description,body.rtl .columns-left .cpac-columns .cpac-column .column-form div.input-width-range{float:right}body.rtl .columns-left .cpac-columns .cpac-column .column-form tr td.input label{padding-left:10px;padding-right:0}body.rtl .columns-left .cpac-columns .cpac-column .column-form a.help{float:left}body.rtl .columns-left .column-footer .order-message{float:right;padding-right:22px;padding-left:0;background:url(../images/order_arrow-rtl.png) right top no-repeat}body.rtl .columns-left .column-footer .button-container,body.rtl .cpac_export .ms-container .ms-selection{float:left}body.rtl .columns-right{float:left;margin-left:-300px;margin-right:0}body.rtl .cpac-placeholder{padding:5px 0 7px 4px}@media only screen and (max-width:900px){.columns-container{margin-right:0}.columns-container .columns-left,.columns-container .menu{float:none}.columns-container .columns-right{float:none;margin-top:0;margin-right:0;width:100%}}.cpac-addons li{width:200px;background:#FFF;float:left;margin-right:16px;margin-bottom:16px;border:1px solid #DDD;-webkit-box-shadow:0 3px 10px 0 rgba(0,0,0,.15);-moz-box-shadow:0 3px 10px 0 rgba(0,0,0,.15);box-shadow:0 3px 10px 0 rgba(0,0,0,.15)}.cpac-addons li:hover{-webkit-box-shadow:0 3px 10px 0 rgba(0,0,0,.25);-moz-box-shadow:0 3px 10px 0 rgba(0,0,0,.25);box-shadow:0 3px 10px 0 rgba(0,0,0,.25)}.cpac-addons li a{color:#444}.cpac-addons li .cpac-addon-content{display:table;width:100%;height:125px;text-align:center;vertical-align:middle;border-top:1px solid #DDD;background:#0069a4;background:-moz-radial-gradient(center,ellipse cover,#0069a4 0,#085079 100%);background:-webkit-gradient(radial,center center,0,center center,100%,color-stop(0,#0069a4),color-stop(100%,#085079));background:-webkit-radial-gradient(center,ellipse cover,#0069a4 0,#085079 100%);background:-o-radial-gradient(center,ellipse cover,#0069a4 0,#085079 100%);background:-ms-radial-gradient(center,ellipse cover,#0069a4 0,#085079 100%);background:radial-gradient(ellipse at center,#0069a4 0,#085079 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0069a4', endColorstr='#085079', GradientType=1)}.cpac-addons li .cpac-addon-content>*{display:table-cell;vertical-align:middle}.cpac-addons li .cpac-addon-content h3{padding:0 16px;color:#FFF;line-height:150%}.cpac-addons li .cpac-addon-content img{width:100%}.cpac-addons li .cpac-addon-header{width:100%;padding:25px 15px;-moz-box-sizing:border-box;box-sizing:border-box}.cpac-addons li .cpac-addon-header>:first-child{margin-top:0}.cpac-addons li .cpac-addon-header>:last-child{margin-bottom:0}.cpac-addons li .cpac-addon-actions{background:#EEE;border-top:1px solid #DDD;padding:8px}.cpac-addons li .cpac-addon-actions .cpac-installed:before{content:"\f147";font-family:dashicons;vertical-align:middle;margin-left:-5px;margin-right:3px}
assets/css/column.css CHANGED
@@ -21,6 +21,20 @@ span.status-closed {
21
  float: left;
22
  margin-bottom: 4px;
23
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  @media screen and (max-width: 782px) {
25
  .tablenav.top .actions {
26
  display: block !important;
@@ -46,9 +60,18 @@ body.upload-php .tablenav.top .cpac-edit {
46
  height: 20px;
47
  background-color: #e0e0e0;
48
  text-align: center;
49
- margin-left: 8px;
50
  font-size: 12px;
51
  }
 
 
 
 
 
 
 
 
 
52
  /* =Images Column
53
  -------------------------------------------------------------- */
54
  .cpac-column-value-image {
21
  float: left;
22
  margin-bottom: 4px;
23
  }
24
+ body.edit-tags-php .tablenav.top .cpac-edit {
25
+ float: none;
26
+ }
27
+ .cpac_status_yes {
28
+ color: #46b450;
29
+ }
30
+ .cpac_status_no {
31
+ color: #dc3232;
32
+ }
33
+ body.users-php .tablenav .actions a.add-new-h2 {
34
+ float: none;
35
+ vertical-align: middle !important;
36
+ top: 2px !important;
37
+ }
38
  @media screen and (max-width: 782px) {
39
  .tablenav.top .actions {
40
  display: block !important;
60
  height: 20px;
61
  background-color: #e0e0e0;
62
  text-align: center;
63
+ margin-left: 7px;
64
  font-size: 12px;
65
  }
66
+ .cpac-spacing {
67
+ display: inline-block;
68
+ margin-right: 10px;
69
+ margin-bottom: 4px;
70
+ }
71
+ .cpac-suffix {
72
+ margin-left: 8px;
73
+ color: #808080;
74
+ }
75
  /* =Images Column
76
  -------------------------------------------------------------- */
77
  .cpac-column-value-image {
assets/css/column.min.css CHANGED
@@ -1 +1 @@
1
- .actions #post-query-submit,.tablenav.top .cpac-edit{vertical-align:middle;float:left;margin-bottom:4px}.cpac-divider{display:inline-block;width:14px;height:12px;background:url(../images/square.png) 50% 7px no-repeat}span.status-closed{color:red}.tablenav.top .cpac-edit{top:2px;display:inline-block}@media screen and (max-width:782px){.tablenav.top .actions{display:block!important;margin-bottom:4px}.tablenav.top .actions *{display:none}.tablenav.top .actions .cpac-edit{display:inline-block}}body.upload-php .tablenav.top .cpac-edit{float:none}.cpac-rounded{display:inline-block;border-radius:10px;min-width:8px;padding:0 6px;height:20px;background-color:#e0e0e0;text-align:center;margin-left:8px;font-size:12px}.cpac-column-value-image{display:inline-block;background:0 0;margin-right:2px;overflow:hidden;max-width:100%}.rtl .cpac-column-value-image{margin-left:2px;margin-right:0}.cpac-column-value-image img{display:block;margin:0 auto}.column-column-attachment img{padding-right:5px;padding-bottom:4px}.rtl .column-column-attachment img{padding-left:5px;padding-right:0}div.cpac-color{line-height:26px}div.cpac-color span{display:block;-webkit-border-radius:3px;border-radius:3px;color:#fff;float:left;height:16px;line-height:16px;margin-right:12px;overflow:hidden;padding:4px 5px;font-size:10px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;min-width:47px;text-align:center}.rtl div.cpac-color span{float:right;margin-left:12px;margin-right:0}div.sizes span.not-available{color:#999}.button.cpac-button-action{position:relative;text-indent:9999px;margin-right:4px;padding:0 13px;overflow:hidden}.button.cpac-button-action:before{position:absolute;top:0;left:0;width:100%;height:100%;text-indent:0}.cpac-tip{display:inline-block}.qtip.qtip-tipsy{background:rgba(0,0,0,.75);font-weight:400;min-width:25px}
1
+ .actions #post-query-submit,.tablenav.top .cpac-edit{vertical-align:middle;float:left;margin-bottom:4px}.cpac-divider{display:inline-block;width:14px;height:12px;background:url(../images/square.png) 50% 7px no-repeat}span.status-closed{color:red}.tablenav.top .cpac-edit{top:2px;display:inline-block}body.edit-tags-php .tablenav.top .cpac-edit,body.upload-php .tablenav.top .cpac-edit{float:none}.cpac_status_yes{color:#46b450}.cpac_status_no{color:#dc3232}body.users-php .tablenav .actions a.add-new-h2{float:none;vertical-align:middle!important;top:2px!important}@media screen and (max-width:782px){.tablenav.top .actions{display:block!important;margin-bottom:4px}.tablenav.top .actions *{display:none}.tablenav.top .actions .cpac-edit{display:inline-block}}.cpac-rounded{display:inline-block;border-radius:10px;min-width:8px;padding:0 6px;height:20px;background-color:#e0e0e0;text-align:center;margin-left:7px;font-size:12px}.cpac-spacing{display:inline-block;margin-right:10px;margin-bottom:4px}.cpac-suffix{margin-left:8px;color:grey}.cpac-column-value-image{display:inline-block;background:0 0;margin-right:2px;overflow:hidden;max-width:100%}.rtl .cpac-column-value-image{margin-left:2px;margin-right:0}.cpac-column-value-image img{display:block;margin:0 auto}.column-column-attachment img{padding-right:5px;padding-bottom:4px}.rtl .column-column-attachment img{padding-left:5px;padding-right:0}div.cpac-color{line-height:26px}div.cpac-color span{display:block;-webkit-border-radius:3px;border-radius:3px;color:#fff;float:left;height:16px;line-height:16px;margin-right:12px;overflow:hidden;padding:4px 5px;font-size:10px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;min-width:47px;text-align:center}.rtl div.cpac-color span{float:right;margin-left:12px;margin-right:0}div.sizes span.not-available{color:#999}.button.cpac-button-action{position:relative;text-indent:9999px;margin-right:4px;padding:0 13px;overflow:hidden}.button.cpac-button-action:before{position:absolute;top:0;left:0;width:100%;height:100%;text-indent:0}.cpac-tip{display:inline-block}.qtip.qtip-tipsy{background:rgba(0,0,0,.75);font-weight:400;min-width:25px}
assets/images/switch_bw.png DELETED
Binary file
assets/js/admin-settings.js CHANGED
@@ -2,13 +2,14 @@
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
 
11
  // General
 
12
  cpac_pointer();
13
  cpac_submit_form();
14
 
@@ -16,21 +17,12 @@ jQuery(document).ready(function() {
16
  cpac_clear_input_defaults();
17
 
18
  // Columns Page
19
- cpac_sortable();
20
- cpac_menu();
21
  cpac_help();
22
  cpac_add_column();
23
  cpac_importexport();
24
  cpac_sidebar_feedback();
25
-
26
- // we start by binding the toggle and remove events.
27
- jQuery('.cpac-column').each( function( i, col ) {
28
- jQuery( col ).column_bind_toggle();
29
- jQuery( col ).column_bind_remove();
30
- jQuery( col ).column_bind_clone();
31
- jQuery( col ).cpac_bind_container_addon_events();
32
- });
33
- });
34
 
35
  function cpac_importexport() {
36
  jQuery( '#php-export-results textarea' ).on( 'focus, mouseup', function() {
@@ -44,11 +36,67 @@ function cpac_importexport() {
44
  * @since 2.0.2
45
  */
46
  function cpac_submit_form() {
47
- jQuery('.form-update a.submit-update').click( function(e){
48
- e.preventDefault();
49
 
50
- jQuery(this).closest('.columns-container').find('.cpac-columns form').submit();
51
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  /*
@@ -60,18 +108,23 @@ function cpac_submit_form() {
60
  */
61
  jQuery.fn.column_bind_toggle = function() {
62
 
63
- var column = jQuery(this);
 
64
 
65
  column.find( 'td.column_type a, td.column_edit, td.column_label a.toggle, td.column_label .edit-button' ).click( function( e ) {
66
  e.preventDefault();
67
 
68
  column.toggleClass( 'opened' ).find( '.column-form' ).slideToggle( 150 );
69
 
70
- if ( ! column.hasClass( 'events-binded' ) ) {
 
 
 
 
71
  column.column_bind_events();
72
  }
73
 
74
- column.addClass('events-binded');
75
 
76
  // hook for addons
77
  jQuery( document ).trigger( 'column_init', column );
@@ -85,11 +138,11 @@ jQuery.fn.column_bind_toggle = function() {
85
  */
86
  jQuery.fn.column_bind_remove = function() {
87
 
88
- jQuery(this).find('.remove-button').click( function(e) {
89
- jQuery(this).closest('.cpac-column').column_remove();
90
 
91
  e.preventDefault();
92
- });
93
  };
94
 
95
  /**
@@ -116,35 +169,63 @@ jQuery.fn.column_bind_clone = function() {
116
 
117
  jQuery.fn.cpac_column_refresh = function() {
118
  var el = jQuery( this );
 
 
119
 
120
  // Mark column as loading
121
  el.addClass( 'loading' );
122
- el.find( '.column-form' ).prepend( '<span class="spinner" />' );
123
 
124
  // Fetch new form HTML
125
- jQuery.post( ajaxurl, {
126
- plugin_id: 'cpac',
127
- action: 'cpac_column_refresh',
128
- column: jQuery( this ).find( 'input.column-name' ).val(),
129
- formdata: jQuery( this ).parents( 'form' ).serialize()
 
 
 
130
  }, function( data ) {
131
 
132
- // Replace current form by new form
133
- var newel = jQuery( '<div>' + data + '</div>' ).children();
134
- el.replaceWith( newel );
135
- el = newel;
 
136
 
137
- // Bind events
138
- el.column_bind_toggle();
139
- el.column_bind_remove();
140
- el.column_bind_clone();
141
- el.column_bind_events();
142
 
143
- // Remove "loading" marking from column
144
- el.removeClass( 'loading' ).addClass( 'opened' ).find( '.column-form' ).show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
 
146
- // Allow plugins to hook into this event
147
- jQuery( document ).trigger( 'column_change', el );
 
 
 
 
 
148
  } );
149
  };
150
 
@@ -155,18 +236,18 @@ jQuery.fn.cpac_column_refresh = function() {
155
  */
156
  jQuery.fn.column_bind_events = function() {
157
 
158
- var column = jQuery( this );
159
- var container = column.closest( '.columns-container ');
160
- var storage_model = container.attr( 'data-type' );
161
 
162
  // Current column type
163
- var default_value = column.find( '.column_type select option:selected' ).val();
164
 
165
  column.find( '.column_type select' ).change( function() {
166
- var option = jQuery( 'optgroup', this ).children( ':selected' );
167
- var type = option.val();
168
- var label = option.text();
169
- var msg = jQuery( this ).next( '.msg' ).hide();
170
 
171
  // Find template element for this field type
172
  var template = container.find( '.for-cloning-only .cpac-column[data-type="' + type + '"]' );
@@ -176,16 +257,16 @@ jQuery.fn.column_bind_events = function() {
176
  msg.html( template.find( '.is-disabled' ).html() ).show();
177
 
178
  // Set to default
179
- jQuery(this).find( 'option' ).removeAttr( 'selected' );
180
- jQuery(this).find( 'option[value="' + default_value + '"]' ).attr( 'selected', 'selected' );
181
  }
182
  // Prevent column types that do not allow it to have multiple instances
183
  else if ( typeof template.attr( 'data-clone' ) === 'undefined' && jQuery( '.cpac-columns', container ).find( '[data-type="' + type + '"]' ).length ) {
184
  msg.html( cpac_i18n.clone.replace( '%s', '<strong>' + label + '</strong>' ) ).show();
185
 
186
  // Set to default
187
- jQuery(this).find('option').removeAttr('selected');
188
- jQuery(this).find('option[value="' + default_value + '"]').attr('selected', 'selected');
189
 
190
  return;
191
  }
@@ -193,7 +274,7 @@ jQuery.fn.column_bind_events = function() {
193
  var clone = template.clone();
194
 
195
  // Open settings
196
- clone.addClass('opened').find('.column-form').show();
197
  clone.find( '.column-meta' ).replaceWith( column.find( '.column-meta' ) );
198
  clone.find( '.column-form' ).replaceWith( column.find( '.column-form' ) );
199
 
@@ -208,87 +289,87 @@ jQuery.fn.column_bind_events = function() {
208
  } );
209
 
210
  /** change label */
211
- column.find('.column_label .input input').bind( 'keyup change', function() {
212
 
213
  var value = jQuery( this ).val();
214
- jQuery(this).closest('.cpac-column').find( 'td.column_label .inner > a.toggle' ).text( value );
215
- });
216
 
217
  /** width */
218
 
219
- // slider
220
  column.column_width_slider();
221
 
222
  // indicator
223
- var width_indicator = column.find('.column-meta span.width');
224
- width_indicator.on( 'update', function(){
225
- var _width = column.find('input.width').val();
226
- var _unit = column.find('input.unit').filter(':checked').val();
227
- if ( _width > 0 ) {
228
- jQuery(this).text( _width + _unit );
229
  } else {
230
- jQuery(this).text('');
231
  }
232
- });
233
 
234
  // unit selector
235
- var width_unit_select = column.find('.column_width .unit-select label');
236
- width_unit_select.on( 'click', function(){
237
 
238
- column.find('span.unit').text( jQuery(this).find('input').val() );
239
  column.column_width_slider(); // re-init slider
240
- width_indicator.trigger('update'); // update indicator
241
- });
242
 
243
  // width_input
244
- var width_input = column.find('input.width')
245
- .on( 'keyup', function() {
246
- column.column_width_slider(); // re-init slider
247
- jQuery(this).trigger('validate'); // validate input
248
- width_indicator.trigger('update'); // update indicator
249
- })
250
-
251
- // width_input:validate
252
- .on( 'validate', function() {
253
- var _width = width_input.val();
254
- var _new_width = jQuery.trim( _width );
255
-
256
- if ( ! jQuery.isNumeric( _new_width ) ) {
257
- _new_width = _new_width.replace(/\D/g,'');
258
- }
259
- if ( _new_width.length > 3 ) {
260
- _new_width = _new_width.substring(0, 3);
261
- }
262
- if ( _new_width <= 0 ) {
263
- _new_width = '';
264
- }
265
- if ( _new_width !== _width ) {
266
- width_input.val( _new_width );
267
- }
268
- });
269
 
270
  /** display custom image size */
271
- column.find('.column_image_size label.custom-size').click( function(){
272
 
273
- var parent = jQuery(this).closest('.input');
274
 
275
- if ( jQuery(this).hasClass('image-size-custom') ) {
276
- jQuery('.custom-size-w', parent).removeClass('hidden');
277
- jQuery('.custom-size-h', parent).removeClass('hidden');
278
  }
279
 
280
  else {
281
- jQuery('.custom-size-w', parent).addClass('hidden');
282
- jQuery('.custom-size-h', parent).addClass('hidden');
283
  }
284
- });
285
 
286
- /** tooltip */
287
- column.find('.column-form .label label, .column-form .label .info').hover(function(){
288
- jQuery(this).parents( '.label' ).find('p.description').show();
289
- },function(){
290
- jQuery(this).parents( '.label' ).find('p.description').hide();
291
- });
292
 
293
  // refresh column and re-bind all events
294
  column.find( '[data-refresh="1"] select' ).change( function() {
@@ -302,9 +383,9 @@ jQuery.fn.column_bind_events = function() {
302
  * @since 2.0
303
  */
304
  jQuery.fn.column_remove = function() {
305
- jQuery(this).addClass('deleting').animate({ opacity : 0, height: 0 }, 350, function(e) {
306
- jQuery(this).remove();
307
- });
308
  };
309
 
310
  /*
@@ -314,14 +395,14 @@ jQuery.fn.column_remove = function() {
314
  */
315
  jQuery.fn.column_width_slider = function() {
316
 
317
- var column_width = jQuery(this).find('.column_width');
318
 
319
- var input_width = column_width.find('input.width'),
320
- input_unit = column_width.find('input.unit'),
321
- unit = input_unit.filter(':checked').val(),
322
  width = input_width.val(),
323
- slider = column_width.find('.width-slider'),
324
- indicator = jQuery(this).find('.column-meta span.width');
325
 
326
  // width
327
  if ( '%' == unit && width > 100 ) {
@@ -330,18 +411,18 @@ jQuery.fn.column_width_slider = function() {
330
 
331
  input_width.val( width );
332
 
333
- slider.slider({
334
- range: 'min',
335
- min: 0,
336
- max: '%' == unit ? 100 : 500,
337
- value: width,
338
- slide: function( event, ui ) {
339
 
340
  input_width.val( ui.value );
341
- indicator.trigger('update');
342
- input_width.trigger('validate');
343
  }
344
- });
345
  };
346
 
347
  /*
@@ -353,6 +434,7 @@ jQuery.fn.column_clone = function() {
353
 
354
  var container = jQuery( this ).closest( '.columns-container' );
355
  var column = jQuery( this );
 
356
 
357
  if ( typeof column.attr( 'data-clone' ) === 'undefined' ) {
358
  var message = cpac_i18n.clone.replace( '%s', '<strong>' + column.find( '.column_label .toggle' ).text() + '</strong>' );
@@ -381,7 +463,7 @@ jQuery.fn.column_clone = function() {
381
  clone.column_bind_events();
382
 
383
  // reinitialize sortability
384
- cpac_sortable();
385
 
386
  // hook for addons
387
  jQuery( document ).trigger( 'column_add', clone );
@@ -398,24 +480,24 @@ jQuery.fn.cpac_update_clone_id = function( storage_model ) {
398
 
399
  var el = jQuery( this );
400
 
401
- var type = el.attr( 'data-type' );
402
- var all_columns = jQuery( '.columns-container[data-type="' + storage_model + '"]').find( '.cpac-columns' );
403
- var columns = jQuery( all_columns ).find( '*[data-type="' + type + '"]' ).not( el );
404
 
405
  // get clone ID
406
- var ids = jQuery.map( columns, function( e, i ) {
407
- if ( jQuery(e).attr('data-clone') ){
408
  return parseInt( jQuery( e ).attr( 'data-clone' ), 10 );
409
  }
410
  return 0;
411
- });
412
 
413
  ids.sort();
414
  var max_id = Math.max.apply( null, ids ) + 1;
415
- for ( var id=0; id<=max_id; id++ ) {
416
  if ( -1 === jQuery.inArray( id, ids ) ) {
417
- break;
418
- }
419
  }
420
 
421
  // only increment when needed
@@ -442,26 +524,27 @@ jQuery.fn.cpac_update_clone_id = function( storage_model ) {
442
  var new_name = type + '-' + id;
443
 
444
  // name
445
- if( jQuery(v).attr( 'name' ) ) {
446
- jQuery(v).attr( 'name', jQuery(v).attr( 'name' ).replace( type + clone_suffix, new_name) );
447
  }
448
 
449
  // for
450
- if( jQuery(v).attr( 'for' ) ) {
451
- jQuery(v).attr( 'for', jQuery(v).attr( 'for' ).replace( type + clone_suffix, new_name ) );
452
  }
453
 
454
  // id
455
- if( jQuery(v).attr( 'id' ) ) {
456
- jQuery(v).attr( 'id', jQuery(v).attr( 'id' ).replace( type + clone_suffix, new_name ) );
457
  }
458
- });
459
  };
460
 
461
  function cpac_create_column( container ) {
462
 
463
- var clone = jQuery( '.for-cloning-only .cpac-column', container ).first().clone();
464
  var storage_model = container.attr( 'data-type' );
 
465
 
466
  if ( clone.length > 0 ) {
467
  // increment clone id ( before adding to DOM, otherwise radio buttons will reset )
@@ -470,20 +553,8 @@ function cpac_create_column( container ) {
470
  // add to DOM
471
  jQuery( '.cpac-columns form', container ).append( clone );
472
 
473
- // rebind toggle events
474
- clone.column_bind_toggle();
475
-
476
- // rebind remove events
477
- clone.column_bind_remove();
478
-
479
- // rebind clone events
480
- clone.column_bind_clone();
481
-
482
- // rebind all other events
483
- clone.column_bind_events();
484
-
485
- // reinitialize sortability
486
- cpac_sortable();
487
 
488
  // hook for addons
489
  jQuery( document ).trigger( 'column_add', clone );
@@ -504,12 +575,12 @@ function cpac_add_column() {
504
  var clone = cpac_create_column( container );
505
 
506
  // open settings
507
- clone.addClass('opened').find('.column-form').slideDown(150, function(){
508
- jQuery('html, body').animate({ scrollTop: clone.offset().top - 58 }, 300);
509
- });
510
 
511
  e.preventDefault();
512
- });
513
  }
514
 
515
  /**
@@ -541,17 +612,17 @@ function cpac_sidebar_feedback() {
541
  */
542
  function cpac_clear_input_defaults() {
543
  jQuery.fn.cleardefault = function() {
544
- return this.focus(function() {
545
- if( this.value == this.defaultValue ) {
546
  this.value = "";
547
  }
548
- }).blur(function() {
549
- if( !this.value.length ) {
550
  this.value = this.defaultValue;
551
  }
552
- });
553
  };
554
- jQuery("#cpac-box-plugin_settings .addons input").cleardefault();
555
  }
556
 
557
  /*
@@ -560,17 +631,17 @@ function cpac_clear_input_defaults() {
560
  * usage: <a href="javascript:;" class="help" data-help="tab-2"></a>
561
  */
562
  function cpac_help() {
563
- jQuery('#cpac a.help').click( function(e) {
564
  e.preventDefault();
565
 
566
- var panel = jQuery('#contextual-help-wrap');
567
 
568
  panel.parent().show();
569
- jQuery('a[href="#tab-panel-cpac-' + jQuery(this).attr('data-help') + '"]', panel).trigger('click');
570
  panel.slideDown( 'fast', function() {
571
  panel.focus();
572
- });
573
- });
574
  }
575
 
576
  /*
@@ -578,62 +649,75 @@ function cpac_help() {
578
  *
579
  */
580
  function cpac_pointer() {
581
- jQuery('.cpac-pointer').each(function(){
582
 
583
  // vars
584
- var el = jQuery(this),
585
- html = el.attr('rel'),
586
- pos = el.attr('data-pos');
 
 
587
 
588
  var position = {
589
- at: 'left top', // position of wp-pointer relative to the element which triggers the pointer event
590
- my: 'right top', // position of wp-pointer relative to the at-coordinates
591
- edge: 'right', // position of arrow
592
- offset: '0 0' // offset for wp-pointer
593
  };
594
 
 
 
595
  if ( 'right' == pos ) {
596
  position = {
597
- at: 'right middle',
598
- my: 'left middle',
599
- edge: 'left'
 
 
 
 
 
 
 
 
600
  };
601
  }
602
 
603
  // create pointer
604
- el.pointer({
605
- content: jQuery('#' + html).html(),
606
- position: position,
607
- pointerWidth: 250,
608
- close: function() {
609
- el.removeClass('open');
610
  },
611
 
612
  // bug fix. with an arrow on the right side the position of wp-pointer is incorrect. it does not take
613
  // into account the padding of the arrow. adding "wp-pointer-' + position.edge" will fix that.
614
- pointerClass: 'wp-pointer wp-pointer-' + position.edge
615
- });
616
 
617
  // click
618
- el.click( function() {
619
- if( el.hasClass('open') ) {
620
- el.removeClass('open');
621
- }
622
- else {
623
- el.addClass('open');
624
- }
625
- });
 
 
626
 
627
  // show on hover
628
  el.hover( function() {
629
- jQuery(this).pointer('open');
630
  }, function() {
631
- if( ! el.hasClass('open') ) {
632
- jQuery(this).pointer('close');
633
  }
634
 
635
- });
636
- });
637
  }
638
 
639
  /*
@@ -641,8 +725,8 @@ function cpac_pointer() {
641
  *
642
  * @since 1.5
643
  */
644
- function cpac_sortable() {
645
- jQuery( 'div.cpac-columns' ).each( function() {
646
  if ( jQuery( this ).hasClass( 'ui-sortable' ) ) {
647
  jQuery( this ).sortable( 'refresh' );
648
  }
@@ -652,56 +736,72 @@ function cpac_sortable() {
652
  } );
653
  }
654
  } );
655
- }
656
-
657
- /*
658
- * Menu
659
- *
660
- * @since 1.5
661
- */
662
- function cpac_menu() {
663
 
664
- var menu = jQuery('#cpac div.cpac-menu');
665
- // click
666
- menu.find('a').click( function(e, el) {
667
 
668
- var id = jQuery(this).attr('href');
 
669
 
670
- if ( id ) {
 
 
 
 
 
 
671
 
672
- var type = id.replace('#cpac-box-','');
 
673
 
674
- // remove current
675
- jQuery('.cpac-menu a').removeClass('current');
676
- jQuery('.columns-container').hide();
 
 
 
 
677
 
678
- // set current
679
- jQuery(this).addClass('current');
680
- var container = jQuery('.columns-container[data-type="' + type + '"]').show();
681
- var columns = container.find( '.cpac-columns' );
682
 
683
- // hook for addons
684
- jQuery( document ).trigger( 'cac_menu_change', columns );
685
- }
 
686
 
687
- // re init sidebar scroll
688
- //cpac_sidebar_scroll();
 
 
 
 
689
 
690
- e.preventDefault();
691
- });
692
 
693
- // activate first menu
694
- menu.find('a.current').trigger('click');
 
 
 
695
  }
696
 
697
  /*
698
  * Bind events: triggered after column is init, changed or added
699
  *
700
  */
701
- jQuery( document ).bind('column_init column_change column_add', function( e, column ){
 
 
 
 
 
 
 
702
  jQuery( column ).cpac_bind_column_addon_events();
703
- jQuery( column ).cpac_bind_container_addon_events();
704
- });
705
 
706
  /*
707
  * Optional Radio Click events
@@ -710,56 +810,56 @@ jQuery( document ).bind('column_init column_change column_add', function( e, col
710
  jQuery.fn.cpac_bind_column_addon_events = function() {
711
 
712
  var column = jQuery( this );
713
- var inputs = column.find('[data-toggle-id] label');
714
 
715
- inputs.on( 'click', function(){
716
 
717
- var id = jQuery( this ).closest('td.input').data('toggle-id');
718
  var state = jQuery( 'input', this ).val();
719
 
720
  // Toggle indicator icon
721
- var label = column.find('[data-indicator-id="' + id + '"]' ).removeClass( 'on' );
722
  if ( 'on' == state ) {
723
  label.addClass( 'on' );
724
  }
725
 
726
  // Toggle additional options
727
- var additional = column.find('[data-additional-option-id="' + id + '"]' ).addClass( 'hide' );
728
  if ( 'on' == state ) {
729
  additional.removeClass( 'hide' );
730
  }
731
- });
732
 
733
- // Hide additonal options on ready
734
- column.find('[data-toggle-id]').each( function(){
735
- var additional = column.find('[data-additional-option-id="' + jQuery( this ).data('toggle-id') + '"]' ).addClass( 'hide' );
736
  if ( 'on' == jQuery( 'input:checked', this ).val() ) {
737
  additional.removeClass( 'hide' );
738
  }
739
- });
740
  };
741
 
742
  /*
743
  * Indicator Click Events
744
  *
745
  */
746
- jQuery.fn.cpac_bind_container_addon_events = function() {
747
 
748
  var column = jQuery( this );
749
- var indicator = column.find('[data-indicator-id]');
750
 
751
- indicator.unbind('click').click( function() {
752
 
753
- var id = jQuery( this ).data('indicator-id');
754
- var radio = column.find('[data-toggle-id="' + id + '"] input' );
755
 
756
- if ( jQuery( this ).hasClass('on') ) {
757
- jQuery( this ).removeClass('on').addClass('off');
758
- radio.filter('[value=off]').prop('checked', true);
759
  }
760
  else {
761
- jQuery( this ).removeClass('off').addClass('on');
762
- radio.filter('[value=on]').prop('checked', true);
763
  }
764
- });
765
- };
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
 
11
  // General
12
+ cpac_init();
13
  cpac_pointer();
14
  cpac_submit_form();
15
 
17
  cpac_clear_input_defaults();
18
 
19
  // Columns Page
20
+ cpac_menu(); // trigger for all other column events
 
21
  cpac_help();
22
  cpac_add_column();
23
  cpac_importexport();
24
  cpac_sidebar_feedback();
25
+ } );
 
 
 
 
 
 
 
 
26
 
27
  function cpac_importexport() {
28
  jQuery( '#php-export-results textarea' ).on( 'focus, mouseup', function() {
36
  * @since 2.0.2
37
  */
38
  function cpac_submit_form() {
 
 
39
 
40
+ var $save_buttons = jQuery( '.sidebox a.submit, .column-footer a.submit' );
41
+
42
+ $save_buttons.click( function( e ) {
43
+
44
+ var $button = jQuery( this );
45
+ var $container = $button.closest( '.columns-container' ).addClass( 'saving' );
46
+ var columns_data = $container.find( '.cpac-columns form' ).serialize();
47
+ var $msg = $container.find( '.ajax-message' );
48
+
49
+ $save_buttons.attr( 'disabled', 'disabled' );
50
+
51
+ // reset
52
+ $container.find( '.ajax-message' ).hide().removeClass( 'error updated' );
53
+ jQuery( '.cpac_message' ).remove(); // placed by restore button
54
+
55
+ var xhr = jQuery.post( ajaxurl, {
56
+ action : 'cpac_columns_update',
57
+ data : columns_data,
58
+ _ajax_nonce : cpac._ajax_nonce,
59
+ storage_model : $container.data( 'type' ),
60
+ layout : $container.data( 'layout' )
61
+ },
62
+
63
+ // JSON repsonse
64
+ function( response ) {
65
+ if ( response ) {
66
+ if ( response.success ) {
67
+ $msg.addClass( 'updated' ).find( 'p' ).html( response.data );
68
+ $msg.slideDown();//.delay( 2000 ).slideUp();
69
+
70
+ $container.addClass( 'stored' );
71
+ }
72
+
73
+ // Error message
74
+ else if ( response.data ) {
75
+ $msg.addClass( 'error' ).find( 'p' ).html( response.data );
76
+ $msg.slideDown();
77
+ }
78
+ }
79
+
80
+ // No response
81
+ else {
82
+ }
83
+
84
+ }, 'json' );
85
+
86
+ // No JSON
87
+ xhr.fail( function( error ) {
88
+ // We choose not to notify the user of errors, because the settings will have
89
+ // been saved correctly despite of PHP notices/errors from plugin or themes.
90
+ } );
91
+
92
+ // Always
93
+ xhr.always( function() {
94
+ $save_buttons.removeAttr( 'disabled', 'disabled' );
95
+ $container.removeClass( 'saving' );
96
+ } );
97
+
98
+ jQuery( document ).trigger( 'cac_update', $container );
99
+ } );
100
  }
101
 
102
  /*
108
  */
109
  jQuery.fn.column_bind_toggle = function() {
110
 
111
+ var column = jQuery( this );
112
+ var is_disabled = column.closest( 'cpac-boxes' ).hasClass( 'disabled' );
113
 
114
  column.find( 'td.column_type a, td.column_edit, td.column_label a.toggle, td.column_label .edit-button' ).click( function( e ) {
115
  e.preventDefault();
116
 
117
  column.toggleClass( 'opened' ).find( '.column-form' ).slideToggle( 150 );
118
 
119
+ if ( is_disabled ) {
120
+ return;
121
+ }
122
+
123
+ if ( !column.hasClass( 'events-binded' ) ) {
124
  column.column_bind_events();
125
  }
126
 
127
+ column.addClass( 'events-binded' );
128
 
129
  // hook for addons
130
  jQuery( document ).trigger( 'column_init', column );
138
  */
139
  jQuery.fn.column_bind_remove = function() {
140
 
141
+ jQuery( this ).find( '.remove-button' ).click( function( e ) {
142
+ jQuery( this ).closest( '.cpac-column' ).column_remove();
143
 
144
  e.preventDefault();
145
+ } );
146
  };
147
 
148
  /**
169
 
170
  jQuery.fn.cpac_column_refresh = function() {
171
  var el = jQuery( this );
172
+ var select = el.find( '.column_type select' );
173
+ var $container = jQuery( this ).closest( '.columns-container' );
174
 
175
  // Mark column as loading
176
  el.addClass( 'loading' );
177
+ select.prop( 'disabled', 1 );
178
 
179
  // Fetch new form HTML
180
+ var xhr = jQuery.post( ajaxurl, {
181
+ plugin_id : 'cpac',
182
+ action : 'cpac_column_refresh',
183
+ _ajax_nonce : cpac._ajax_nonce,
184
+ column : jQuery( this ).find( 'input.column-name' ).val(),
185
+ formdata : jQuery( this ).parents( 'form' ).serialize(),
186
+ storage_model : $container.data( 'type' ),
187
+ layout : $container.data( 'layout' ),
188
  }, function( data ) {
189
 
190
+ if ( data ) {
191
+ // Replace current form by new form
192
+ var newel = jQuery( '<div>' + data.data + '</div>' ).children();
193
+ el.replaceWith( newel );
194
+ el = newel;
195
 
196
+ // Bind events
197
+ el.column_bind_toggle();
198
+ el.column_bind_remove();
199
+ el.column_bind_clone();
200
+ el.column_bind_events();
201
 
202
+ el.addClass( 'opened' ).find( '.column-form' ).show();
203
+
204
+ // Allow plugins to hook into this event
205
+ jQuery( document ).trigger( 'column_change', el );
206
+ }
207
+
208
+ // Do nothing
209
+ else {
210
+
211
+ }
212
+ }, 'json' );
213
+
214
+ xhr.fail( function( error ) {
215
+ var $msg = el.closest( '.columns-container' ).find( '.ajax-message' );
216
+
217
+ $msg.addClass( 'error' ).find( 'p' ).html( cpac_i18n.error );
218
+ $msg.slideDown();
219
+
220
+ el.slideUp( function() { el.remove() } );
221
 
222
+ console.log( error.responseText );
223
+ } );
224
+
225
+ xhr.always( function() {
226
+ // Remove "loading" marking from column
227
+ el.removeClass( 'loading' );
228
+ select.prop( 'disabled', false );
229
  } );
230
  };
231
 
236
  */
237
  jQuery.fn.column_bind_events = function() {
238
 
239
+ var column = jQuery( this );
240
+ var container = column.closest( '.columns-container ' );
241
+ var storage_model = container.attr( 'data-type' );
242
 
243
  // Current column type
244
+ var default_value = column.find( '.column_type select option:selected' ).val();
245
 
246
  column.find( '.column_type select' ).change( function() {
247
+ var option = jQuery( 'optgroup', this ).children( ':selected' );
248
+ var type = option.val();
249
+ var label = option.text();
250
+ var msg = jQuery( this ).next( '.msg' ).hide();
251
 
252
  // Find template element for this field type
253
  var template = container.find( '.for-cloning-only .cpac-column[data-type="' + type + '"]' );
257
  msg.html( template.find( '.is-disabled' ).html() ).show();
258
 
259
  // Set to default
260
+ jQuery( this ).find( 'option' ).removeAttr( 'selected' );
261
+ jQuery( this ).find( 'option[value="' + default_value + '"]' ).attr( 'selected', 'selected' );
262
  }
263
  // Prevent column types that do not allow it to have multiple instances
264
  else if ( typeof template.attr( 'data-clone' ) === 'undefined' && jQuery( '.cpac-columns', container ).find( '[data-type="' + type + '"]' ).length ) {
265
  msg.html( cpac_i18n.clone.replace( '%s', '<strong>' + label + '</strong>' ) ).show();
266
 
267
  // Set to default
268
+ jQuery( this ).find( 'option' ).removeAttr( 'selected' );
269
+ jQuery( this ).find( 'option[value="' + default_value + '"]' ).attr( 'selected', 'selected' );
270
 
271
  return;
272
  }
274
  var clone = template.clone();
275
 
276
  // Open settings
277
+ clone.addClass( 'opened' ).find( '.column-form' ).show();
278
  clone.find( '.column-meta' ).replaceWith( column.find( '.column-meta' ) );
279
  clone.find( '.column-form' ).replaceWith( column.find( '.column-form' ) );
280
 
289
  } );
290
 
291
  /** change label */
292
+ column.find( '.column_label .input input' ).bind( 'keyup change', function() {
293
 
294
  var value = jQuery( this ).val();
295
+ jQuery( this ).closest( '.cpac-column' ).find( 'td.column_label .inner > a.toggle' ).text( value );
296
+ } );
297
 
298
  /** width */
299
 
300
+ // slider
301
  column.column_width_slider();
302
 
303
  // indicator
304
+ var width_indicator = column.find( '.column-meta span.width' );
305
+ width_indicator.on( 'update', function() {
306
+ var _width = column.find( 'input.width' ).val();
307
+ var _unit = column.find( 'input.unit' ).filter( ':checked' ).val();
308
+ if ( _width > 0 ) {
309
+ jQuery( this ).text( _width + _unit );
310
  } else {
311
+ jQuery( this ).text( '' );
312
  }
313
+ } );
314
 
315
  // unit selector
316
+ var width_unit_select = column.find( '.column_width .unit-select label' );
317
+ width_unit_select.on( 'click', function() {
318
 
319
+ column.find( 'span.unit' ).text( jQuery( this ).find( 'input' ).val() );
320
  column.column_width_slider(); // re-init slider
321
+ width_indicator.trigger( 'update' ); // update indicator
322
+ } );
323
 
324
  // width_input
325
+ var width_input = column.find( 'input.width' )
326
+ .on( 'keyup', function() {
327
+ column.column_width_slider(); // re-init slider
328
+ jQuery( this ).trigger( 'validate' ); // validate input
329
+ width_indicator.trigger( 'update' ); // update indicator
330
+ } )
331
+
332
+ // width_input:validate
333
+ .on( 'validate', function() {
334
+ var _width = width_input.val();
335
+ var _new_width = jQuery.trim( _width );
336
+
337
+ if ( !jQuery.isNumeric( _new_width ) ) {
338
+ _new_width = _new_width.replace( /\D/g, '' );
339
+ }
340
+ if ( _new_width.length > 3 ) {
341
+ _new_width = _new_width.substring( 0, 3 );
342
+ }
343
+ if ( _new_width <= 0 ) {
344
+ _new_width = '';
345
+ }
346
+ if ( _new_width !== _width ) {
347
+ width_input.val( _new_width );
348
+ }
349
+ } );
350
 
351
  /** display custom image size */
352
+ column.find( '.column_image_size label.custom-size' ).click( function() {
353
 
354
+ var parent = jQuery( this ).closest( '.input' );
355
 
356
+ if ( jQuery( this ).hasClass( 'image-size-custom' ) ) {
357
+ jQuery( '.custom-size-w', parent ).removeClass( 'hidden' );
358
+ jQuery( '.custom-size-h', parent ).removeClass( 'hidden' );
359
  }
360
 
361
  else {
362
+ jQuery( '.custom-size-w', parent ).addClass( 'hidden' );
363
+ jQuery( '.custom-size-h', parent ).addClass( 'hidden' );
364
  }
365
+ } );
366
 
367
+ /** tooltip */
368
+ column.find( '.column-form .label label, .column-form .label .info' ).hover( function() {
369
+ jQuery( this ).parents( '.label' ).find( 'p.description' ).show();
370
+ }, function() {
371
+ jQuery( this ).parents( '.label' ).find( 'p.description' ).hide();
372
+ } );
373
 
374
  // refresh column and re-bind all events
375
  column.find( '[data-refresh="1"] select' ).change( function() {
383
  * @since 2.0
384
  */
385
  jQuery.fn.column_remove = function() {
386
+ jQuery( this ).addClass( 'deleting' ).animate( { opacity : 0, height : 0 }, 350, function( e ) {
387
+ jQuery( this ).remove();
388
+ } );
389
  };
390
 
391
  /*
395
  */
396
  jQuery.fn.column_width_slider = function() {
397
 
398
+ var column_width = jQuery( this ).find( '.column_width' );
399
 
400
+ var input_width = column_width.find( 'input.width' ),
401
+ input_unit = column_width.find( 'input.unit' ),
402
+ unit = input_unit.filter( ':checked' ).val(),
403
  width = input_width.val(),
404
+ slider = column_width.find( '.width-slider' ),
405
+ indicator = jQuery( this ).find( '.column-meta span.width' );
406
 
407
  // width
408
  if ( '%' == unit && width > 100 ) {
411
 
412
  input_width.val( width );
413
 
414
+ slider.slider( {
415
+ range : 'min',
416
+ min : 0,
417
+ max : '%' == unit ? 100 : 500,
418
+ value : width,
419
+ slide : function( event, ui ) {
420
 
421
  input_width.val( ui.value );
422
+ indicator.trigger( 'update' );
423
+ input_width.trigger( 'validate' );
424
  }
425
+ } );
426
  };
427
 
428
  /*
434
 
435
  var container = jQuery( this ).closest( '.columns-container' );
436
  var column = jQuery( this );
437
+ var columns = jQuery( this ).closest( 'cpac-columns' );
438
 
439
  if ( typeof column.attr( 'data-clone' ) === 'undefined' ) {
440
  var message = cpac_i18n.clone.replace( '%s', '<strong>' + column.find( '.column_label .toggle' ).text() + '</strong>' );
463
  clone.column_bind_events();
464
 
465
  // reinitialize sortability
466
+ columns.cpac_bind_ordering();
467
 
468
  // hook for addons
469
  jQuery( document ).trigger( 'column_add', clone );
480
 
481
  var el = jQuery( this );
482
 
483
+ var type = el.attr( 'data-type' );
484
+ var all_columns = jQuery( '.columns-container[data-type="' + storage_model + '"]' ).find( '.cpac-columns' );
485
+ var columns = jQuery( all_columns ).find( '*[data-type="' + type + '"]' ).not( el );
486
 
487
  // get clone ID
488
+ var ids = jQuery.map( columns, function( e, i ) {
489
+ if ( jQuery( e ).attr( 'data-clone' ) ) {
490
  return parseInt( jQuery( e ).attr( 'data-clone' ), 10 );
491
  }
492
  return 0;
493
+ } );
494
 
495
  ids.sort();
496
  var max_id = Math.max.apply( null, ids ) + 1;
497
+ for ( var id = 0; id <= max_id; id++ ) {
498
  if ( -1 === jQuery.inArray( id, ids ) ) {
499
+ break;
500
+ }
501
  }
502
 
503
  // only increment when needed
524
  var new_name = type + '-' + id;
525
 
526
  // name
527
+ if ( jQuery( v ).attr( 'name' ) ) {
528
+ jQuery( v ).attr( 'name', jQuery( v ).attr( 'name' ).replace( type + clone_suffix, new_name ) );
529
  }
530
 
531
  // for
532
+ if ( jQuery( v ).attr( 'for' ) ) {
533
+ jQuery( v ).attr( 'for', jQuery( v ).attr( 'for' ).replace( type + clone_suffix, new_name ) );
534
  }
535
 
536
  // id
537
+ if ( jQuery( v ).attr( 'id' ) ) {
538
+ jQuery( v ).attr( 'id', jQuery( v ).attr( 'id' ).replace( type + clone_suffix, new_name ) );
539
  }
540
+ } );
541
  };
542
 
543
  function cpac_create_column( container ) {
544
 
545
+ var clone = jQuery( '.for-cloning-only .cpac-column', container ).not( '[data-default="1"]' ).first().clone();
546
  var storage_model = container.attr( 'data-type' );
547
+ var columns = container.find( 'cpac-columns' );
548
 
549
  if ( clone.length > 0 ) {
550
  // increment clone id ( before adding to DOM, otherwise radio buttons will reset )
553
  // add to DOM
554
  jQuery( '.cpac-columns form', container ).append( clone );
555
 
556
+ // refresh column
557
+ clone.cpac_column_refresh();
 
 
 
 
 
 
 
 
 
 
 
 
558
 
559
  // hook for addons
560
  jQuery( document ).trigger( 'column_add', clone );
575
  var clone = cpac_create_column( container );
576
 
577
  // open settings
578
+ clone.addClass( 'opened' ).find( '.column-form' ).slideDown( 150, function() {
579
+ jQuery( 'html, body' ).animate( { scrollTop : clone.offset().top - 58 }, 300 );
580
+ } );
581
 
582
  e.preventDefault();
583
+ } );
584
  }
585
 
586
  /**
612
  */
613
  function cpac_clear_input_defaults() {
614
  jQuery.fn.cleardefault = function() {
615
+ return this.focus( function() {
616
+ if ( this.value == this.defaultValue ) {
617
  this.value = "";
618
  }
619
+ } ).blur( function() {
620
+ if ( !this.value.length ) {
621
  this.value = this.defaultValue;
622
  }
623
+ } );
624
  };
625
+ jQuery( "#cpac-box-plugin_settings .addons input" ).cleardefault();
626
  }
627
 
628
  /*
631
  * usage: <a href="javascript:;" class="help" data-help="tab-2"></a>
632
  */
633
  function cpac_help() {
634
+ jQuery( '#cpac a.help' ).click( function( e ) {
635
  e.preventDefault();
636
 
637
+ var panel = jQuery( '#contextual-help-wrap' );
638
 
639
  panel.parent().show();
640
+ jQuery( 'a[href="#tab-panel-cpac-' + jQuery( this ).attr( 'data-help' ) + '"]', panel ).trigger( 'click' );
641
  panel.slideDown( 'fast', function() {
642
  panel.focus();
643
+ } );
644
+ } );
645
  }
646
 
647
  /*
649
  *
650
  */
651
  function cpac_pointer() {
652
+ jQuery( '.cpac-pointer' ).each( function() {
653
 
654
  // vars
655
+ var el = jQuery( this ),
656
+ html = el.attr( 'rel' ),
657
+ pos = el.attr( 'data-pos' ),
658
+ w = el.attr( 'data-width' ),
659
+ noclick = el.attr( 'data-noclick' );
660
 
661
  var position = {
662
+ at : 'left top', // position of wp-pointer relative to the element which triggers the pointer event
663
+ my : 'right top', // position of wp-pointer relative to the at-coordinates
664
+ edge : 'right', // position of arrow
 
665
  };
666
 
667
+ var width = w ? w : 250;
668
+
669
  if ( 'right' == pos ) {
670
  position = {
671
+ at : 'right middle',
672
+ my : 'left middle',
673
+ edge : 'left'
674
+ };
675
+ }
676
+
677
+ if ( 'left' == pos ) {
678
+ position = {
679
+ at : 'left middle',
680
+ my : 'right middle',
681
+ edge : 'right'
682
  };
683
  }
684
 
685
  // create pointer
686
+ el.pointer( {
687
+ content : jQuery( '#' + html ).html(),
688
+ position : position,
689
+ pointerWidth : width,
690
+ close : function() {
691
+ el.removeClass( 'open' );
692
  },
693
 
694
  // bug fix. with an arrow on the right side the position of wp-pointer is incorrect. it does not take
695
  // into account the padding of the arrow. adding "wp-pointer-' + position.edge" will fix that.
696
+ pointerClass : 'wp-pointer wp-pointer-' + position.edge + ( noclick ? ' noclick' : '' )
697
+ } );
698
 
699
  // click
700
+ if ( !noclick ) {
701
+ el.click( function() {
702
+ if ( el.hasClass( 'open' ) ) {
703
+ el.removeClass( 'open' );
704
+ }
705
+ else {
706
+ el.addClass( 'open' );
707
+ }
708
+ } );
709
+ }
710
 
711
  // show on hover
712
  el.hover( function() {
713
+ jQuery( this ).pointer( 'open' );
714
  }, function() {
715
+ if ( !el.hasClass( 'open' ) ) {
716
+ jQuery( this ).pointer( 'close' );
717
  }
718
 
719
+ } );
720
+ } );
721
  }
722
 
723
  /*
725
  *
726
  * @since 1.5
727
  */
728
+ jQuery.fn.cpac_bind_ordering = function() {
729
+ jQuery( this ).each( function() {
730
  if ( jQuery( this ).hasClass( 'ui-sortable' ) ) {
731
  jQuery( this ).sortable( 'refresh' );
732
  }
736
  } );
737
  }
738
  } );
739
+ };
 
 
 
 
 
 
 
740
 
741
+ function cpac_init() {
 
 
742
 
743
+ var container = jQuery( '.columns-container' );
744
+ var boxes = container.find( '.cpac-boxes' );
745
 
746
+ // Written for PHP Export
747
+ if ( boxes.hasClass( 'disabled' ) ) {
748
+ boxes.find( '.cpac-column' ).each( function( i, col ) {
749
+ jQuery( col ).column_bind_toggle();
750
+ jQuery( col ).find( 'input, select' ).prop( 'disabled', true );
751
+ } );
752
+ }
753
 
754
+ else {
755
+ var columns = boxes.find( '.cpac-columns' );
756
 
757
+ // we start by binding the toggle and remove events.
758
+ columns.find( '.cpac-column' ).each( function( i, col ) {
759
+ jQuery( col ).column_bind_toggle();
760
+ jQuery( col ).column_bind_remove();
761
+ jQuery( col ).column_bind_clone();
762
+ jQuery( col ).cpac_bind_indicator_events();
763
+ } );
764
 
765
+ // ordering of columns
766
+ columns.cpac_bind_ordering();
767
+ }
 
768
 
769
+ // hook for addons
770
+ jQuery( document ).trigger( 'cac_menu_change', columns ); // deprecated
771
+ jQuery( document ).trigger( 'cac_model_ready', container.data( 'type' ) );
772
+ }
773
 
774
+ /*
775
+ * Menu
776
+ *
777
+ * @since 1.5
778
+ */
779
+ function cpac_menu() {
780
 
781
+ //jQuery( '.spinner' ).css( 'visibility', 'visible' );
 
782
 
783
+ jQuery( '#cpac_storage_modal_select' ).on( 'change', function() {
784
+ jQuery( this ).prop( 'disabled', true ).next( '.spinner' ).css( 'display', 'inline-block' );
785
+ jQuery( '.view-link' ).hide();
786
+ window.location = jQuery( this ).val();
787
+ } );
788
  }
789
 
790
  /*
791
  * Bind events: triggered after column is init, changed or added
792
  *
793
  */
794
+ jQuery( document ).bind( 'column_init column_change column_add', function( e, column ) {
795
+
796
+ var is_disabled = jQuery( column ).closest( '.cpac-boxes' ).hasClass( 'disabled' );
797
+
798
+ if ( is_disabled ) {
799
+ return;
800
+ }
801
+
802
  jQuery( column ).cpac_bind_column_addon_events();
803
+ jQuery( column ).cpac_bind_indicator_events();
804
+ } );
805
 
806
  /*
807
  * Optional Radio Click events
810
  jQuery.fn.cpac_bind_column_addon_events = function() {
811
 
812
  var column = jQuery( this );
813
+ var inputs = column.find( '[data-toggle-id] label' );
814
 
815
+ inputs.on( 'click', function() {
816
 
817
+ var id = jQuery( this ).closest( 'td.input' ).data( 'toggle-id' );
818
  var state = jQuery( 'input', this ).val();
819
 
820
  // Toggle indicator icon
821
+ var label = column.find( '[data-indicator-id="' + id + '"]' ).removeClass( 'on' );
822
  if ( 'on' == state ) {
823
  label.addClass( 'on' );
824
  }
825
 
826
  // Toggle additional options
827
+ var additional = column.find( '[data-additional-option-id="' + id + '"]' ).addClass( 'hide' );
828
  if ( 'on' == state ) {
829
  additional.removeClass( 'hide' );
830
  }
831
+ } );
832
 
833
+ // Toggle additional column settings
834
+ column.find( '[data-toggle-id]' ).each( function() {
835
+ var additional = column.find( '[data-additional-option-id="' + jQuery( this ).data( 'toggle-id' ) + '"]' ).addClass( 'hide' );
836
  if ( 'on' == jQuery( 'input:checked', this ).val() ) {
837
  additional.removeClass( 'hide' );
838
  }
839
+ } );
840
  };
841
 
842
  /*
843
  * Indicator Click Events
844
  *
845
  */
846
+ jQuery.fn.cpac_bind_indicator_events = function() {
847
 
848
  var column = jQuery( this );
849
+ var indicator = column.find( '[data-indicator-id]' );
850
 
851
+ indicator.unbind( 'click' ).click( function() {
852
 
853
+ var id = jQuery( this ).data( 'indicator-id' );
854
+ var radio = column.find( '[data-toggle-id="' + id + '"] input' );
855
 
856
+ if ( jQuery( this ).hasClass( 'on' ) ) {
857
+ jQuery( this ).removeClass( 'on' ).addClass( 'off' );
858
+ radio.filter( '[value=off]' ).prop( 'checked', true );
859
  }
860
  else {
861
+ jQuery( this ).removeClass( 'off' ).addClass( 'on' );
862
+ radio.filter( '[value=on]' ).prop( 'checked', true );
863
  }
864
+ } );
865
+ };
assets/js/admin-settings.min.js CHANGED
@@ -1 +1 @@
1
- function cpac_importexport(){jQuery("#php-export-results textarea").on("focus, mouseup",function(){jQuery(this).select()}).select().focus()}function cpac_submit_form(){jQuery(".form-update a.submit-update").click(function(e){e.preventDefault(),jQuery(this).closest(".columns-container").find(".cpac-columns form").submit()})}function cpac_create_column(e){var n=jQuery(".for-cloning-only .cpac-column",e).first().clone(),t=e.attr("data-type");return n.length>0&&(n.cpac_update_clone_id(t),jQuery(".cpac-columns form",e).append(n),n.column_bind_toggle(),n.column_bind_remove(),n.column_bind_clone(),n.column_bind_events(),cpac_sortable(),jQuery(document).trigger("column_add",n)),n}function cpac_add_column(){jQuery("#cpac .add_column").click(function(e){var n=jQuery(this).closest(".columns-container"),t=cpac_create_column(n);t.addClass("opened").find(".column-form").slideDown(150,function(){jQuery("html, body").animate({scrollTop:t.offset().top-58},300)}),e.preventDefault()})}function cpac_sidebar_feedback(){jQuery(function(e){var n=e(".sidebox#direct-feedback");n.find("#feedback-choice a.no").click(function(e){e.preventDefault(),n.find("#feedback-choice").slideUp(),n.find("#feedback-support").slideDown()}),n.find("#feedback-choice a.yes").click(function(e){e.preventDefault(),n.find("#feedback-choice").slideUp(),n.find("#feedback-rate").slideDown()})})}function cpac_clear_input_defaults(){jQuery.fn.cleardefault=function(){return this.focus(function(){this.value==this.defaultValue&&(this.value="")}).blur(function(){this.value.length||(this.value=this.defaultValue)})},jQuery("#cpac-box-plugin_settings .addons input").cleardefault()}function cpac_help(){jQuery("#cpac a.help").click(function(e){e.preventDefault();var n=jQuery("#contextual-help-wrap");n.parent().show(),jQuery('a[href="#tab-panel-cpac-'+jQuery(this).attr("data-help")+'"]',n).trigger("click"),n.slideDown("fast",function(){n.focus()})})}function cpac_pointer(){jQuery(".cpac-pointer").each(function(){var e=jQuery(this),n=e.attr("rel"),t=e.attr("data-pos"),i={at:"left top",my:"right top",edge:"right",offset:"0 0"};"right"==t&&(i={at:"right middle",my:"left middle",edge:"left"}),e.pointer({content:jQuery("#"+n).html(),position:i,pointerWidth:250,close:function(){e.removeClass("open")},pointerClass:"wp-pointer wp-pointer-"+i.edge}),e.click(function(){e.hasClass("open")?e.removeClass("open"):e.addClass("open")}),e.hover(function(){jQuery(this).pointer("open")},function(){e.hasClass("open")||jQuery(this).pointer("close")})})}function cpac_sortable(){jQuery("div.cpac-columns").each(function(){jQuery(this).hasClass("ui-sortable")?jQuery(this).sortable("refresh"):jQuery(this).sortable({items:".cpac-column"})})}function cpac_menu(){var e=jQuery("#cpac div.cpac-menu");e.find("a").click(function(e,n){var t=jQuery(this).attr("href");if(t){var i=t.replace("#cpac-box-","");jQuery(".cpac-menu a").removeClass("current"),jQuery(".columns-container").hide(),jQuery(this).addClass("current");var c=jQuery('.columns-container[data-type="'+i+'"]').show(),a=c.find(".cpac-columns");jQuery(document).trigger("cac_menu_change",a)}e.preventDefault()}),e.find("a.current").trigger("click")}jQuery(document).ready(function(){return 0===jQuery("#cpac").length?!1:(cpac_pointer(),cpac_submit_form(),cpac_clear_input_defaults(),cpac_sortable(),cpac_menu(),cpac_help(),cpac_add_column(),cpac_importexport(),cpac_sidebar_feedback(),void jQuery(".cpac-column").each(function(e,n){jQuery(n).column_bind_toggle(),jQuery(n).column_bind_remove(),jQuery(n).column_bind_clone(),jQuery(n).cpac_bind_container_addon_events()}))}),jQuery.fn.column_bind_toggle=function(){var e=jQuery(this);e.find("td.column_type a, td.column_edit, td.column_label a.toggle, td.column_label .edit-button").click(function(n){n.preventDefault(),e.toggleClass("opened").find(".column-form").slideToggle(150),e.hasClass("events-binded")||e.column_bind_events(),e.addClass("events-binded"),jQuery(document).trigger("column_init",e)})},jQuery.fn.column_bind_remove=function(){jQuery(this).find(".remove-button").click(function(e){jQuery(this).closest(".cpac-column").column_remove(),e.preventDefault()})},jQuery.fn.column_bind_clone=function(){jQuery(this).find(".clone-button").click(function(e){var n,t;e.preventDefault(),n=jQuery(this).closest(".cpac-column"),t=n.column_clone(),"undefined"!=typeof t&&t.removeClass("loading").hide().slideDown()})},jQuery.fn.cpac_column_refresh=function(){var e=jQuery(this);e.addClass("loading"),e.find(".column-form").prepend('<span class="spinner" />'),jQuery.post(ajaxurl,{plugin_id:"cpac",action:"cpac_column_refresh",column:jQuery(this).find("input.column-name").val(),formdata:jQuery(this).parents("form").serialize()},function(n){var t=jQuery("<div>"+n+"</div>").children();e.replaceWith(t),e=t,e.column_bind_toggle(),e.column_bind_remove(),e.column_bind_clone(),e.column_bind_events(),e.removeClass("loading").addClass("opened").find(".column-form").show(),jQuery(document).trigger("column_change",e)})},jQuery.fn.column_bind_events=function(){var e=jQuery(this),n=e.closest(".columns-container "),t=n.attr("data-type"),i=e.find(".column_type select option:selected").val();e.find(".column_type select").change(function(){var c=jQuery("optgroup",this).children(":selected"),a=c.val(),o=c.text(),r=jQuery(this).next(".msg").hide(),u=n.find('.for-cloning-only .cpac-column[data-type="'+a+'"]');if(u.length)if(u.find(".is-disabled").length)r.html(u.find(".is-disabled").html()).show(),jQuery(this).find("option").removeAttr("selected"),jQuery(this).find('option[value="'+i+'"]').attr("selected","selected");else{if("undefined"==typeof u.attr("data-clone")&&jQuery(".cpac-columns",n).find('[data-type="'+a+'"]').length)return r.html(cpac_i18n.clone.replace("%s","<strong>"+o+"</strong>")).show(),jQuery(this).find("option").removeAttr("selected"),void jQuery(this).find('option[value="'+i+'"]').attr("selected","selected");var l=u.clone();l.addClass("opened").find(".column-form").show(),l.find(".column-meta").replaceWith(e.find(".column-meta")),l.find(".column-form").replaceWith(e.find(".column-form")),l.cpac_update_clone_id(t),e.replaceWith(l),l.cpac_column_refresh()}}),e.find(".column_label .input input").bind("keyup change",function(){var e=jQuery(this).val();jQuery(this).closest(".cpac-column").find("td.column_label .inner > a.toggle").text(e)}),e.column_width_slider();var c=e.find(".column-meta span.width");c.on("update",function(){var n=e.find("input.width").val(),t=e.find("input.unit").filter(":checked").val();n>0?jQuery(this).text(n+t):jQuery(this).text("")});var a=e.find(".column_width .unit-select label");a.on("click",function(){e.find("span.unit").text(jQuery(this).find("input").val()),e.column_width_slider(),c.trigger("update")});var o=e.find("input.width").on("keyup",function(){e.column_width_slider(),jQuery(this).trigger("validate"),c.trigger("update")}).on("validate",function(){var e=o.val(),n=jQuery.trim(e);jQuery.isNumeric(n)||(n=n.replace(/\D/g,"")),n.length>3&&(n=n.substring(0,3)),0>=n&&(n=""),n!==e&&o.val(n)});e.find(".column_image_size label.custom-size").click(function(){var e=jQuery(this).closest(".input");jQuery(this).hasClass("image-size-custom")?(jQuery(".custom-size-w",e).removeClass("hidden"),jQuery(".custom-size-h",e).removeClass("hidden")):(jQuery(".custom-size-w",e).addClass("hidden"),jQuery(".custom-size-h",e).addClass("hidden"))}),e.find(".column-form .label label, .column-form .label .info").hover(function(){jQuery(this).parents(".label").find("p.description").show()},function(){jQuery(this).parents(".label").find("p.description").hide()}),e.find('[data-refresh="1"] select').change(function(){e.cpac_column_refresh()})},jQuery.fn.column_remove=function(){jQuery(this).addClass("deleting").animate({opacity:0,height:0},350,function(e){jQuery(this).remove()})},jQuery.fn.column_width_slider=function(){var e=jQuery(this).find(".column_width"),n=e.find("input.width"),t=e.find("input.unit"),i=t.filter(":checked").val(),c=n.val(),a=e.find(".width-slider"),o=jQuery(this).find(".column-meta span.width");"%"==i&&c>100&&(c=100),n.val(c),a.slider({range:"min",min:0,max:"%"==i?100:500,value:c,slide:function(e,t){n.val(t.value),o.trigger("update"),n.trigger("validate")}})},jQuery.fn.column_clone=function(){var e=jQuery(this).closest(".columns-container"),n=jQuery(this);if("undefined"==typeof n.attr("data-clone")){var t=cpac_i18n.clone.replace("%s","<strong>"+n.find(".column_label .toggle").text()+"</strong>");return n.addClass("opened").find(".column-form").slideDown(150),void n.find(".msg").html(t).show()}var i=jQuery(this).clone();return i.cpac_update_clone_id(e.attr("data-type")),jQuery(this).after(i),i.column_bind_toggle(),i.column_bind_remove(),i.column_bind_clone(),i.column_bind_events(),cpac_sortable(),jQuery(document).trigger("column_add",i),i},jQuery.fn.cpac_update_clone_id=function(e){var n=jQuery(this),t=n.attr("data-type"),i=jQuery('.columns-container[data-type="'+e+'"]').find(".cpac-columns"),c=jQuery(i).find('*[data-type="'+t+'"]').not(n),a=jQuery.map(c,function(e,n){return jQuery(e).attr("data-clone")?parseInt(jQuery(e).attr("data-clone"),10):0});a.sort();for(var o=Math.max.apply(null,a)+1,r=0;o>=r&&-1!==jQuery.inArray(r,a);r++);var u=n.attr("data-clone"),l="";u&&(l="-"+u),n.attr("data-clone",r),n.find("input.clone").val(r),n.find("input.column-name").val(t+"-"+r);var d=n.find("input, select, label");jQuery(d).each(function(e,n){var i=t+"-"+r;jQuery(n).attr("name")&&jQuery(n).attr("name",jQuery(n).attr("name").replace(t+l,i)),jQuery(n).attr("for")&&jQuery(n).attr("for",jQuery(n).attr("for").replace(t+l,i)),jQuery(n).attr("id")&&jQuery(n).attr("id",jQuery(n).attr("id").replace(t+l,i))})},jQuery(document).bind("column_init column_change column_add",function(e,n){jQuery(n).cpac_bind_column_addon_events(),jQuery(n).cpac_bind_container_addon_events()}),jQuery.fn.cpac_bind_column_addon_events=function(){var e=jQuery(this),n=e.find("[data-toggle-id] label");n.on("click",function(){var n=jQuery(this).closest("td.input").data("toggle-id"),t=jQuery("input",this).val(),i=e.find('[data-indicator-id="'+n+'"]').removeClass("on");"on"==t&&i.addClass("on");var c=e.find('[data-additional-option-id="'+n+'"]').addClass("hide");"on"==t&&c.removeClass("hide")}),e.find("[data-toggle-id]").each(function(){var n=e.find('[data-additional-option-id="'+jQuery(this).data("toggle-id")+'"]').addClass("hide");"on"==jQuery("input:checked",this).val()&&n.removeClass("hide")})},jQuery.fn.cpac_bind_container_addon_events=function(){var e=jQuery(this),n=e.find("[data-indicator-id]");n.unbind("click").click(function(){var n=jQuery(this).data("indicator-id"),t=e.find('[data-toggle-id="'+n+'"] input');jQuery(this).hasClass("on")?(jQuery(this).removeClass("on").addClass("off"),t.filter("[value=off]").prop("checked",!0)):(jQuery(this).removeClass("off").addClass("on"),t.filter("[value=on]").prop("checked",!0))})};
1
+ function cpac_importexport(){jQuery("#php-export-results textarea").on("focus, mouseup",function(){jQuery(this).select()}).select().focus()}function cpac_submit_form(){var e=jQuery(".sidebox a.submit, .column-footer a.submit");e.click(function(n){var t=jQuery(this),a=t.closest(".columns-container").addClass("saving"),i=a.find(".cpac-columns form").serialize(),c=a.find(".ajax-message");e.attr("disabled","disabled"),a.find(".ajax-message").hide().removeClass("error updated"),jQuery(".cpac_message").remove();var o=jQuery.post(ajaxurl,{action:"cpac_columns_update",data:i,_ajax_nonce:cpac._ajax_nonce,storage_model:a.data("type"),layout:a.data("layout")},function(e){e&&(e.success?(c.addClass("updated").find("p").html(e.data),c.slideDown(),a.addClass("stored")):e.data&&(c.addClass("error").find("p").html(e.data),c.slideDown()))},"json");o.fail(function(e){}),o.always(function(){e.removeAttr("disabled","disabled"),a.removeClass("saving")}),jQuery(document).trigger("cac_update",a)})}function cpac_create_column(e){var n=jQuery(".for-cloning-only .cpac-column",e).not('[data-default="1"]').first().clone(),t=e.attr("data-type");e.find("cpac-columns");return n.length>0&&(n.cpac_update_clone_id(t),jQuery(".cpac-columns form",e).append(n),n.cpac_column_refresh(),jQuery(document).trigger("column_add",n)),n}function cpac_add_column(){jQuery("#cpac .add_column").click(function(e){var n=jQuery(this).closest(".columns-container"),t=cpac_create_column(n);t.addClass("opened").find(".column-form").slideDown(150,function(){jQuery("html, body").animate({scrollTop:t.offset().top-58},300)}),e.preventDefault()})}function cpac_sidebar_feedback(){jQuery(function(e){var n=e(".sidebox#direct-feedback");n.find("#feedback-choice a.no").click(function(e){e.preventDefault(),n.find("#feedback-choice").slideUp(),n.find("#feedback-support").slideDown()}),n.find("#feedback-choice a.yes").click(function(e){e.preventDefault(),n.find("#feedback-choice").slideUp(),n.find("#feedback-rate").slideDown()})})}function cpac_clear_input_defaults(){jQuery.fn.cleardefault=function(){return this.focus(function(){this.value==this.defaultValue&&(this.value="")}).blur(function(){this.value.length||(this.value=this.defaultValue)})},jQuery("#cpac-box-plugin_settings .addons input").cleardefault()}function cpac_help(){jQuery("#cpac a.help").click(function(e){e.preventDefault();var n=jQuery("#contextual-help-wrap");n.parent().show(),jQuery('a[href="#tab-panel-cpac-'+jQuery(this).attr("data-help")+'"]',n).trigger("click"),n.slideDown("fast",function(){n.focus()})})}function cpac_pointer(){jQuery(".cpac-pointer").each(function(){var e=jQuery(this),n=e.attr("rel"),t=e.attr("data-pos"),a=e.attr("data-width"),i=e.attr("data-noclick"),c={at:"left top",my:"right top",edge:"right"},o=a?a:250;"right"==t&&(c={at:"right middle",my:"left middle",edge:"left"}),"left"==t&&(c={at:"left middle",my:"right middle",edge:"right"}),e.pointer({content:jQuery("#"+n).html(),position:c,pointerWidth:o,close:function(){e.removeClass("open")},pointerClass:"wp-pointer wp-pointer-"+c.edge+(i?" noclick":"")}),i||e.click(function(){e.hasClass("open")?e.removeClass("open"):e.addClass("open")}),e.hover(function(){jQuery(this).pointer("open")},function(){e.hasClass("open")||jQuery(this).pointer("close")})})}function cpac_init(){var e=jQuery(".columns-container"),n=e.find(".cpac-boxes");if(n.hasClass("disabled"))n.find(".cpac-column").each(function(e,n){jQuery(n).column_bind_toggle(),jQuery(n).find("input, select").prop("disabled",!0)});else{var t=n.find(".cpac-columns");t.find(".cpac-column").each(function(e,n){jQuery(n).column_bind_toggle(),jQuery(n).column_bind_remove(),jQuery(n).column_bind_clone(),jQuery(n).cpac_bind_indicator_events()}),t.cpac_bind_ordering()}jQuery(document).trigger("cac_menu_change",t),jQuery(document).trigger("cac_model_ready",e.data("type"))}function cpac_menu(){jQuery("#cpac_storage_modal_select").on("change",function(){jQuery(this).prop("disabled",!0).next(".spinner").css("display","inline-block"),jQuery(".view-link").hide(),window.location=jQuery(this).val()})}jQuery(document).ready(function(){return 0===jQuery("#cpac").length?!1:(cpac_init(),cpac_pointer(),cpac_submit_form(),cpac_clear_input_defaults(),cpac_menu(),cpac_help(),cpac_add_column(),cpac_importexport(),void cpac_sidebar_feedback())}),jQuery.fn.column_bind_toggle=function(){var e=jQuery(this),n=e.closest("cpac-boxes").hasClass("disabled");e.find("td.column_type a, td.column_edit, td.column_label a.toggle, td.column_label .edit-button").click(function(t){t.preventDefault(),e.toggleClass("opened").find(".column-form").slideToggle(150),n||(e.hasClass("events-binded")||e.column_bind_events(),e.addClass("events-binded"),jQuery(document).trigger("column_init",e))})},jQuery.fn.column_bind_remove=function(){jQuery(this).find(".remove-button").click(function(e){jQuery(this).closest(".cpac-column").column_remove(),e.preventDefault()})},jQuery.fn.column_bind_clone=function(){jQuery(this).find(".clone-button").click(function(e){var n,t;e.preventDefault(),n=jQuery(this).closest(".cpac-column"),t=n.column_clone(),"undefined"!=typeof t&&t.removeClass("loading").hide().slideDown()})},jQuery.fn.cpac_column_refresh=function(){var e=jQuery(this),n=e.find(".column_type select"),t=jQuery(this).closest(".columns-container");e.addClass("loading"),n.prop("disabled",1);var a=jQuery.post(ajaxurl,{plugin_id:"cpac",action:"cpac_column_refresh",_ajax_nonce:cpac._ajax_nonce,column:jQuery(this).find("input.column-name").val(),formdata:jQuery(this).parents("form").serialize(),storage_model:t.data("type"),layout:t.data("layout")},function(n){if(n){var t=jQuery("<div>"+n.data+"</div>").children();e.replaceWith(t),e=t,e.column_bind_toggle(),e.column_bind_remove(),e.column_bind_clone(),e.column_bind_events(),e.addClass("opened").find(".column-form").show(),jQuery(document).trigger("column_change",e)}},"json");a.fail(function(n){var t=e.closest(".columns-container").find(".ajax-message");t.addClass("error").find("p").html(cpac_i18n.error),t.slideDown(),e.slideUp(function(){e.remove()}),console.log(n.responseText)}),a.always(function(){e.removeClass("loading"),n.prop("disabled",!1)})},jQuery.fn.column_bind_events=function(){var e=jQuery(this),n=e.closest(".columns-container "),t=n.attr("data-type"),a=e.find(".column_type select option:selected").val();e.find(".column_type select").change(function(){var i=jQuery("optgroup",this).children(":selected"),c=i.val(),o=i.text(),r=jQuery(this).next(".msg").hide(),l=n.find('.for-cloning-only .cpac-column[data-type="'+c+'"]');if(l.length)if(l.find(".is-disabled").length)r.html(l.find(".is-disabled").html()).show(),jQuery(this).find("option").removeAttr("selected"),jQuery(this).find('option[value="'+a+'"]').attr("selected","selected");else{if("undefined"==typeof l.attr("data-clone")&&jQuery(".cpac-columns",n).find('[data-type="'+c+'"]').length)return r.html(cpac_i18n.clone.replace("%s","<strong>"+o+"</strong>")).show(),jQuery(this).find("option").removeAttr("selected"),void jQuery(this).find('option[value="'+a+'"]').attr("selected","selected");var d=l.clone();d.addClass("opened").find(".column-form").show(),d.find(".column-meta").replaceWith(e.find(".column-meta")),d.find(".column-form").replaceWith(e.find(".column-form")),d.cpac_update_clone_id(t),e.replaceWith(d),d.cpac_column_refresh()}}),e.find(".column_label .input input").bind("keyup change",function(){var e=jQuery(this).val();jQuery(this).closest(".cpac-column").find("td.column_label .inner > a.toggle").text(e)}),e.column_width_slider();var i=e.find(".column-meta span.width");i.on("update",function(){var n=e.find("input.width").val(),t=e.find("input.unit").filter(":checked").val();n>0?jQuery(this).text(n+t):jQuery(this).text("")});var c=e.find(".column_width .unit-select label");c.on("click",function(){e.find("span.unit").text(jQuery(this).find("input").val()),e.column_width_slider(),i.trigger("update")});var o=e.find("input.width").on("keyup",function(){e.column_width_slider(),jQuery(this).trigger("validate"),i.trigger("update")}).on("validate",function(){var e=o.val(),n=jQuery.trim(e);jQuery.isNumeric(n)||(n=n.replace(/\D/g,"")),n.length>3&&(n=n.substring(0,3)),0>=n&&(n=""),n!==e&&o.val(n)});e.find(".column_image_size label.custom-size").click(function(){var e=jQuery(this).closest(".input");jQuery(this).hasClass("image-size-custom")?(jQuery(".custom-size-w",e).removeClass("hidden"),jQuery(".custom-size-h",e).removeClass("hidden")):(jQuery(".custom-size-w",e).addClass("hidden"),jQuery(".custom-size-h",e).addClass("hidden"))}),e.find(".column-form .label label, .column-form .label .info").hover(function(){jQuery(this).parents(".label").find("p.description").show()},function(){jQuery(this).parents(".label").find("p.description").hide()}),e.find('[data-refresh="1"] select').change(function(){e.cpac_column_refresh()})},jQuery.fn.column_remove=function(){jQuery(this).addClass("deleting").animate({opacity:0,height:0},350,function(e){jQuery(this).remove()})},jQuery.fn.column_width_slider=function(){var e=jQuery(this).find(".column_width"),n=e.find("input.width"),t=e.find("input.unit"),a=t.filter(":checked").val(),i=n.val(),c=e.find(".width-slider"),o=jQuery(this).find(".column-meta span.width");"%"==a&&i>100&&(i=100),n.val(i),c.slider({range:"min",min:0,max:"%"==a?100:500,value:i,slide:function(e,t){n.val(t.value),o.trigger("update"),n.trigger("validate")}})},jQuery.fn.column_clone=function(){var e=jQuery(this).closest(".columns-container"),n=jQuery(this),t=jQuery(this).closest("cpac-columns");if("undefined"==typeof n.attr("data-clone")){var a=cpac_i18n.clone.replace("%s","<strong>"+n.find(".column_label .toggle").text()+"</strong>");return n.addClass("opened").find(".column-form").slideDown(150),void n.find(".msg").html(a).show()}var i=jQuery(this).clone();return i.cpac_update_clone_id(e.attr("data-type")),jQuery(this).after(i),i.column_bind_toggle(),i.column_bind_remove(),i.column_bind_clone(),i.column_bind_events(),t.cpac_bind_ordering(),jQuery(document).trigger("column_add",i),i},jQuery.fn.cpac_update_clone_id=function(e){var n=jQuery(this),t=n.attr("data-type"),a=jQuery('.columns-container[data-type="'+e+'"]').find(".cpac-columns"),i=jQuery(a).find('*[data-type="'+t+'"]').not(n),c=jQuery.map(i,function(e,n){return jQuery(e).attr("data-clone")?parseInt(jQuery(e).attr("data-clone"),10):0});c.sort();for(var o=Math.max.apply(null,c)+1,r=0;o>=r&&-1!==jQuery.inArray(r,c);r++);var l=n.attr("data-clone"),d="";l&&(d="-"+l),n.attr("data-clone",r),n.find("input.clone").val(r),n.find("input.column-name").val(t+"-"+r);var u=n.find("input, select, label");jQuery(u).each(function(e,n){var a=t+"-"+r;jQuery(n).attr("name")&&jQuery(n).attr("name",jQuery(n).attr("name").replace(t+d,a)),jQuery(n).attr("for")&&jQuery(n).attr("for",jQuery(n).attr("for").replace(t+d,a)),jQuery(n).attr("id")&&jQuery(n).attr("id",jQuery(n).attr("id").replace(t+d,a))})},jQuery.fn.cpac_bind_ordering=function(){jQuery(this).each(function(){jQuery(this).hasClass("ui-sortable")?jQuery(this).sortable("refresh"):jQuery(this).sortable({items:".cpac-column"})})},jQuery(document).bind("column_init column_change column_add",function(e,n){var t=jQuery(n).closest(".cpac-boxes").hasClass("disabled");t||(jQuery(n).cpac_bind_column_addon_events(),jQuery(n).cpac_bind_indicator_events())}),jQuery.fn.cpac_bind_column_addon_events=function(){var e=jQuery(this),n=e.find("[data-toggle-id] label");n.on("click",function(){var n=jQuery(this).closest("td.input").data("toggle-id"),t=jQuery("input",this).val(),a=e.find('[data-indicator-id="'+n+'"]').removeClass("on");"on"==t&&a.addClass("on");var i=e.find('[data-additional-option-id="'+n+'"]').addClass("hide");"on"==t&&i.removeClass("hide")}),e.find("[data-toggle-id]").each(function(){var n=e.find('[data-additional-option-id="'+jQuery(this).data("toggle-id")+'"]').addClass("hide");"on"==jQuery("input:checked",this).val()&&n.removeClass("hide")})},jQuery.fn.cpac_bind_indicator_events=function(){var e=jQuery(this),n=e.find("[data-indicator-id]");n.unbind("click").click(function(){var n=jQuery(this).data("indicator-id"),t=e.find('[data-toggle-id="'+n+'"] input');jQuery(this).hasClass("on")?(jQuery(this).removeClass("on").addClass("off"),t.filter("[value=off]").prop("checked",!0)):(jQuery(this).removeClass("off").addClass("on"),t.filter("[value=on]").prop("checked",!0))})};
classes/column.php CHANGED
@@ -15,7 +15,7 @@ class CPAC_Column {
15
  * @since 2.0
16
  * @var CPAC_Storage_Model $storage_model contains a CPAC_Storage_Model object which the column belongs too.
17
  */
18
- public $storage_model;
19
 
20
  /**
21
  * @since 2.0
@@ -23,12 +23,6 @@ class CPAC_Column {
23
  */
24
  public $options = array();
25
 
26
- /**
27
- * @since 2.0
28
- * @var object $options_default contains the options for the CPAC_Column object before they are populated with user input.
29
- */
30
- protected $options_default;
31
-
32
  /**
33
  * @since 2.0
34
  * @var array $properties describes the fixed properties for the CPAC_Column object.
@@ -113,6 +107,10 @@ class CPAC_Column {
113
  return true;
114
  }
115
 
 
 
 
 
116
  /**
117
  * Overwrite this function in child class.
118
  * Adds (optional) scripts to the listings screen.
@@ -134,12 +132,21 @@ class CPAC_Column {
134
  $this->properties = clone $this->properties;
135
  }
136
 
 
 
 
 
 
 
 
 
 
137
  /**
138
  * @since 2.0
139
  *
140
  * @param object $storage_model CPAC_Storage_Model
141
  */
142
- public function __construct( CPAC_Storage_Model $storage_model ) {
143
 
144
  $this->storage_model = $storage_model;
145
 
@@ -163,7 +170,7 @@ class CPAC_Column {
163
  'is_registered' => true, // Should the column be registered based on conditional logic, example usage see: 'post/page-template.php'
164
  'is_cloneable' => true, // Should the column be cloneable
165
  'default' => false, // Is this a WP default column,
166
- 'group' => 'custom',
167
  'hidden' => false,
168
  'use_before_after' => false
169
  );
@@ -231,7 +238,7 @@ class CPAC_Column {
231
  * @since 2.0
232
  * @see Filter cac/column/properties
233
  */
234
- $this->properties = apply_filters( "cac/column/properties/storage_key={$this->storage_model->key}", $this->properties, $this ); // do not pass $this because object is not ready
235
 
236
  // Column label defaults to column type label
237
  if ( ! isset( $this->options['label'] ) ) {
@@ -273,7 +280,7 @@ class CPAC_Column {
273
  /**
274
  * @since 2.4.7
275
  */
276
- public function set_filter( $filtering_model ) {
277
  $this->filtering_model = $filtering_model;
278
 
279
  return $this;
@@ -289,7 +296,7 @@ class CPAC_Column {
289
  /**
290
  * @since 2.4.8
291
  */
292
- public function set_editable( $editable_model ) {
293
  $this->editable_model = $editable_model;
294
 
295
  return $this;
@@ -372,6 +379,15 @@ class CPAC_Column {
372
  return $this->properties->label;
373
  }
374
 
 
 
 
 
 
 
 
 
 
375
  /**
376
  * Get the column options set by the user
377
  *
@@ -419,28 +435,28 @@ class CPAC_Column {
419
  * @since 2.1.1
420
  */
421
  public function get_post_type() {
422
- return $this->storage_model->get_post_type();
423
  }
424
 
425
  /**
426
  * @since 2.3.4
427
  */
428
  public function get_storage_model() {
429
- return $this->storage_model;
430
  }
431
 
432
  /**
433
  * @since 2.3.4
434
  */
435
  public function get_storage_model_type() {
436
- return $this->storage_model->get_type();
437
  }
438
 
439
  /**
440
  * @since 2.3.4
441
  */
442
- public function get_storage_model_meta_type() {
443
- return $this->storage_model->get_meta_type();
444
  }
445
 
446
  /**
@@ -453,7 +469,7 @@ class CPAC_Column {
453
  }
454
 
455
  public function get_attr_name( $field_name ) {
456
- return "{$this->storage_model->key}[{$this->properties->name}][{$field_name}]";
457
  }
458
 
459
  /**
@@ -462,7 +478,7 @@ class CPAC_Column {
462
  * @return string Attribute Name
463
  */
464
  public function get_attr_id( $field_name ) {
465
- return "cpac-{$this->storage_model->key}-{$this->properties->name}-{$field_name}";
466
  }
467
 
468
  public function attr_id( $field_name ) {
@@ -495,21 +511,20 @@ class CPAC_Column {
495
  if ( isset( $options['excerpt_length'] ) ) {
496
  $options['excerpt_length'] = trim( $options['excerpt_length'] );
497
  if ( empty( $options['excerpt_length'] ) || ! is_numeric( $options['excerpt_length'] ) ) {
498
- $options['excerpt_length'] = $this->options_default->excerpt_length;
499
  }
500
  }
501
 
502
  if ( ! empty( $options['label'] ) ) {
503
- $options['label'] = str_replace( 'data:', '%%data%%', $options['label'] ); // Temporary replace data: urls for image sources. Replace it back later
504
 
505
  // Label can not contains the character ":"" and "'", because
506
  // CPAC_Column::get_sanitized_label() will return an empty string
507
  // and make an exception for site_url()
508
- if ( false === strpos( $options['label'], site_url() ) ) {
 
509
  $options['label'] = str_replace( ':', '', $options['label'] );
510
  $options['label'] = str_replace( "'", '', $options['label'] );
511
  }
512
- $options['label'] = str_replace( '%%data%%', 'data:', $options['label'] ); // Enable data:image url's
513
  }
514
 
515
  // used by child classes for additional sanitizing
@@ -544,12 +559,17 @@ class CPAC_Column {
544
  * @return string Sanitized string
545
  */
546
  public function get_sanitized_label() {
 
 
 
547
 
548
- $string = $this->options->label;
549
- $string = strip_tags( $string );
550
- $string = preg_replace( "/[^a-zA-Z0-9]+/", "", $string );
551
- $string = str_replace( 'http://', '', $string );
552
- $string = str_replace( 'https://', '', $string );
 
 
553
 
554
  return $string;
555
  }
@@ -837,7 +857,8 @@ class CPAC_Column {
837
  $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );
838
  $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );
839
  $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );
840
- } else {
 
841
  $r = hexdec( substr( $hex, 0, 2 ) );
842
  $g = hexdec( substr( $hex, 2, 2 ) );
843
  $b = hexdec( substr( $hex, 4, 2 ) );
@@ -878,6 +899,13 @@ class CPAC_Column {
878
  return preg_match_all( $patterns[ $type ], $input, $matches ) + 1;
879
  }
880
 
 
 
 
 
 
 
 
881
  /**
882
  * @since 1.0
883
  *
@@ -896,7 +924,8 @@ class CPAC_Column {
896
  if ( is_string( $images ) || is_numeric( $images ) ) {
897
  if ( strpos( $images, ',' ) !== false ) {
898
  $images = array_filter( explode( ',', $this->strip_trim( str_replace( ' ', '', $images ) ) ) );
899
- } else {
 
900
  $images = array( $images );
901
  }
902
  }
@@ -976,7 +1005,8 @@ class CPAC_Column {
976
 
977
  $thumbnails[] = "<span class='cpac-column-value-image' style='width:{$width}px;height:{$height}px; background-size: cover; background-image: url({$src}); background-position: center;'></span>";
978
 
979
- } else {
 
980
  $max = max( array( $width, $height ) );
981
  $thumbnails[] = "<span class='cpac-column-value-image' style='width:{$width}px;height:{$height}px;'><img style='max-width:{$max}px;max-height:{$max}px;' src='{$src}' alt=''/></span>";
982
  }
@@ -1001,7 +1031,8 @@ class CPAC_Column {
1001
  foreach ( $pieces as $r_pieces ) {
1002
  if ( is_array( $r_pieces ) ) {
1003
  $retVal[] = $this->recursive_implode( $glue, $r_pieces );
1004
- } else {
 
1005
  $retVal[] = $r_pieces;
1006
  }
1007
  }
@@ -1115,7 +1146,8 @@ class CPAC_Column {
1115
  $first = ! empty( $userdata->first_name ) ? $userdata->first_name : '';
1116
  $last = ! empty( $userdata->last_name ) ? " {$userdata->last_name}" : '';
1117
  $name = $first . $last;
1118
- } elseif ( ! empty( $userdata->{$display_as} ) ) {
 
1119
  $name = $userdata->{$display_as};
1120
  }
1121
  }
@@ -1154,7 +1186,6 @@ class CPAC_Column {
1154
  $field_key = 'date_format';
1155
  $label = __( 'Date Format', 'codepress-admin-columns' );
1156
  $description = __( 'This will determine how the date will be displayed.', 'codepress-admin-columns' );
1157
-
1158
  ?>
1159
  <tr class="column_<?php echo $field_key; ?>">
1160
  <?php $this->label_view( $label, $description, $field_key ); ?>
@@ -1222,9 +1253,10 @@ class CPAC_Column {
1222
  <?php $this->label_view( $label, '', $field_key ); ?>
1223
 
1224
  <td class="input">
1225
- <?php foreach ( $sizes = $this->get_all_image_sizes() as $id => $image_label ) : ?>
 
1226
  <label for="<?php $this->attr_id( $field_key ); ?>-<?php echo $id ?>" class="custom-size">
1227
- <input type="radio" value="<?php echo $id; ?>" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-<?php echo $id ?>"<?php checked( $this->options->image_size, $id ); ?>>
1228
  <?php echo $image_label; ?>
1229
  </label>
1230
  <?php endforeach; ?>
@@ -1365,42 +1397,6 @@ class CPAC_Column {
1365
  <?php
1366
  }
1367
 
1368
- /**
1369
- * @since 2.0
1370
- *
1371
- * @param array Column Objects
1372
- *
1373
- * @return string HTML List
1374
- */
1375
- public function get_column_list( $columns = array(), $label = '' ) {
1376
-
1377
- if ( empty( $columns ) ) {
1378
- return false;
1379
- }
1380
-
1381
- // sort by alphabet
1382
- $_columns = array();
1383
-
1384
- foreach ( $columns as $column ) {
1385
- if ( $column->properties->hidden ) {
1386
- continue;
1387
- }
1388
-
1389
- $_columns[ $column->properties->type ] = ( 0 === strlen( strip_tags( $column->properties->label ) ) ) ? ucfirst( $column->properties->type ) : $column->properties->label;
1390
- }
1391
-
1392
- asort( $_columns );
1393
-
1394
- $list = "<optgroup label='{$label}'>";
1395
- foreach ( $_columns as $type => $label ) {
1396
- $selected = selected( $this->properties->type, $type, false );
1397
- $list .= "<option value='{$type}'{$selected}>{$label}</option>";
1398
- }
1399
- $list .= "</optgroup>";
1400
-
1401
- return $list;
1402
- }
1403
-
1404
  /**
1405
  * @since 2.0
1406
  */
@@ -1408,19 +1404,23 @@ class CPAC_Column {
1408
 
1409
  $classes = implode( ' ', array_filter( array( "cpac-box-{$this->properties->type}", $this->properties->classes ) ) );
1410
 
1411
- // column list
1412
  $column_list = '';
1413
-
1414
- $groups = $this->storage_model->get_column_type_groups();
1415
- foreach ( $groups as $group => $label ) {
1416
- $column_list .= $this->get_column_list( $this->storage_model->column_types[ $group ], $label );
 
 
 
 
1417
  }
1418
 
1419
  // clone attribute
1420
  $data_clone = $this->properties->is_cloneable ? " data-clone='{$this->properties->clone}'" : '';
1421
 
1422
  ?>
1423
- <div class="cpac-column <?php echo $classes; ?>" data-type="<?php echo $this->properties->type; ?>"<?php echo $data_clone; ?>>
1424
  <input type="hidden" class="column-name" name="<?php echo $this->attr_name( 'column-name' ); ?>" value="<?php echo esc_attr( $this->properties->name ); ?>"/>
1425
  <input type="hidden" class="type" name="<?php echo $this->attr_name( 'type' ); ?>" value="<?php echo $this->properties->type; ?>"/>
1426
  <input type="hidden" class="clone" name="<?php echo $this->attr_name( 'clone' ); ?>" value="<?php echo $this->properties->clone; ?>"/>
15
  * @since 2.0
16
  * @var CPAC_Storage_Model $storage_model contains a CPAC_Storage_Model object which the column belongs too.
17
  */
18
+ private $storage_model;
19
 
20
  /**
21
  * @since 2.0
23
  */
24
  public $options = array();
25
 
 
 
 
 
 
 
26
  /**
27
  * @since 2.0
28
  * @var array $properties describes the fixed properties for the CPAC_Column object.
107
  return true;
108
  }
109
 
110
+ public function is_default() {
111
+ return isset( $this->properties->default ) && $this->properties->default;
112
+ }
113
+
114
  /**
115
  * Overwrite this function in child class.
116
  * Adds (optional) scripts to the listings screen.
132
  $this->properties = clone $this->properties;
133
  }
134
 
135
+ /**
136
+ * @since 2.5
137
+ */
138
+ public function __get( $key ) {
139
+ if ( 'storage_model' == $key ) {
140
+ return $this->{"get_$key"}();
141
+ }
142
+ }
143
+
144
  /**
145
  * @since 2.0
146
  *
147
  * @param object $storage_model CPAC_Storage_Model
148
  */
149
+ public function __construct( $storage_model ) {
150
 
151
  $this->storage_model = $storage_model;
152
 
170
  'is_registered' => true, // Should the column be registered based on conditional logic, example usage see: 'post/page-template.php'
171
  'is_cloneable' => true, // Should the column be cloneable
172
  'default' => false, // Is this a WP default column,
173
+ 'group' => __( 'Custom', 'codepress-admin-columns' ),
174
  'hidden' => false,
175
  'use_before_after' => false
176
  );
238
  * @since 2.0
239
  * @see Filter cac/column/properties
240
  */
241
+ $this->properties = apply_filters( "cac/column/properties/storage_key={$this->get_storage_model()->key}", $this->properties, $this ); // do not pass $this because object is not ready
242
 
243
  // Column label defaults to column type label
244
  if ( ! isset( $this->options['label'] ) ) {
280
  /**
281
  * @since 2.4.7
282
  */
283
+ public function set_filter( CAC_Filtering_Model $filtering_model ) {
284
  $this->filtering_model = $filtering_model;
285
 
286
  return $this;
296
  /**
297
  * @since 2.4.8
298
  */
299
+ public function set_editable( CACIE_Editable_Model $editable_model ) {
300
  $this->editable_model = $editable_model;
301
 
302
  return $this;
379
  return $this->properties->label;
380
  }
381
 
382
+ /**
383
+ * Get the type of the column.
384
+ *
385
+ * @since 2.5
386
+ */
387
+ public function is_registered() {
388
+ return $this->properties->is_registered;
389
+ }
390
+
391
  /**
392
  * Get the column options set by the user
393
  *
435
  * @since 2.1.1
436
  */
437
  public function get_post_type() {
438
+ return $this->get_storage_model()->get_post_type();
439
  }
440
 
441
  /**
442
  * @since 2.3.4
443
  */
444
  public function get_storage_model() {
445
+ return cpac()->get_storage_model( $this->storage_model );
446
  }
447
 
448
  /**
449
  * @since 2.3.4
450
  */
451
  public function get_storage_model_type() {
452
+ return $this->get_storage_model()->get_type();
453
  }
454
 
455
  /**
456
  * @since 2.3.4
457
  */
458
+ public function get_meta_type() {
459
+ return $this->get_storage_model()->get_meta_type();
460
  }
461
 
462
  /**
469
  }
470
 
471
  public function get_attr_name( $field_name ) {
472
+ return "{$this->get_storage_model()->key}[{$this->properties->name}][{$field_name}]";
473
  }
474
 
475
  /**
478
  * @return string Attribute Name
479
  */
480
  public function get_attr_id( $field_name ) {
481
+ return "cpac-{$this->get_storage_model()->key}-{$this->properties->name}-{$field_name}";
482
  }
483
 
484
  public function attr_id( $field_name ) {
511
  if ( isset( $options['excerpt_length'] ) ) {
512
  $options['excerpt_length'] = trim( $options['excerpt_length'] );
513
  if ( empty( $options['excerpt_length'] ) || ! is_numeric( $options['excerpt_length'] ) ) {
514
+ $options['excerpt_length'] = 30;
515
  }
516
  }
517
 
518
  if ( ! empty( $options['label'] ) ) {
 
519
 
520
  // Label can not contains the character ":"" and "'", because
521
  // CPAC_Column::get_sanitized_label() will return an empty string
522
  // and make an exception for site_url()
523
+ // Enable data:image url's
524
+ if ( false === strpos( $options['label'], site_url() ) && false === strpos( $options['label'], 'data:' ) ) {
525
  $options['label'] = str_replace( ':', '', $options['label'] );
526
  $options['label'] = str_replace( "'", '', $options['label'] );
527
  }
 
528
  }
529
 
530
  // used by child classes for additional sanitizing
559
  * @return string Sanitized string
560
  */
561
  public function get_sanitized_label() {
562
+ if ( $this->properties->default ) {
563
+ $string = $this->properties->name;
564
+ }
565
 
566
+ else {
567
+ $string = $this->options->label;
568
+ $string = strip_tags( $string );
569
+ $string = preg_replace( "/[^a-zA-Z0-9]+/", "", $string );
570
+ $string = str_replace( 'http://', '', $string );
571
+ $string = str_replace( 'https://', '', $string );
572
+ }
573
 
574
  return $string;
575
  }
857
  $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );
858
  $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );
859
  $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );
860
+ }
861
+ else {
862
  $r = hexdec( substr( $hex, 0, 2 ) );
863
  $g = hexdec( substr( $hex, 2, 2 ) );
864
  $b = hexdec( substr( $hex, 4, 2 ) );
899
  return preg_match_all( $patterns[ $type ], $input, $matches ) + 1;
900
  }
901
 
902
+ /**
903
+ * @since 2.5
904
+ */
905
+ public function get_empty_char() {
906
+ return '&ndash;'; // dash
907
+ }
908
+
909
  /**
910
  * @since 1.0
911
  *
924
  if ( is_string( $images ) || is_numeric( $images ) ) {
925
  if ( strpos( $images, ',' ) !== false ) {
926
  $images = array_filter( explode( ',', $this->strip_trim( str_replace( ' ', '', $images ) ) ) );
927
+ }
928
+ else {
929
  $images = array( $images );
930
  }
931
  }
1005
 
1006
  $thumbnails[] = "<span class='cpac-column-value-image' style='width:{$width}px;height:{$height}px; background-size: cover; background-image: url({$src}); background-position: center;'></span>";
1007
 
1008
+ }
1009
+ else {
1010
  $max = max( array( $width, $height ) );
1011
  $thumbnails[] = "<span class='cpac-column-value-image' style='width:{$width}px;height:{$height}px;'><img style='max-width:{$max}px;max-height:{$max}px;' src='{$src}' alt=''/></span>";
1012
  }
1031
  foreach ( $pieces as $r_pieces ) {
1032
  if ( is_array( $r_pieces ) ) {
1033
  $retVal[] = $this->recursive_implode( $glue, $r_pieces );
1034
+ }
1035
+ else {
1036
  $retVal[] = $r_pieces;
1037
  }
1038
  }
1146
  $first = ! empty( $userdata->first_name ) ? $userdata->first_name : '';
1147
  $last = ! empty( $userdata->last_name ) ? " {$userdata->last_name}" : '';
1148
  $name = $first . $last;
1149
+ }
1150
+ elseif ( ! empty( $userdata->{$display_as} ) ) {
1151
  $name = $userdata->{$display_as};
1152
  }
1153
  }
1186
  $field_key = 'date_format';
1187
  $label = __( 'Date Format', 'codepress-admin-columns' );
1188
  $description = __( 'This will determine how the date will be displayed.', 'codepress-admin-columns' );
 
1189
  ?>
1190
  <tr class="column_<?php echo $field_key; ?>">
1191
  <?php $this->label_view( $label, $description, $field_key ); ?>
1253
  <?php $this->label_view( $label, '', $field_key ); ?>
1254
 
1255
  <td class="input">
1256
+ <?php foreach ( $sizes = $this->get_all_image_sizes() as $id => $image_label ) : $_sizes = array_keys( $sizes ); ?>
1257
+ <?php $selected = $this->options->image_size ? $this->options->image_size : $_sizes[0]; ?>
1258
  <label for="<?php $this->attr_id( $field_key ); ?>-<?php echo $id ?>" class="custom-size">
1259
+ <input type="radio" value="<?php echo $id; ?>" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-<?php echo $id ?>"<?php checked( $selected, $id ); ?>>
1260
  <?php echo $image_label; ?>
1261
  </label>
1262
  <?php endforeach; ?>
1397
  <?php
1398
  }
1399
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1400
  /**
1401
  * @since 2.0
1402
  */
1404
 
1405
  $classes = implode( ' ', array_filter( array( "cpac-box-{$this->properties->type}", $this->properties->classes ) ) );
1406
 
1407
+ // Selector
1408
  $column_list = '';
1409
+ if ( $grouped_columns = $this->get_storage_model()->get_grouped_columns() ) {
1410
+ foreach ( $grouped_columns as $group => $columns ) {
1411
+ $column_list .= '<optgroup label="' . $group . '">';
1412
+ foreach ( $columns as $type => $label ) {
1413
+ $column_list .= '<option value="' . $type . '"' . selected( $this->properties->type, $type, false ) . '>' . $label . '</option>';
1414
+ }
1415
+ $column_list .= '</optgroup>';
1416
+ }
1417
  }
1418
 
1419
  // clone attribute
1420
  $data_clone = $this->properties->is_cloneable ? " data-clone='{$this->properties->clone}'" : '';
1421
 
1422
  ?>
1423
+ <div class="cpac-column <?php echo $classes; ?>" data-type="<?php echo $this->properties->type; ?>"<?php echo $data_clone; ?> data-default="<?php echo $this->is_default(); ?>">
1424
  <input type="hidden" class="column-name" name="<?php echo $this->attr_name( 'column-name' ); ?>" value="<?php echo esc_attr( $this->properties->name ); ?>"/>
1425
  <input type="hidden" class="type" name="<?php echo $this->attr_name( 'type' ); ?>" value="<?php echo $this->properties->type; ?>"/>
1426
  <input type="hidden" class="clone" name="<?php echo $this->attr_name( 'clone' ); ?>" value="<?php echo $this->properties->clone; ?>"/>
classes/column/actions.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * Base class for columns containing action links for items.
4
  *
@@ -12,6 +13,7 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
12
  * @since 2.2.6
13
  *
14
  * @param int $id Item ID to get the list of actions for.
 
15
  * @return array List of actions ([action name] => [action link]).
16
  */
17
  abstract public function get_actions( $id );
@@ -21,7 +23,6 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
21
  * @since 2.2.6
22
  */
23
  public function init() {
24
-
25
  parent::init();
26
 
27
  // Properties
@@ -37,9 +38,12 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
37
  * @since 2.2.6
38
  */
39
  public function get_value( $id ) {
40
-
41
  $actions = $this->get_raw_value( $id );
42
 
 
 
 
 
43
  if ( ! empty( $this->options->use_icons ) ) {
44
  return implode( '', $this->convert_actions_to_icons( $actions ) );
45
  }
@@ -49,7 +53,7 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
49
 
50
  foreach ( $actions as $class => $action ) {
51
  $actions[ $class ] = '<span class="' . esc_attr( $class ) . '">' . $action . ( $i < $num_actions - 1 ? ' | ' : '' ) . '</span>';
52
- $i++;
53
  }
54
 
55
  return implode( '', $actions );
@@ -78,7 +82,6 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
78
  * @since 2.2.6
79
  */
80
  public function display_settings() {
81
-
82
  parent::display_settings();
83
 
84
  $this->display_field_use_icons();
@@ -90,18 +93,17 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
90
  * @since 2.2.6
91
  */
92
  public function display_field_use_icons() {
93
-
94
  ?>
95
  <tr class="column_editing">
96
  <?php $this->label_view( __( 'Use icons?', 'codepress-admin-columns' ), __( 'Use icons instead of text for displaying the actions.', 'codepress-admin-columns' ), 'use_icons' ); ?>
97
  <td class="input">
98
  <label for="<?php $this->attr_id( 'use_icons' ); ?>-yes">
99
  <input type="radio" value="1" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-yes"<?php checked( $this->options->use_icons, '1' ); ?> />
100
- <?php _e( 'Yes'); ?>
101
  </label>
102
  <label for="<?php $this->attr_id( 'use_icons' ); ?>-no">
103
  <input type="radio" value="" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-no"<?php checked( $this->options->use_icons, '' ); ?> />
104
- <?php _e( 'No'); ?>
105
  </label>
106
  </td>
107
  </tr>
@@ -114,6 +116,7 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
114
  * @since 2.2.6
115
  *
116
  * @param array $actions List of actions ([action name] => [action link]).
 
117
  * @return array List of actions ([action name] => [action icon link]).
118
  */
119
  public function convert_actions_to_icons( $actions ) {
@@ -154,6 +157,7 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
154
  * @since 2.2.6.1
155
  *
156
  * @param array $matches Matches information from preg_replace_callback
 
157
  * @return string Link part with tooltip attribute
158
  */
159
  public function add_link_tooltip( $matches ) {
@@ -170,20 +174,19 @@ abstract class CPAC_Column_Actions extends CPAC_Column {
170
  public function get_actions_icons() {
171
 
172
  return array(
173
- 'edit' => 'edit',
174
- 'trash' => 'trash',
175
- 'delete' => 'trash',
176
- 'untrash' => 'undo',
177
- 'unspam' => 'undo',
178
- 'view' => 'visibility',
179
- 'inline' => 'welcome-write-blog',
180
  'quickedit' => 'welcome-write-blog',
181
- 'approve' => 'yes',
182
  'unapprove' => 'no',
183
- 'reply' => 'testimonial',
184
- 'trash' => 'trash',
185
- 'spam' => 'welcome-comments'
186
  );
187
  }
188
-
189
  }
1
  <?php
2
+
3
  /**
4
  * Base class for columns containing action links for items.
5
  *
13
  * @since 2.2.6
14
  *
15
  * @param int $id Item ID to get the list of actions for.
16
+ *
17
  * @return array List of actions ([action name] => [action link]).
18
  */
19
  abstract public function get_actions( $id );
23
  * @since 2.2.6
24
  */
25
  public function init() {
 
26
  parent::init();
27
 
28
  // Properties
38
  * @since 2.2.6
39
  */
40
  public function get_value( $id ) {
 
41
  $actions = $this->get_raw_value( $id );
42
 
43
+ if ( ! $actions ) {
44
+ return false;
45
+ }
46
+
47
  if ( ! empty( $this->options->use_icons ) ) {
48
  return implode( '', $this->convert_actions_to_icons( $actions ) );
49
  }
53
 
54
  foreach ( $actions as $class => $action ) {
55
  $actions[ $class ] = '<span class="' . esc_attr( $class ) . '">' . $action . ( $i < $num_actions - 1 ? ' | ' : '' ) . '</span>';
56
+ $i ++;
57
  }
58
 
59
  return implode( '', $actions );
82
  * @since 2.2.6
83
  */
84
  public function display_settings() {
 
85
  parent::display_settings();
86
 
87
  $this->display_field_use_icons();
93
  * @since 2.2.6
94
  */
95
  public function display_field_use_icons() {
 
96
  ?>
97
  <tr class="column_editing">
98
  <?php $this->label_view( __( 'Use icons?', 'codepress-admin-columns' ), __( 'Use icons instead of text for displaying the actions.', 'codepress-admin-columns' ), 'use_icons' ); ?>
99
  <td class="input">
100
  <label for="<?php $this->attr_id( 'use_icons' ); ?>-yes">
101
  <input type="radio" value="1" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-yes"<?php checked( $this->options->use_icons, '1' ); ?> />
102
+ <?php _e( 'Yes' ); ?>
103
  </label>
104
  <label for="<?php $this->attr_id( 'use_icons' ); ?>-no">
105
  <input type="radio" value="" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-no"<?php checked( $this->options->use_icons, '' ); ?> />
106
+ <?php _e( 'No' ); ?>
107
  </label>
108
  </td>
109
  </tr>
116
  * @since 2.2.6
117
  *
118
  * @param array $actions List of actions ([action name] => [action link]).
119
+ *
120
  * @return array List of actions ([action name] => [action icon link]).
121
  */
122
  public function convert_actions_to_icons( $actions ) {
157
  * @since 2.2.6.1
158
  *
159
  * @param array $matches Matches information from preg_replace_callback
160
+ *
161
  * @return string Link part with tooltip attribute
162
  */
163
  public function add_link_tooltip( $matches ) {
174
  public function get_actions_icons() {
175
 
176
  return array(
177
+ 'edit' => 'edit',
178
+ 'trash' => 'trash',
179
+ 'delete' => 'trash',
180
+ 'untrash' => 'undo',
181
+ 'unspam' => 'undo',
182
+ 'view' => 'visibility',
183
+ 'inline' => 'welcome-write-blog',
184
  'quickedit' => 'welcome-write-blog',
185
+ 'approve' => 'yes',
186
  'unapprove' => 'no',
187
+ 'reply' => 'testimonial',
188
+ 'trash' => 'trash',
189
+ 'spam' => 'welcome-comments'
190
  );
191
  }
 
192
  }
classes/column/comment/approved.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Comment_Approved
4
  *
@@ -15,8 +16,8 @@ class CPAC_Column_Comment_Approved extends CPAC_Column {
15
  parent::init();
16
 
17
  // Properties
18
- $this->properties['type'] = 'column-approved';
19
- $this->properties['label'] = __( 'Approved', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,7 +25,7 @@ class CPAC_Column_Comment_Approved extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  public function get_value( $id ) {
27
- return $this->get_raw_value( $id ) ? $this->get_asset_image( 'checkmark.png' ) : $this->get_asset_image( 'no.png' );
28
  }
29
 
30
  /**
@@ -32,6 +33,7 @@ class CPAC_Column_Comment_Approved extends CPAC_Column {
32
  */
33
  public function get_raw_value( $id ) {
34
  $comment = get_comment( $id );
 
35
  return $comment->comment_approved;
36
  }
37
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Comment_Approved
5
  *
16
  parent::init();
17
 
18
  // Properties
19
+ $this->properties['type'] = 'column-approved';
20
+ $this->properties['label'] = __( 'Approved', 'codepress-admin-columns' );
21
  }
22
 
23
  /**
25
  * @since 2.0
26
  */
27
  public function get_value( $id ) {
28
+ return $this->get_raw_value( $id ) ? '<span class="dashicons dashicons-yes cpac_status_yes"></span>' : '<span class="dashicons dashicons-no cpac_status_no"></span>';;
29
  }
30
 
31
  /**
33
  */
34
  public function get_raw_value( $id ) {
35
  $comment = get_comment( $id );
36
+
37
  return $comment->comment_approved;
38
  }
39
  }
classes/column/comment/status.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CPAC_Column_Comment_Approved
5
+ *
6
+ * @since 2.0
7
+ */
8
+ class CPAC_Column_Comment_Status extends CPAC_Column {
9
+
10
+ /**
11
+ * @see CPAC_Column::init()
12
+ * @since 2.2.1
13
+ */
14
+ public function init() {
15
+
16
+ parent::init();
17
+
18
+ // Properties
19
+ $this->properties['type'] = 'column-status';
20
+ $this->properties['label'] = __( 'Status', 'codepress-admin-columns' );
21
+ }
22
+
23
+ /**
24
+ * @see CPAC_Column::get_value()
25
+ * @since 2.0
26
+ */
27
+ public function get_value( $id ) {
28
+ return $this->get_raw_value( $id );
29
+ }
30
+
31
+ public function get_statuses() {
32
+ return array(
33
+ 'trash' => __( 'Trash' ),
34
+ 'post-trashed' => __( 'Trash' ),
35
+ 'spam' => __( 'Spam' ),
36
+ '1' => __( 'Approved' ),
37
+ '0' => __( 'Pending' ),
38
+ );
39
+ }
40
+
41
+ /**
42
+ * @since 2.4.2
43
+ */
44
+ public function get_raw_value( $id ) {
45
+ $comment = get_comment( $id );
46
+ $statuses = $this->get_statuses();
47
+
48
+ return isset( $statuses[ $comment->comment_approved ] ) ? $statuses[ $comment->comment_approved ] : '';
49
+ }
50
+ }
classes/column/comment/type.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * @since 2.4.2
4
  */
@@ -9,8 +10,8 @@ class CPAC_Column_Comment_Type extends CPAC_Column {
9
  parent::init();
10
 
11
  // Properties
12
- $this->properties['type'] = 'column-type';
13
- $this->properties['label'] = __( 'Type', 'codepress-admin-columns' );
14
  }
15
 
16
  public function get_value( $id ) {
@@ -19,6 +20,7 @@ class CPAC_Column_Comment_Type extends CPAC_Column {
19
 
20
  public function get_raw_value( $id ) {
21
  $comment = get_comment( $id );
 
22
  return $comment->comment_type;
23
  }
24
  }
1
  <?php
2
+
3
  /**
4
  * @since 2.4.2
5
  */
10
  parent::init();
11
 
12
  // Properties
13
+ $this->properties['type'] = 'column-type';
14
+ $this->properties['label'] = __( 'Type', 'codepress-admin-columns' );
15
  }
16
 
17
  public function get_value( $id ) {
20
 
21
  public function get_raw_value( $id ) {
22
  $comment = get_comment( $id );
23
+
24
  return $comment->comment_type;
25
  }
26
  }
classes/column/custom-field.php CHANGED
@@ -23,7 +23,7 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
23
  $this->properties['type'] = 'column-meta';
24
  $this->properties['label'] = __( 'Custom Field', 'codepress-admin-columns' );
25
  $this->properties['classes'] = 'cpac-box-metafield';
26
- $this->properties['group'] = 'custom-field';
27
  $this->properties['use_before_after'] = true;
28
 
29
  // Options
@@ -145,7 +145,8 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
145
  // check for multiple id's
146
  if ( strpos( $meta, ',' ) !== false ) {
147
  $ids = explode( ',', $meta );
148
- } elseif ( is_numeric( $meta ) ) {
 
149
  $ids[] = $meta;
150
  }
151
 
@@ -198,7 +199,6 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
198
  return $meta;
199
  }
200
 
201
-
202
  /**
203
  * Get Users by ID - Value method
204
  *
@@ -299,7 +299,7 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
299
  break;
300
 
301
  case "checkmark" :
302
- $checkmark = $this->get_asset_image( 'checkmark.png' );
303
 
304
  if ( empty( $meta ) || 'false' === $meta || '0' === $meta ) {
305
  $checkmark = '';
@@ -371,7 +371,7 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
371
  $raw_value = '';
372
 
373
  if ( $field_key = $this->get_field_key() ) {
374
- $raw_value = get_metadata( $this->storage_model->meta_type, $id, $field_key, $single );
375
  }
376
 
377
  return apply_filters( 'cac/column/meta/raw_value', $raw_value, $id, $field_key, $this );
@@ -382,7 +382,6 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
382
  * @since 1.0
383
  */
384
  public function get_value( $id ) {
385
-
386
  $value = '';
387
 
388
  if ( $meta = $this->get_meta_by_id( $id ) ) {
@@ -405,7 +404,7 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
405
  * @since 2.4.7
406
  */
407
  public function get_meta_keys() {
408
- return $this->storage_model->get_meta_keys();
409
  }
410
 
411
  public function get_meta_keys_list() {
@@ -416,7 +415,8 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
416
  foreach ( $keys as $field ) {
417
  if ( substr( $field, 0, 10 ) == "cpachidden" ) {
418
  $lists['hidden'][] = $field;
419
- } else {
 
420
  $lists['public'][] = $field;
421
  }
422
  }
@@ -453,8 +453,9 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
453
  <?php
454
  if ( $list = $this->get_meta_keys_list() ) {
455
  echo $list;
456
- } else {
457
- _e( 'No custom fields available.', 'codepress-admin-columns' ); ?><?php printf( __( 'Please create a %s item first.', 'codepress-admin-columns' ), '<strong>' . $this->storage_model->singular_label . '</strong>' );
 
458
  }
459
  ?>
460
  </td>
23
  $this->properties['type'] = 'column-meta';
24
  $this->properties['label'] = __( 'Custom Field', 'codepress-admin-columns' );
25
  $this->properties['classes'] = 'cpac-box-metafield';
26
+ $this->properties['group'] = __( 'Custom Field', 'codepress-admin-columns' );
27
  $this->properties['use_before_after'] = true;
28
 
29
  // Options
145
  // check for multiple id's
146
  if ( strpos( $meta, ',' ) !== false ) {
147
  $ids = explode( ',', $meta );
148
+ }
149
+ elseif ( is_numeric( $meta ) ) {
150
  $ids[] = $meta;
151
  }
152
 
199
  return $meta;
200
  }
201
 
 
202
  /**
203
  * Get Users by ID - Value method
204
  *
299
  break;
300
 
301
  case "checkmark" :
302
+ $checkmark = '<span class="dashicons dashicons-yes cpac_status_yes"></span>';
303
 
304
  if ( empty( $meta ) || 'false' === $meta || '0' === $meta ) {
305
  $checkmark = '';
371
  $raw_value = '';
372
 
373
  if ( $field_key = $this->get_field_key() ) {
374
+ $raw_value = get_metadata( $this->get_meta_type(), $id, $field_key, $single );
375
  }
376
 
377
  return apply_filters( 'cac/column/meta/raw_value', $raw_value, $id, $field_key, $this );
382
  * @since 1.0
383
  */
384
  public function get_value( $id ) {
 
385
  $value = '';
386
 
387
  if ( $meta = $this->get_meta_by_id( $id ) ) {
404
  * @since 2.4.7
405
  */
406
  public function get_meta_keys() {
407
+ return $this->get_storage_model()->get_meta_keys();
408
  }
409
 
410
  public function get_meta_keys_list() {
415
  foreach ( $keys as $field ) {
416
  if ( substr( $field, 0, 10 ) == "cpachidden" ) {
417
  $lists['hidden'][] = $field;
418
+ }
419
+ else {
420
  $lists['public'][] = $field;
421
  }
422
  }
453
  <?php
454
  if ( $list = $this->get_meta_keys_list() ) {
455
  echo $list;
456
+ }
457
+ else {
458
+ _e( 'No custom fields available.', 'codepress-admin-columns' ); ?><?php printf( __( 'Please create a %s item first.', 'codepress-admin-columns' ), '<strong>' . $this->get_storage_model()->singular_label . '</strong>' );
459
  }
460
  ?>
461
  </td>
classes/column/default.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Column class for default columns (i.e. columns not added by Admin Columns).
4
  * Allows additional properties, such as editability and filterability, to be
5
- * added to defeault column types.
6
  *
7
  * @since 2.2.1
8
  */
@@ -19,6 +19,7 @@ class CPAC_Column_Default extends CPAC_Column {
19
  // Properties
20
  $this->properties['type'] = 'column-default';
21
  $this->properties['handle'] = NULL;
 
22
  }
23
 
24
  /**
@@ -26,12 +27,10 @@ class CPAC_Column_Default extends CPAC_Column {
26
  * @see CPAC_Column::get_value()
27
  */
28
  public function get_value( $post_id ) {
29
-
30
  if ( ! empty( $this->properties->handle ) ) {
31
- return $this->storage_model->get_original_column_value( $this->properties->handle, $post_id );
32
  }
33
 
34
  return '';
35
  }
36
-
37
  }
2
  /**
3
  * Column class for default columns (i.e. columns not added by Admin Columns).
4
  * Allows additional properties, such as editability and filterability, to be
5
+ * added to default column types.
6
  *
7
  * @since 2.2.1
8
  */
19
  // Properties
20
  $this->properties['type'] = 'column-default';
21
  $this->properties['handle'] = NULL;
22
+ $this->properties['group'] = __( 'Default', 'codepress-admin-columns' );
23
  }
24
 
25
  /**
27
  * @see CPAC_Column::get_value()
28
  */
29
  public function get_value( $post_id ) {
 
30
  if ( ! empty( $this->properties->handle ) ) {
31
+ return $this->get_storage_model()->get_original_column_value( $this->properties->handle, $post_id );
32
  }
33
 
34
  return '';
35
  }
 
36
  }
classes/column/media/actions.php CHANGED
@@ -15,6 +15,10 @@ class CPAC_Column_Media_Actions extends CPAC_Column_Actions {
15
 
16
  global $wp_list_table;
17
 
 
 
 
 
18
  $post = get_post( $id );
19
  $att_title = _draft_or_post_title( $id );
20
 
15
 
16
  global $wp_list_table;
17
 
18
+ if ( ! $wp_list_table ) {
19
+ return;
20
+ }
21
+
22
  $post = get_post( $id );
23
  $att_title = _draft_or_post_title( $id );
24
 
classes/column/media/description.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Media_Description
4
  *
@@ -15,8 +16,8 @@ class CPAC_Column_Media_Description extends CPAC_Column {
15
  parent::init();
16
 
17
  // Properties
18
- $this->properties['type'] = 'column-description';
19
- $this->properties['label'] = __( 'Description', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,7 +25,6 @@ class CPAC_Column_Media_Description extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  public function get_value( $id ) {
27
-
28
  return $this->get_raw_value( $id );
29
  }
30
 
@@ -33,7 +33,6 @@ class CPAC_Column_Media_Description extends CPAC_Column {
33
  * @since 2.3.2
34
  */
35
  public function get_raw_value( $id ) {
36
-
37
  return get_post_field( 'post_content', $id );
38
  }
39
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Media_Description
5
  *
16
  parent::init();
17
 
18
  // Properties
19
+ $this->properties['type'] = 'column-description';
20
+ $this->properties['label'] = __( 'Description', 'codepress-admin-columns' );
21
  }
22
 
23
  /**
25
  * @since 2.0
26
  */
27
  public function get_value( $id ) {
 
28
  return $this->get_raw_value( $id );
29
  }
30
 
33
  * @since 2.3.2
34
  */
35
  public function get_raw_value( $id ) {
 
36
  return get_post_field( 'post_content', $id );
37
  }
38
  }
classes/column/media/dimensions.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Media_Dimensions
4
  *
@@ -15,8 +16,8 @@ class CPAC_Column_Media_Dimensions extends CPAC_Column {
15
  parent::init();
16
 
17
  // Properties
18
- $this->properties['type'] = 'column-dimensions';
19
- $this->properties['label'] = __( 'Dimensions', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Media_Dimensions
5
  *
16
  parent::init();
17
 
18
  // Properties
19
+ $this->properties['type'] = 'column-dimensions';
20
+ $this->properties['label'] = __( 'Dimensions', 'codepress-admin-columns' );
21
  }
22
 
23
  /**
classes/column/media/full-path.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Media_Full_Path
4
  *
@@ -15,8 +16,8 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
15
  parent::init();
16
 
17
  // Properties
18
- $this->properties['type'] = 'column-full_path';
19
- $this->properties['label'] = __( 'Full path', 'codepress-admin-columns' );
20
 
21
  // Options
22
  $this->options['path_scope'] = 'full';
@@ -30,9 +31,7 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
30
 
31
  $value = '';
32
 
33
- $file = wp_get_attachment_url( $id );
34
-
35
- if ( $file ) {
36
  switch ( $this->options->path_scope ) {
37
  case 'relative-domain':
38
  $file = str_replace( 'https://', 'http://', $file );
@@ -68,7 +67,6 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
68
  * @since 2.3.4
69
  */
70
  public function display_settings() {
71
-
72
  $this->display_field_path_scope();
73
  }
74
 
@@ -79,9 +77,9 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
79
  */
80
  public function display_field_path_scope() {
81
 
82
- $field_key = 'path_scope';
83
- $label = __( 'Path scope', 'codepress-admin-columns' );
84
- $description = __( 'Part of the file path to display', 'codepress-admin-columns' );
85
 
86
  ?>
87
  <tr class="column_<?php echo $field_key; ?>">
@@ -103,7 +101,7 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
103
  </label>
104
  </td>
105
  </tr>
106
- <?php
107
  }
108
 
109
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Media_Full_Path
5
  *
16
  parent::init();
17
 
18
  // Properties
19
+ $this->properties['type'] = 'column-full_path';
20
+ $this->properties['label'] = __( 'Full path', 'codepress-admin-columns' );
21
 
22
  // Options
23
  $this->options['path_scope'] = 'full';
31
 
32
  $value = '';
33
 
34
+ if ( $file = wp_get_attachment_url( $id ) ) {
 
 
35
  switch ( $this->options->path_scope ) {
36
  case 'relative-domain':
37
  $file = str_replace( 'https://', 'http://', $file );
67
  * @since 2.3.4
68
  */
69
  public function display_settings() {
 
70
  $this->display_field_path_scope();
71
  }
72
 
77
  */
78
  public function display_field_path_scope() {
79
 
80
+ $field_key = 'path_scope';
81
+ $label = __( 'Path scope', 'codepress-admin-columns' );
82
+ $description = __( 'Part of the file path to display', 'codepress-admin-columns' );
83
 
84
  ?>
85
  <tr class="column_<?php echo $field_key; ?>">
101
  </label>
102
  </td>
103
  </tr>
104
+ <?php
105
  }
106
 
107
  }
classes/column/media/height.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Media_Height
4
  *
@@ -6,32 +7,22 @@
6
  */
7
  class CPAC_Column_Media_Height extends CPAC_Column {
8
 
9
- /**
10
- * @see CPAC_Column::init()
11
- * @since 2.2.1
12
- */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-height';
19
- $this->properties['label'] = __( 'Height', 'codepress-admin-columns' );
20
  }
21
 
22
- /**
23
- * @see CPAC_Column::get_value()
24
- * @since 2.0
25
- */
26
  function get_value( $id ) {
 
27
 
28
- $value = '';
 
29
 
 
30
  $meta = get_post_meta( $id, '_wp_attachment_metadata', true );
31
 
32
- if( ! empty( $meta['height'] ) )
33
- $value = $meta['height'];
34
-
35
- return $value;
36
  }
37
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Media_Height
5
  *
7
  */
8
  class CPAC_Column_Media_Height extends CPAC_Column {
9
 
 
 
 
 
10
  public function init() {
 
11
  parent::init();
12
 
13
+ $this->properties['type'] = 'column-height';
14
+ $this->properties['label'] = __( 'Height', 'codepress-admin-columns' );
 
15
  }
16
 
 
 
 
 
17
  function get_value( $id ) {
18
+ $value = $this->get_raw_value( $id );
19
 
20
+ return $value ? $value . 'px' : $this->get_empty_char();
21
+ }
22
 
23
+ function get_raw_value( $id ) {
24
  $meta = get_post_meta( $id, '_wp_attachment_metadata', true );
25
 
26
+ return ! empty( $meta['height'] ) ? $meta['height'] : false;
 
 
 
27
  }
28
  }
classes/column/media/width.php CHANGED
@@ -6,32 +6,22 @@
6
  */
7
  class CPAC_Column_Media_Width extends CPAC_Column {
8
 
9
- /**
10
- * @see CPAC_Column::init()
11
- * @since 2.2.1
12
- */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-width';
19
- $this->properties['label'] = __( 'Width', 'codepress-admin-columns' );
20
  }
21
 
22
- /**
23
- * @see CPAC_Column::get_value()
24
- * @since 2.0
25
- */
26
  function get_value( $id ) {
 
27
 
28
- $value = '';
 
29
 
 
30
  $meta = get_post_meta( $id, '_wp_attachment_metadata', true );
31
 
32
- if( ! empty( $meta['width'] ) )
33
- $value = $meta['width'];
34
-
35
- return $value;
36
  }
37
  }
6
  */
7
  class CPAC_Column_Media_Width extends CPAC_Column {
8
 
 
 
 
 
9
  public function init() {
 
10
  parent::init();
11
 
12
+ $this->properties['type'] = 'column-width';
13
+ $this->properties['label'] = __( 'Width', 'codepress-admin-columns' );
 
14
  }
15
 
 
 
 
 
16
  function get_value( $id ) {
17
+ $value = $this->get_raw_value( $id );
18
 
19
+ return $value ? $value . 'px' : $this->get_empty_char();
20
+ }
21
 
22
+ function get_raw_value( $id ) {
23
  $meta = get_post_meta( $id, '_wp_attachment_metadata', true );
24
 
25
+ return ! empty( $meta['width'] ) ? $meta['width'] : false;
 
 
 
26
  }
27
  }
classes/column/post/actions.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Post_Actions
4
  *
@@ -14,13 +15,13 @@ class CPAC_Column_Post_Actions extends CPAC_Column_Actions {
14
 
15
  $actions = array();
16
 
17
- $post = get_post( $item_id );
18
- $title = _draft_or_post_title();
19
- $post_type_object = get_post_type_object( $post->post_type );
20
- $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
21
- $quickedit_enabled = false;
22
 
23
- $stored_columns = $this->storage_model->get_stored_columns();
24
 
25
  foreach ( $stored_columns as $column ) {
26
  if ( $column['type'] == 'title' ) {
@@ -37,23 +38,27 @@ class CPAC_Column_Post_Actions extends CPAC_Column_Actions {
37
  }
38
  }
39
  if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
40
- if ( 'trash' == $post->post_status )
41
  $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
42
- elseif ( EMPTY_TRASH_DAYS )
 
43
  $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
44
- if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
 
45
  $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
 
46
  }
47
  if ( $post_type_object->public ) {
48
  if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
49
- if ( $can_edit_post )
50
  $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
51
- } elseif ( 'trash' != $post->post_status ) {
 
 
52
  $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
53
  }
54
  }
55
 
56
  return $actions;
57
  }
58
-
59
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Post_Actions
5
  *
15
 
16
  $actions = array();
17
 
18
+ $post = get_post( $item_id );
19
+ $title = _draft_or_post_title();
20
+ $post_type_object = get_post_type_object( $post->post_type );
21
+ $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
22
+ $quickedit_enabled = false;
23
 
24
+ $stored_columns = $this->get_storage_model()->get_stored_columns();
25
 
26
  foreach ( $stored_columns as $column ) {
27
  if ( $column['type'] == 'title' ) {
38
  }
39
  }
40
  if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
41
+ if ( 'trash' == $post->post_status ) {
42
  $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
43
+ }
44
+ elseif ( EMPTY_TRASH_DAYS ) {
45
  $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
46
+ }
47
+ if ( 'trash' == $post->post_status || ! EMPTY_TRASH_DAYS ) {
48
  $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
49
+ }
50
  }
51
  if ( $post_type_object->public ) {
52
  if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
53
+ if ( $can_edit_post ) {
54
  $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
55
+ }
56
+ }
57
+ elseif ( 'trash' != $post->post_status ) {
58
  $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
59
  }
60
  }
61
 
62
  return $actions;
63
  }
 
64
  }
classes/column/post/attachment-count.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * Column displaying number of attachment for an item.
4
  *
@@ -6,41 +7,27 @@
6
  */
7
  class CPAC_Column_Post_Attachment_Count extends CPAC_Column {
8
 
9
- /**
10
- * @see CPAC_Column::init()
11
- * @since 2.2.1
12
- */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-attachment_count';
19
- $this->properties['label'] = __( 'No. of Attachments', 'codepress-admin-columns' );
20
  }
21
 
22
- /**
23
- * @see CPAC_Column::get_value()
24
- * @since 2.0
25
- */
26
  function get_value( $post_id ) {
 
27
 
28
- return $this->get_raw_value( $post_id );
29
  }
30
 
31
- /**
32
- * @see CPAC_Column::get_raw_value()
33
- * @since 2.0.3
34
- */
35
  function get_raw_value( $post_id ) {
36
-
37
  $attachment_ids = get_posts( array(
38
- 'post_type' => 'attachment',
39
- 'numberposts' => -1,
40
- 'post_status' => null,
41
- 'post_parent' => $post_id,
42
- 'fields' => 'ids'
43
- ));
44
 
45
  return count( $attachment_ids );
46
  }
1
  <?php
2
+
3
  /**
4
  * Column displaying number of attachment for an item.
5
  *
7
  */
8
  class CPAC_Column_Post_Attachment_Count extends CPAC_Column {
9
 
 
 
 
 
10
  public function init() {
 
11
  parent::init();
12
 
13
+ $this->properties['type'] = 'column-attachment_count';
14
+ $this->properties['label'] = __( 'No. of Attachments', 'codepress-admin-columns' );
 
15
  }
16
 
 
 
 
 
17
  function get_value( $post_id ) {
18
+ $count = $this->get_raw_value( $post_id );
19
 
20
+ return $count ? $count : $this->get_empty_char();
21
  }
22
 
 
 
 
 
23
  function get_raw_value( $post_id ) {
 
24
  $attachment_ids = get_posts( array(
25
+ 'post_type' => 'attachment',
26
+ 'numberposts' => - 1,
27
+ 'post_status' => null,
28
+ 'post_parent' => $post_id,
29
+ 'fields' => 'ids'
30
+ ) );
31
 
32
  return count( $attachment_ids );
33
  }
classes/column/post/author-name.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * Column displaying information about the author of a post, such as the
4
  * author's display name, user ID and email address.
@@ -12,18 +13,16 @@ class CPAC_Column_Post_Author_Name extends CPAC_Column {
12
  * @since 2.2.1
13
  */
14
  public function init() {
15
-
16
  parent::init();
17
 
18
- // Properties
19
- $this->properties['type'] = 'column-author_name';
20
- $this->properties['label'] = __( 'Display Author As', 'codepress-admin-columns' );
21
- $this->properties['is_cloneable'] = true;
22
- $this->properties['object_property'] = 'post_author';
23
 
24
  // Options
25
- $this->options['display_author_as'] = '';
26
- $this->options['user_link_to'] = '';
27
  }
28
 
29
  /**
@@ -31,7 +30,6 @@ class CPAC_Column_Post_Author_Name extends CPAC_Column {
31
  * @since 2.0
32
  */
33
  public function get_value( $post_id ) {
34
-
35
  $value = '';
36
 
37
  if ( $user_id = $this->get_raw_value( $post_id ) ) {
@@ -45,7 +43,7 @@ class CPAC_Column_Post_Author_Name extends CPAC_Column {
45
  case 'view_user_posts':
46
  $link = add_query_arg( array(
47
  'post_type' => get_post_field( 'post_type', $post_id ),
48
- 'author' => get_the_author_meta( 'ID' )
49
  ), 'edit.php' );
50
  break;
51
  case 'view_author':
@@ -67,7 +65,6 @@ class CPAC_Column_Post_Author_Name extends CPAC_Column {
67
  * @since 2.0.3
68
  */
69
  public function get_raw_value( $post_id ) {
70
-
71
  return get_post_field( 'post_author', $post_id );
72
  }
73
 
@@ -78,7 +75,6 @@ class CPAC_Column_Post_Author_Name extends CPAC_Column {
78
  * @since 2.0
79
  */
80
  public function display_settings() {
81
-
82
  $this->display_field_user_format();
83
  $this->display_field_user_link_to();
84
  }
@@ -89,15 +85,14 @@ class CPAC_Column_Post_Author_Name extends CPAC_Column {
89
  * @since 2.4.7
90
  */
91
  public function display_field_user_link_to() {
92
-
93
  $this->display_field_select(
94
  'user_link_to',
95
  __( 'Link To', 'codepress-admin-columns' ),
96
  array(
97
- '' => __( 'None' ),
98
- 'edit_user' => __( 'Edit User Profile' ),
99
  'view_user_posts' => __( 'View User Posts' ),
100
- 'view_author' => __( 'View Public Author Page', 'codepress-admin-columns' )
101
  ),
102
  __( 'Page the author name should link to.', 'codepress-admin-columns' )
103
  );
1
  <?php
2
+
3
  /**
4
  * Column displaying information about the author of a post, such as the
5
  * author's display name, user ID and email address.
13
  * @since 2.2.1
14
  */
15
  public function init() {
 
16
  parent::init();
17
 
18
+ $this->properties['type'] = 'column-author_name';
19
+ $this->properties['label'] = __( 'Display Author As', 'codepress-admin-columns' );
20
+ $this->properties['is_cloneable'] = true;
21
+ $this->properties['object_property'] = 'post_author';
 
22
 
23
  // Options
24
+ $this->options['display_author_as'] = '';
25
+ $this->options['user_link_to'] = '';
26
  }
27
 
28
  /**
30
  * @since 2.0
31
  */
32
  public function get_value( $post_id ) {
 
33
  $value = '';
34
 
35
  if ( $user_id = $this->get_raw_value( $post_id ) ) {
43
  case 'view_user_posts':
44
  $link = add_query_arg( array(
45
  'post_type' => get_post_field( 'post_type', $post_id ),
46
+ 'author' => get_the_author_meta( 'ID' )
47
  ), 'edit.php' );
48
  break;
49
  case 'view_author':
65
  * @since 2.0.3
66
  */
67
  public function get_raw_value( $post_id ) {
 
68
  return get_post_field( 'post_author', $post_id );
69
  }
70
 
75
  * @since 2.0
76
  */
77
  public function display_settings() {
 
78
  $this->display_field_user_format();
79
  $this->display_field_user_link_to();
80
  }
85
  * @since 2.4.7
86
  */
87
  public function display_field_user_link_to() {
 
88
  $this->display_field_select(
89
  'user_link_to',
90
  __( 'Link To', 'codepress-admin-columns' ),
91
  array(
92
+ '' => __( 'None' ),
93
+ 'edit_user' => __( 'Edit User Profile' ),
94
  'view_user_posts' => __( 'View User Posts' ),
95
+ 'view_author' => __( 'View Public Author Page', 'codepress-admin-columns' )
96
  ),
97
  __( 'Page the author name should link to.', 'codepress-admin-columns' )
98
  );
classes/column/post/comment-count.php CHANGED
@@ -12,15 +12,12 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
12
  * @since 2.2.1
13
  */
14
  public function init() {
15
-
16
  parent::init();
17
 
18
- // Properties
19
  $this->properties['type'] = 'column-comment_count';
20
  $this->properties['label'] = __( 'Comment count', 'codepress-admin-columns' );
21
  $this->properties['is_cloneable'] = true;
22
 
23
- // Options
24
  $this->options['comment_status'] = '';
25
  }
26
 
@@ -29,7 +26,6 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
29
  * @since 2.0
30
  */
31
  function get_comment_stati() {
32
-
33
  return array(
34
  'total_comments' => __( 'Total', 'codepress-admin-columns' ),
35
  'approved' => __( 'Approved', 'codepress-admin-columns' ),
@@ -44,7 +40,6 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
44
  * @since 2.0
45
  */
46
  function get_value( $post_id ) {
47
-
48
  $value = '';
49
 
50
  $status = $this->options->comment_status;
@@ -65,7 +60,6 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
65
  * @since 2.0.3
66
  */
67
  function get_raw_value( $post_id ) {
68
-
69
  $value = '';
70
 
71
  $status = $this->options->comment_status;
@@ -83,8 +77,7 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
83
  * @since 2.0
84
  */
85
  function apply_conditional() {
86
-
87
- return post_type_supports( $this->storage_model->key, 'comments' );
88
  }
89
 
90
  /**
@@ -93,8 +86,7 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
93
  * @see CPAC_Column::display_settings()
94
  * @since 2.0
95
  */
96
- function display_settings() {
97
- ?>
98
  <tr class="column_comment-count">
99
  <?php $this->label_view( __( 'Comment status', 'codepress-admin-columns' ), __( 'Select which comment status you like to display.', 'codepress-admin-columns' ), 'comment-status' ); ?>
100
  <td class="input">
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
 
17
  $this->properties['type'] = 'column-comment_count';
18
  $this->properties['label'] = __( 'Comment count', 'codepress-admin-columns' );
19
  $this->properties['is_cloneable'] = true;
20
 
 
21
  $this->options['comment_status'] = '';
22
  }
23
 
26
  * @since 2.0
27
  */
28
  function get_comment_stati() {
 
29
  return array(
30
  'total_comments' => __( 'Total', 'codepress-admin-columns' ),
31
  'approved' => __( 'Approved', 'codepress-admin-columns' ),
40
  * @since 2.0
41
  */
42
  function get_value( $post_id ) {
 
43
  $value = '';
44
 
45
  $status = $this->options->comment_status;
60
  * @since 2.0.3
61
  */
62
  function get_raw_value( $post_id ) {
 
63
  $value = '';
64
 
65
  $status = $this->options->comment_status;
77
  * @since 2.0
78
  */
79
  function apply_conditional() {
80
+ return post_type_supports( $this->get_post_type(), 'comments' );
 
81
  }
82
 
83
  /**
86
  * @see CPAC_Column::display_settings()
87
  * @since 2.0
88
  */
89
+ function display_settings() { ?>
 
90
  <tr class="column_comment-count">
91
  <?php $this->label_view( __( 'Comment status', 'codepress-admin-columns' ), __( 'Select which comment status you like to display.', 'codepress-admin-columns' ), 'comment-status' ); ?>
92
  <td class="input">
classes/column/post/comment-status.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * Column displaying whether an item is open for comments, i.e. whether users can
4
  * comment on this item.
@@ -12,13 +13,12 @@ class CPAC_Column_Post_Comment_Status extends CPAC_Column {
12
  * @since 2.2.1
13
  */
14
  public function init() {
15
-
16
  parent::init();
17
 
18
  // Properties
19
- $this->properties['type'] = 'column-comment_status';
20
- $this->properties['label'] = __( 'Comment status', 'codepress-admin-columns' );
21
- $this->properties['object_property'] = 'comment_status';
22
  }
23
 
24
  /**
@@ -26,8 +26,7 @@ class CPAC_Column_Post_Comment_Status extends CPAC_Column {
26
  * @since 2.2
27
  */
28
  function apply_conditional() {
29
-
30
- return post_type_supports( $this->storage_model->key, 'comments' );
31
  }
32
 
33
  /**
@@ -35,13 +34,10 @@ class CPAC_Column_Post_Comment_Status extends CPAC_Column {
35
  * @since 2.0
36
  */
37
  function get_value( $post_id ) {
38
-
39
  $comment_status = $this->get_raw_value( $post_id );
40
-
41
- $value = $this->get_asset_image( 'no.png', $comment_status );
42
-
43
  if ( 'open' == $comment_status ) {
44
- $value = $this->get_asset_image( 'checkmark.png', $comment_status );
45
  }
46
 
47
  return $value;
1
  <?php
2
+
3
  /**
4
  * Column displaying whether an item is open for comments, i.e. whether users can
5
  * comment on this item.
13
  * @since 2.2.1
14
  */
15
  public function init() {
 
16
  parent::init();
17
 
18
  // Properties
19
+ $this->properties['type'] = 'column-comment_status';
20
+ $this->properties['label'] = __( 'Comment status', 'codepress-admin-columns' );
21
+ $this->properties['object_property'] = 'comment_status';
22
  }
23
 
24
  /**
26
  * @since 2.2
27
  */
28
  function apply_conditional() {
29
+ return post_type_supports( $this->get_post_type(), 'comments' );
 
30
  }
31
 
32
  /**
34
  * @since 2.0
35
  */
36
  function get_value( $post_id ) {
 
37
  $comment_status = $this->get_raw_value( $post_id );
38
+ $value = '<span class="dashicons dashicons-no cpac_status_no" title="' . $comment_status . '"></span>';
 
 
39
  if ( 'open' == $comment_status ) {
40
+ $value = '<span class="dashicons dashicons-yes cpac_status_yes" title="' . $comment_status . '"></span>';
41
  }
42
 
43
  return $value;
classes/column/post/depth.php CHANGED
@@ -11,10 +11,8 @@ class CPAC_Column_Post_Depth extends CPAC_Column {
11
  * @since 2.3.4
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
  $this->properties['type'] = 'column-depth';
19
  $this->properties['label'] = __( 'Depth', 'codepress-admin-columns' );
20
  }
@@ -24,7 +22,6 @@ class CPAC_Column_Post_Depth extends CPAC_Column {
24
  * @since 2.3.4
25
  */
26
  public function get_value( $post_id ) {
27
-
28
  return $this->get_raw_value( $post_id );
29
  }
30
 
@@ -33,7 +30,6 @@ class CPAC_Column_Post_Depth extends CPAC_Column {
33
  * @since 2.3.4
34
  */
35
  public function get_raw_value( $post_id ) {
36
-
37
  return count( get_post_ancestors( $post_id ) ) + 1;
38
  }
39
 
@@ -42,7 +38,6 @@ class CPAC_Column_Post_Depth extends CPAC_Column {
42
  * @since 2.0
43
  */
44
  public function apply_conditional() {
45
-
46
- return is_post_type_hierarchical( $this->storage_model->get_post_type() );
47
  }
48
  }
11
  * @since 2.3.4
12
  */
13
  public function init() {
 
14
  parent::init();
15
 
 
16
  $this->properties['type'] = 'column-depth';
17
  $this->properties['label'] = __( 'Depth', 'codepress-admin-columns' );
18
  }
22
  * @since 2.3.4
23
  */
24
  public function get_value( $post_id ) {
 
25
  return $this->get_raw_value( $post_id );
26
  }
27
 
30
  * @since 2.3.4
31
  */
32
  public function get_raw_value( $post_id ) {
 
33
  return count( get_post_ancestors( $post_id ) ) + 1;
34
  }
35
 
38
  * @since 2.0
39
  */
40
  public function apply_conditional() {
41
+ return is_post_type_hierarchical( $this->get_post_type() );
 
42
  }
43
  }
classes/column/post/estimated-reading-time.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Post_Estimated_Reading_Time
4
  *
@@ -11,14 +12,11 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
11
  * @since 2.3.3
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-estimated_reading_time';
19
- $this->properties['label'] = __( 'Estimated Reading Time', 'codepress-admin-columns' );
20
 
21
- // Options
22
  $this->options['words_per_minute'] = 200;
23
  }
24
 
@@ -29,8 +27,9 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
29
  * @since 2.3.3
30
  */
31
  public function get_value( $post_id ) {
 
32
 
33
- return $this->convert_seconds_to_readable_time( $this->get_raw_value( $post_id ) );
34
  }
35
 
36
  /**
@@ -40,15 +39,14 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
40
  * @since 2.3.3
41
  */
42
  public function get_raw_value( $post_id ) {
43
-
44
- return $seconds = $this->get_estimated_reading_time_in_seconds( get_post_field( 'post_content', $post_id ) );
45
  }
46
 
47
  /**
48
  * @since 2.3.3
49
  */
50
  public function convert_seconds_to_readable_time( $seconds ) {
51
- $time = '&#8212;';
52
 
53
  if ( $seconds ) {
54
 
@@ -56,7 +54,7 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
56
  $seconds = floor( $seconds % 60 );
57
 
58
  $time = $minutes;
59
- if ( $seconds < 10 ) {
60
  $seconds = '0' . $seconds;
61
  }
62
  if ( '00' != $seconds ) {
@@ -77,11 +75,11 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
77
  * @since 2.3.3
78
  */
79
  public function get_estimated_reading_time_in_seconds( $content ) {
80
-
81
  $word_count = $this->str_count_words( $this->strip_trim( $content ) );
82
  if ( ! $word_count ) {
83
  return 0;
84
  }
 
85
  return (int) floor( ( $word_count / $this->options->words_per_minute ) * 60 );
86
  }
87
 
@@ -90,22 +88,16 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
90
  * @since 2.3.3
91
  */
92
  public function apply_conditional() {
93
-
94
- if ( post_type_supports( $this->storage_model->key, 'editor' ) ) {
95
- return true;
96
- }
97
-
98
- return false;
99
  }
100
 
101
  /**
102
  * @since 2.3.3
103
  */
104
  public function display_settings() {
105
-
106
- $field_key = 'words_per_minute';
107
- $label = __( 'Words per minute', 'codepress-admin-columns' );
108
- $description = __( 'Estimated reading time in words per minute', 'codepress-admin-columns' );
109
 
110
  ?>
111
  <tr class="column_<?php echo $field_key; ?>">
@@ -114,6 +106,6 @@ class CPAC_Column_Post_Estimated_Reading_Time extends CPAC_Column {
114
  <input type="text" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>" value="<?php echo $this->options->words_per_minute; ?>"/>
115
  </td>
116
  </tr>
117
- <?php
118
  }
119
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Post_Estimated_Reading_Time
5
  *
12
  * @since 2.3.3
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-estimated_reading_time';
18
+ $this->properties['label'] = __( 'Estimated Reading Time', 'codepress-admin-columns' );
 
19
 
 
20
  $this->options['words_per_minute'] = 200;
21
  }
22
 
27
  * @since 2.3.3
28
  */
29
  public function get_value( $post_id ) {
30
+ $seconds = $this->get_raw_value( $post_id );
31
 
32
+ return $seconds ? $this->convert_seconds_to_readable_time( $seconds ) : $this->get_empty_char();
33
  }
34
 
35
  /**
39
  * @since 2.3.3
40
  */
41
  public function get_raw_value( $post_id ) {
42
+ return $this->get_estimated_reading_time_in_seconds( get_post_field( 'post_content', $post_id ) );
 
43
  }
44
 
45
  /**
46
  * @since 2.3.3
47
  */
48
  public function convert_seconds_to_readable_time( $seconds ) {
49
+ $time = 0;
50
 
51
  if ( $seconds ) {
52
 
54
  $seconds = floor( $seconds % 60 );
55
 
56
  $time = $minutes;
57
+ if ( $minutes && $seconds < 10 ) {
58
  $seconds = '0' . $seconds;
59
  }
60
  if ( '00' != $seconds ) {
75
  * @since 2.3.3
76
  */
77
  public function get_estimated_reading_time_in_seconds( $content ) {
 
78
  $word_count = $this->str_count_words( $this->strip_trim( $content ) );
79
  if ( ! $word_count ) {
80
  return 0;
81
  }
82
+
83
  return (int) floor( ( $word_count / $this->options->words_per_minute ) * 60 );
84
  }
85
 
88
  * @since 2.3.3
89
  */
90
  public function apply_conditional() {
91
+ return post_type_supports( $this->get_post_type(), 'editor' );
 
 
 
 
 
92
  }
93
 
94
  /**
95
  * @since 2.3.3
96
  */
97
  public function display_settings() {
98
+ $field_key = 'words_per_minute';
99
+ $label = __( 'Words per minute', 'codepress-admin-columns' );
100
+ $description = __( 'Estimated reading time in words per minute', 'codepress-admin-columns' );
 
101
 
102
  ?>
103
  <tr class="column_<?php echo $field_key; ?>">
106
  <input type="text" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>" value="<?php echo $this->options->words_per_minute; ?>"/>
107
  </td>
108
  </tr>
109
+ <?php
110
  }
111
  }
classes/column/post/featured-image.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Post_Featured_Image
4
  *
@@ -11,17 +12,16 @@ class CPAC_Column_Post_Featured_Image extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
  // Properties
18
- $this->properties['type'] = 'column-featured_image';
19
- $this->properties['label'] = __( 'Featured Image', 'codepress-admin-columns' );
20
 
21
  // Options
22
- $this->options['image_size'] = '';
23
- $this->options['image_size_w'] = 80;
24
- $this->options['image_size_h'] = 80;
25
  }
26
 
27
  /**
@@ -29,8 +29,7 @@ class CPAC_Column_Post_Featured_Image extends CPAC_Column {
29
  * @since 2.2
30
  */
31
  public function apply_conditional() {
32
-
33
- return post_type_supports( $this->storage_model->key, 'thumbnail' );
34
  }
35
 
36
  /**
@@ -38,7 +37,6 @@ class CPAC_Column_Post_Featured_Image extends CPAC_Column {
38
  * @since 2.0
39
  */
40
  public function get_value( $post_id ) {
41
-
42
  $thumbnail_id = $this->get_raw_value( $post_id );
43
 
44
  if ( ! $thumbnail_id ) {
@@ -46,7 +44,7 @@ class CPAC_Column_Post_Featured_Image extends CPAC_Column {
46
  }
47
 
48
  $thumb = implode( $this->get_thumbnails( $thumbnail_id, (array) $this->options ) );
49
- $link = get_edit_post_link( $post_id );
50
 
51
  return $link ? "<a href='{$link}#postimagediv'>{$thumb}</a>" : $thumb;
52
  }
@@ -56,7 +54,6 @@ class CPAC_Column_Post_Featured_Image extends CPAC_Column {
56
  * @since 2.0.3
57
  */
58
  public function get_raw_value( $post_id ) {
59
-
60
  if ( ! has_post_thumbnail( $post_id ) ) {
61
  return false;
62
  }
@@ -69,7 +66,6 @@ class CPAC_Column_Post_Featured_Image extends CPAC_Column {
69
  * @since 2.0
70
  */
71
  public function display_settings() {
72
-
73
  $this->display_field_preview_size();
74
  }
75
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Post_Featured_Image
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
  // Properties
18
+ $this->properties['type'] = 'column-featured_image';
19
+ $this->properties['label'] = __( 'Featured Image', 'codepress-admin-columns' );
20
 
21
  // Options
22
+ $this->options['image_size'] = '';
23
+ $this->options['image_size_w'] = 80;
24
+ $this->options['image_size_h'] = 80;
25
  }
26
 
27
  /**
29
  * @since 2.2
30
  */
31
  public function apply_conditional() {
32
+ return post_type_supports( $this->get_post_type(), 'thumbnail' );
 
33
  }
34
 
35
  /**
37
  * @since 2.0
38
  */
39
  public function get_value( $post_id ) {
 
40
  $thumbnail_id = $this->get_raw_value( $post_id );
41
 
42
  if ( ! $thumbnail_id ) {
44
  }
45
 
46
  $thumb = implode( $this->get_thumbnails( $thumbnail_id, (array) $this->options ) );
47
+ $link = get_edit_post_link( $post_id );
48
 
49
  return $link ? "<a href='{$link}#postimagediv'>{$thumb}</a>" : $thumb;
50
  }
54
  * @since 2.0.3
55
  */
56
  public function get_raw_value( $post_id ) {
 
57
  if ( ! has_post_thumbnail( $post_id ) ) {
58
  return false;
59
  }
66
  * @since 2.0
67
  */
68
  public function display_settings() {
 
69
  $this->display_field_preview_size();
70
  }
71
  }
classes/column/post/formats.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Post_Page_Template
4
  *
@@ -11,12 +12,11 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
  // Properties
18
- $this->properties['type'] = 'column-post_formats';
19
- $this->properties['label'] = __( 'Post Format', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,12 +24,7 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function apply_conditional() {
27
-
28
- if ( post_type_supports( $this->storage_model->key, 'post-formats' ) ) {
29
- return true;
30
- }
31
-
32
- return false;
33
  }
34
 
35
  /**
@@ -37,7 +32,6 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
37
  * @since 2.0
38
  */
39
  function get_value( $post_id ) {
40
-
41
  if ( ! ( $format = $this->get_raw_value( $post_id ) ) ) {
42
  return false;
43
  }
@@ -50,7 +44,6 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
50
  * @since 2.0.3
51
  */
52
  function get_raw_value( $post_id ) {
53
-
54
  if ( ! ( $format = get_post_format( $post_id ) ) ) {
55
  return false;
56
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Post_Page_Template
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
  // Properties
18
+ $this->properties['type'] = 'column-post_formats';
19
+ $this->properties['label'] = __( 'Post Format', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
24
  * @since 2.0
25
  */
26
  function apply_conditional() {
27
+ return post_type_supports( $this->get_post_type(), 'post-formats' );
 
 
 
 
 
28
  }
29
 
30
  /**
32
  * @since 2.0
33
  */
34
  function get_value( $post_id ) {
 
35
  if ( ! ( $format = $this->get_raw_value( $post_id ) ) ) {
36
  return false;
37
  }
44
  * @since 2.0.3
45
  */
46
  function get_raw_value( $post_id ) {
 
47
  if ( ! ( $format = get_post_format( $post_id ) ) ) {
48
  return false;
49
  }
classes/column/post/order.php CHANGED
@@ -11,10 +11,8 @@ class CPAC_Column_Post_Order extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
  $this->properties['type'] = 'column-order';
19
  $this->properties['label'] = __( 'Order', 'codepress-admin-columns' );
20
  }
@@ -24,7 +22,7 @@ class CPAC_Column_Post_Order extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  public function apply_conditional() {
27
- return is_post_type_hierarchical( $this->storage_model->post_type ) || post_type_supports( $this->storage_model->post_type, 'page-attributes' );
28
  }
29
 
30
  /**
11
  * @since 2.2.1
12
  */
13
  public function init() {
 
14
  parent::init();
15
 
 
16
  $this->properties['type'] = 'column-order';
17
  $this->properties['label'] = __( 'Order', 'codepress-admin-columns' );
18
  }
22
  * @since 2.0
23
  */
24
  public function apply_conditional() {
25
+ return is_post_type_hierarchical( $this->get_post_type() ) || post_type_supports( $this->get_post_type(), 'page-attributes' );
26
  }
27
 
28
  /**
classes/column/post/page-template.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Post_Page_Template
4
  *
@@ -11,12 +12,10 @@ class CPAC_Column_Post_Page_Template extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-page_template';
19
- $this->properties['label'] = __( 'Page Template', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,7 +23,6 @@ class CPAC_Column_Post_Page_Template extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function get_value( $post_id ) {
27
-
28
  return array_search( $this->get_raw_value( $post_id ), get_page_templates() );
29
  }
30
 
@@ -33,7 +31,6 @@ class CPAC_Column_Post_Page_Template extends CPAC_Column {
33
  * @since 2.0.3
34
  */
35
  function get_raw_value( $post_id ) {
36
-
37
  return get_post_meta( $post_id, '_wp_page_template', true );
38
  }
39
 
@@ -42,10 +39,6 @@ class CPAC_Column_Post_Page_Template extends CPAC_Column {
42
  * @since 2.0
43
  */
44
  function apply_conditional() {
45
-
46
- if ( 'page' == $this->storage_model->key )
47
- return true;
48
-
49
- return false;
50
  }
51
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Post_Page_Template
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-page_template';
18
+ $this->properties['label'] = __( 'Page Template', 'codepress-admin-columns' );
 
19
  }
20
 
21
  /**
23
  * @since 2.0
24
  */
25
  function get_value( $post_id ) {
 
26
  return array_search( $this->get_raw_value( $post_id ), get_page_templates() );
27
  }
28
 
31
  * @since 2.0.3
32
  */
33
  function get_raw_value( $post_id ) {
 
34
  return get_post_meta( $post_id, '_wp_page_template', true );
35
  }
36
 
39
  * @since 2.0
40
  */
41
  function apply_conditional() {
42
+ return 'page' == $this->get_post_type();
 
 
 
 
43
  }
44
  }
classes/column/post/parent.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Post_Parent
4
  *
@@ -11,13 +12,11 @@ class CPAC_Column_Post_Parent extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-parent';
19
- $this->properties['label'] = __( 'Parent', 'codepress-admin-columns' );
20
- $this->properties['object_property'] = 'post_parent';
21
  }
22
 
23
  /**
@@ -26,12 +25,12 @@ class CPAC_Column_Post_Parent extends CPAC_Column {
26
  */
27
  public function get_value( $post_id ) {
28
 
29
- if ( !( $parent_id = $this->get_raw_value( $post_id ) ) ) {
30
  return false;
31
  }
32
 
33
  $title = $this->get_post_title( $parent_id );
34
- $link = get_edit_post_link( $parent_id );
35
 
36
  return $link ? "<a href='{$link}'>{$title}</a>" : $title;
37
  }
@@ -51,7 +50,6 @@ class CPAC_Column_Post_Parent extends CPAC_Column {
51
  * @since 2.0
52
  */
53
  public function apply_conditional() {
54
-
55
- return is_post_type_hierarchical( $this->storage_model->get_post_type() );
56
  }
57
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Post_Parent
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-parent';
18
+ $this->properties['label'] = __( 'Parent', 'codepress-admin-columns' );
19
+ $this->properties['object_property'] = 'post_parent';
 
20
  }
21
 
22
  /**
25
  */
26
  public function get_value( $post_id ) {
27
 
28
+ if ( ! ( $parent_id = $this->get_raw_value( $post_id ) ) ) {
29
  return false;
30
  }
31
 
32
  $title = $this->get_post_title( $parent_id );
33
+ $link = get_edit_post_link( $parent_id );
34
 
35
  return $link ? "<a href='{$link}'>{$title}</a>" : $title;
36
  }
50
  * @since 2.0
51
  */
52
  public function apply_conditional() {
53
+ return is_post_type_hierarchical( $this->get_post_type() );
 
54
  }
55
  }
classes/column/post/ping-status.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Post_Ping_Status
4
  *
@@ -11,13 +12,11 @@ class CPAC_Column_Post_Ping_Status extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-ping_status';
19
- $this->properties['label'] = __( 'Ping Status', 'codepress-admin-columns' );
20
- $this->properties['object_property'] = 'ping_status';
21
  }
22
 
23
  /**
@@ -25,8 +24,7 @@ class CPAC_Column_Post_Ping_Status extends CPAC_Column {
25
  * @since 2.2
26
  */
27
  public function apply_conditional() {
28
-
29
- return post_type_supports( $this->storage_model->key, 'comments' );
30
  }
31
 
32
  /**
@@ -34,12 +32,10 @@ class CPAC_Column_Post_Ping_Status extends CPAC_Column {
34
  * @since 2.0
35
  */
36
  public function get_value( $post_id ) {
37
-
38
  $ping_status = $this->get_raw_value( $post_id );
39
-
40
- $value = $this->get_asset_image( 'no.png', $ping_status );
41
  if ( 'open' == $ping_status ) {
42
- $value = $this->get_asset_image( 'checkmark.png', $ping_status );
43
  }
44
 
45
  return $value;
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Post_Ping_Status
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-ping_status';
18
+ $this->properties['label'] = __( 'Ping Status', 'codepress-admin-columns' );
19
+ $this->properties['object_property'] = 'ping_status';
 
20
  }
21
 
22
  /**
24
  * @since 2.2
25
  */
26
  public function apply_conditional() {
27
+ return post_type_supports( $this->get_post_type(), 'comments' );
 
28
  }
29
 
30
  /**
32
  * @since 2.0
33
  */
34
  public function get_value( $post_id ) {
 
35
  $ping_status = $this->get_raw_value( $post_id );
36
+ $value = '<span class="dashicons dashicons-no cpac_status_no" title="' . $ping_status . '"></span>';
 
37
  if ( 'open' == $ping_status ) {
38
+ $value = '<span class="dashicons dashicons-yes cpac_status_yes" title="' . $ping_status . '"></span>';
39
  }
40
 
41
  return $value;
classes/column/post/shortcodes.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * Display used shortcodes
4
  *
@@ -27,7 +28,15 @@ class CPAC_Column_Post_Shortcodes extends CPAC_Column {
27
  if ( ! ( $shortcodes = $this->get_raw_value( $post_id ) ) ) {
28
  return false;
29
  }
30
- return '[' . implode( '] [', $shortcodes ) . ']';
 
 
 
 
 
 
 
 
31
  }
32
 
33
  /**
@@ -35,16 +44,25 @@ class CPAC_Column_Post_Shortcodes extends CPAC_Column {
35
  * @since 2.3.5
36
  */
37
  public function get_raw_value( $post_id ) {
 
 
 
 
 
38
 
39
  $content = get_post_field( 'post_content', $post_id );
40
- $pattern = get_shortcode_regex();
41
 
42
- preg_match_all( "/$pattern/s", $content, $matches );
43
 
44
- if ( ! isset( $matches[2] ) ) {
45
- return false;
 
 
 
 
 
46
  }
47
 
48
- return $matches[2];
49
  }
50
  }
1
  <?php
2
+
3
  /**
4
  * Display used shortcodes
5
  *
28
  if ( ! ( $shortcodes = $this->get_raw_value( $post_id ) ) ) {
29
  return false;
30
  }
31
+
32
+ $display = array();
33
+ foreach ( $shortcodes as $sc => $count ) {
34
+ $string = '[' . $sc . ']';
35
+ $string = $count > 1 ? $string . '<span class="cpac-rounded">' . $count . '</span>' : $string;
36
+ $display[ $sc ] = '<span class="cpac-spacing">' . $string . '</span>';
37
+ }
38
+
39
+ return implode( ' ', $display );
40
  }
41
 
42
  /**
44
  * @since 2.3.5
45
  */
46
  public function get_raw_value( $post_id ) {
47
+ global $shortcode_tags;
48
+
49
+ if ( ! $shortcode_tags ) {
50
+ return false;
51
+ }
52
 
53
  $content = get_post_field( 'post_content', $post_id );
 
54
 
55
+ $shortcodes = array();
56
 
57
+ $_shortcodes = array_keys( $shortcode_tags );
58
+ asort( $_shortcodes );
59
+
60
+ foreach ( $_shortcodes as $sc ) {
61
+ if ( $count = substr_count( $content, '[' . $sc ) ) {
62
+ $shortcodes[ $sc ] = $count;
63
+ }
64
  }
65
 
66
+ return $shortcodes;
67
  }
68
  }
classes/column/post/sticky.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_Post_Sticky
4
  *
@@ -11,12 +12,10 @@ class CPAC_Column_Post_Sticky extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-sticky';
19
- $this->properties['label'] = __( 'Sticky', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,11 +23,7 @@ class CPAC_Column_Post_Sticky extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function apply_conditional() {
27
-
28
- if ( 'post' == $this->storage_model->key )
29
- return true;
30
-
31
- return false;
32
  }
33
 
34
  /**
@@ -36,14 +31,7 @@ class CPAC_Column_Post_Sticky extends CPAC_Column {
36
  * @since 2.0
37
  */
38
  function get_value( $post_id ) {
39
-
40
- $value = $this->get_asset_image( 'no.png' );
41
-
42
- if ( $this->get_raw_value( $post_id ) ) {
43
- $value = $this->get_asset_image( 'checkmark.png' );
44
- }
45
-
46
- return $value;
47
  }
48
 
49
  /**
@@ -51,7 +39,6 @@ class CPAC_Column_Post_Sticky extends CPAC_Column {
51
  * @since 2.0.3
52
  */
53
  function get_raw_value( $post_id ) {
54
-
55
  return is_sticky( $post_id );
56
  }
57
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_Post_Sticky
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-sticky';
18
+ $this->properties['label'] = __( 'Sticky', 'codepress-admin-columns' );
 
19
  }
20
 
21
  /**
23
  * @since 2.0
24
  */
25
  function apply_conditional() {
26
+ return 'post' == $this->get_post_type();
 
 
 
 
27
  }
28
 
29
  /**
31
  * @since 2.0
32
  */
33
  function get_value( $post_id ) {
34
+ return $this->get_raw_value( $post_id ) ? '<span class="dashicons dashicons-yes cpac_status_yes"></span>' : '<span class="dashicons dashicons-no cpac_status_no"></span>';
 
 
 
 
 
 
 
35
  }
36
 
37
  /**
39
  * @since 2.0.3
40
  */
41
  function get_raw_value( $post_id ) {
 
42
  return is_sticky( $post_id );
43
  }
44
  }
classes/column/post/word-count.php CHANGED
@@ -11,10 +11,8 @@ class CPAC_Column_Post_Word_Count extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
  $this->properties['type'] = 'column-word_count';
19
  $this->properties['label'] = __( 'Word count', 'codepress-admin-columns' );
20
  }
@@ -24,8 +22,9 @@ class CPAC_Column_Post_Word_Count extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function get_value( $post_id ) {
 
27
 
28
- return $this->get_raw_value( $post_id );
29
  }
30
 
31
  /**
@@ -33,7 +32,6 @@ class CPAC_Column_Post_Word_Count extends CPAC_Column {
33
  * @since 2.0.3
34
  */
35
  function get_raw_value( $post_id ) {
36
-
37
  return $this->str_count_words( $this->strip_trim( get_post_field( 'post_content', $post_id ) ) );
38
  }
39
 
@@ -42,11 +40,6 @@ class CPAC_Column_Post_Word_Count extends CPAC_Column {
42
  * @since 2.0
43
  */
44
  function apply_conditional() {
45
-
46
- if ( post_type_supports( $this->storage_model->key, 'editor' ) ) {
47
- return true;
48
- }
49
-
50
- return false;
51
  }
52
  }
11
  * @since 2.2.1
12
  */
13
  public function init() {
 
14
  parent::init();
15
 
 
16
  $this->properties['type'] = 'column-word_count';
17
  $this->properties['label'] = __( 'Word count', 'codepress-admin-columns' );
18
  }
22
  * @since 2.0
23
  */
24
  function get_value( $post_id ) {
25
+ $count = $this->get_raw_value( $post_id );
26
 
27
+ return $count ? $count : $this->get_empty_char();
28
  }
29
 
30
  /**
32
  * @since 2.0.3
33
  */
34
  function get_raw_value( $post_id ) {
 
35
  return $this->str_count_words( $this->strip_trim( get_post_field( 'post_content', $post_id ) ) );
36
  }
37
 
40
  * @since 2.0
41
  */
42
  function apply_conditional() {
43
+ return post_type_supports( $this->get_post_type(), 'editor' );
 
 
 
 
 
44
  }
45
  }
classes/column/used-by-menu.php CHANGED
@@ -64,11 +64,12 @@ class CPAC_Column_Used_By_Menu extends CPAC_Column {
64
  */
65
  function get_meta_type() {
66
  $object_type = false;
67
- if ( isset( $this->storage_model->taxonomy ) ) {
68
- $object_type = $this->storage_model->taxonomy;
 
69
  }
70
- elseif ( isset( $this->storage_model->post_type ) ) {
71
- $object_type = $this->storage_model->post_type;
72
  }
73
  return $object_type;
74
  }
@@ -78,10 +79,8 @@ class CPAC_Column_Used_By_Menu extends CPAC_Column {
78
  * @since 2.2.5
79
  */
80
  function get_raw_value( $object_id ) {
81
-
82
  $object_type = $this->get_meta_type();
83
 
84
-
85
  $menu_item_ids = get_posts( array(
86
  'post_type' => 'nav_menu_item',
87
  'numberposts' => -1,
@@ -116,7 +115,6 @@ class CPAC_Column_Used_By_Menu extends CPAC_Column {
116
  * @since 2.2.5
117
  */
118
  public function display_settings() {
119
-
120
  $this->display_field_link_to_menu();
121
  }
122
 
@@ -126,7 +124,6 @@ class CPAC_Column_Used_By_Menu extends CPAC_Column {
126
  * @since 2.2.5
127
  */
128
  public function display_field_link_to_menu() {
129
-
130
  $field_key = 'link_to_menu';
131
  ?>
132
  <tr class="column_<?php echo $field_key; ?>">
@@ -144,5 +141,4 @@ class CPAC_Column_Used_By_Menu extends CPAC_Column {
144
  </tr>
145
  <?php
146
  }
147
-
148
  }
64
  */
65
  function get_meta_type() {
66
  $object_type = false;
67
+ $model = $this->get_storage_model();
68
+ if ( isset( $model->taxonomy ) ) {
69
+ $object_type = $model->taxonomy;
70
  }
71
+ elseif ( $post_type = $this->get_post_type() ) {
72
+ $object_type = $post_type;
73
  }
74
  return $object_type;
75
  }
79
  * @since 2.2.5
80
  */
81
  function get_raw_value( $object_id ) {
 
82
  $object_type = $this->get_meta_type();
83
 
 
84
  $menu_item_ids = get_posts( array(
85
  'post_type' => 'nav_menu_item',
86
  'numberposts' => -1,
115
  * @since 2.2.5
116
  */
117
  public function display_settings() {
 
118
  $this->display_field_link_to_menu();
119
  }
120
 
124
  * @since 2.2.5
125
  */
126
  public function display_field_link_to_menu() {
 
127
  $field_key = 'link_to_menu';
128
  ?>
129
  <tr class="column_<?php echo $field_key; ?>">
141
  </tr>
142
  <?php
143
  }
 
144
  }
classes/column/user/ID.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_ID
4
  *
@@ -11,12 +12,10 @@ class CPAC_Column_User_ID extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-user_id';
19
- $this->properties['label'] = __( 'User ID', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,7 +23,6 @@ class CPAC_Column_User_ID extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function get_value( $user_id ) {
27
-
28
  return $this->get_raw_value( $user_id );
29
  }
30
 
@@ -33,7 +31,6 @@ class CPAC_Column_User_ID extends CPAC_Column {
33
  * @since 2.0.3
34
  */
35
  function get_raw_value( $user_id ) {
36
-
37
  return $user_id;
38
  }
39
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_ID
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-user_id';
18
+ $this->properties['label'] = __( 'User ID', 'codepress-admin-columns' );
 
19
  }
20
 
21
  /**
23
  * @since 2.0
24
  */
25
  function get_value( $user_id ) {
 
26
  return $this->get_raw_value( $user_id );
27
  }
28
 
31
  * @since 2.0.3
32
  */
33
  function get_raw_value( $user_id ) {
 
34
  return $user_id;
35
  }
36
  }
classes/column/user/actions.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_Actions
4
  *
@@ -14,30 +15,36 @@ class CPAC_Column_User_Actions extends CPAC_Column_Actions {
14
  $actions = array();
15
 
16
  $user_object = new WP_User( $id );
17
- $screen = get_current_screen();
18
 
19
- if ( 'site-users-network' == $screen->id )
20
  $url = "site-users.php?id={$this->site_id}&amp;";
21
- else
 
22
  $url = 'users.php?';
 
23
 
24
  if ( get_current_user_id() == $user_object->ID ) {
25
  $edit_link = 'profile.php';
26
- } else {
 
27
  $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ) );
28
  }
29
 
30
- if ( current_user_can( 'edit_user', $user_object->ID ) ) {
31
  $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
32
  $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
33
- } else {
 
34
  $edit = "<strong>$user_object->user_login</strong><br />";
35
  }
36
 
37
- if ( !is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) )
38
  $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . "</a>";
39
- if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) )
40
- $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>";
 
 
41
 
42
  return $actions;
43
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_Actions
5
  *
15
  $actions = array();
16
 
17
  $user_object = new WP_User( $id );
18
+ $screen = get_current_screen();
19
 
20
+ if ( 'site-users-network' == $screen->id ) {
21
  $url = "site-users.php?id={$this->site_id}&amp;";
22
+ }
23
+ else {
24
  $url = 'users.php?';
25
+ }
26
 
27
  if ( get_current_user_id() == $user_object->ID ) {
28
  $edit_link = 'profile.php';
29
+ }
30
+ else {
31
  $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ) );
32
  }
33
 
34
+ if ( current_user_can( 'edit_user', $user_object->ID ) ) {
35
  $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
36
  $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
37
+ }
38
+ else {
39
  $edit = "<strong>$user_object->user_login</strong><br />";
40
  }
41
 
42
+ if ( ! is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) ) {
43
  $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . "</a>";
44
+ }
45
+ if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) ) {
46
+ $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url . "action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>";
47
+ }
48
 
49
  return $actions;
50
  }
classes/column/user/comment-count.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_Comment_Count
4
  *
@@ -11,10 +12,8 @@ class CPAC_Column_User_Comment_Count extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
  $this->properties['type'] = 'column-user_commentcount';
19
  $this->properties['label'] = __( 'Comment Count' );
20
  }
@@ -24,7 +23,6 @@ class CPAC_Column_User_Comment_Count extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function get_value( $user_id ) {
27
-
28
  return $this->get_raw_value( $user_id );
29
  }
30
 
@@ -33,11 +31,10 @@ class CPAC_Column_User_Comment_Count extends CPAC_Column {
33
  * @since 2.0.3
34
  */
35
  function get_raw_value( $user_id ) {
36
-
37
  return get_comments( array(
38
- 'user_id' => $user_id,
39
- 'count' => true,
40
  'orderby' => false
41
- ));
42
  }
43
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_Comment_Count
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
 
17
  $this->properties['type'] = 'column-user_commentcount';
18
  $this->properties['label'] = __( 'Comment Count' );
19
  }
23
  * @since 2.0
24
  */
25
  function get_value( $user_id ) {
 
26
  return $this->get_raw_value( $user_id );
27
  }
28
 
31
  * @since 2.0.3
32
  */
33
  function get_raw_value( $user_id ) {
 
34
  return get_comments( array(
35
+ 'user_id' => $user_id,
36
+ 'count' => true,
37
  'orderby' => false
38
+ ) );
39
  }
40
  }
classes/column/user/description.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_Description
4
  *
@@ -11,14 +12,11 @@ class CPAC_Column_User_Description extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-user_description';
19
- $this->properties['label'] = __( 'Description', 'codepress-admin-columns' );
20
 
21
- // Options
22
  $this->options['excerpt_length'] = 30;
23
  }
24
 
@@ -27,7 +25,6 @@ class CPAC_Column_User_Description extends CPAC_Column {
27
  * @since 2.0
28
  */
29
  function get_value( $user_id ) {
30
-
31
  return $this->get_raw_value( $user_id );
32
  }
33
 
@@ -36,7 +33,6 @@ class CPAC_Column_User_Description extends CPAC_Column {
36
  * @since 2.0.3
37
  */
38
  function get_raw_value( $user_id ) {
39
-
40
  return $this->get_shortened_string( get_the_author_meta( 'user_description', $user_id ), $this->options->excerpt_length );
41
  }
42
 
@@ -45,7 +41,6 @@ class CPAC_Column_User_Description extends CPAC_Column {
45
  * @since 2.0
46
  */
47
  function display_settings() {
48
-
49
  $this->display_field_excerpt_length();
50
  }
51
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_Description
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-user_description';
18
+ $this->properties['label'] = __( 'Description', 'codepress-admin-columns' );
 
19
 
 
20
  $this->options['excerpt_length'] = 30;
21
  }
22
 
25
  * @since 2.0
26
  */
27
  function get_value( $user_id ) {
 
28
  return $this->get_raw_value( $user_id );
29
  }
30
 
33
  * @since 2.0.3
34
  */
35
  function get_raw_value( $user_id ) {
 
36
  return $this->get_shortened_string( get_the_author_meta( 'user_description', $user_id ), $this->options->excerpt_length );
37
  }
38
 
41
  * @since 2.0
42
  */
43
  function display_settings() {
 
44
  $this->display_field_excerpt_length();
45
  }
46
  }
classes/column/user/display-name.php CHANGED
@@ -11,10 +11,8 @@ class CPAC_Column_User_Display_Name extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
  $this->properties['type'] = 'column-display_name';
19
  $this->properties['label'] = __( 'Display name', 'codepress-admin-columns' );
20
  }
@@ -24,7 +22,6 @@ class CPAC_Column_User_Display_Name extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function get_value( $user_id ) {
27
-
28
  return $this->get_raw_value( $user_id );
29
  }
30
 
@@ -33,7 +30,6 @@ class CPAC_Column_User_Display_Name extends CPAC_Column {
33
  * @since 2.0.3
34
  */
35
  function get_raw_value( $user_id ) {
36
-
37
  $userdata = get_userdata( $user_id );
38
 
39
  return $userdata->display_name;
11
  * @since 2.2.1
12
  */
13
  public function init() {
 
14
  parent::init();
15
 
 
16
  $this->properties['type'] = 'column-display_name';
17
  $this->properties['label'] = __( 'Display name', 'codepress-admin-columns' );
18
  }
22
  * @since 2.0
23
  */
24
  function get_value( $user_id ) {
 
25
  return $this->get_raw_value( $user_id );
26
  }
27
 
30
  * @since 2.0.3
31
  */
32
  function get_raw_value( $user_id ) {
 
33
  $userdata = get_userdata( $user_id );
34
 
35
  return $userdata->display_name;
classes/column/user/first-name.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_First_Name
4
  *
@@ -11,12 +12,10 @@ class CPAC_Column_User_First_Name extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-first_name';
19
- $this->properties['label'] = __( 'First name', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,7 +23,6 @@ class CPAC_Column_User_First_Name extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  public function get_value( $user_id ) {
27
-
28
  return $this->get_raw_value( $user_id );
29
  }
30
 
@@ -33,7 +31,6 @@ class CPAC_Column_User_First_Name extends CPAC_Column {
33
  * @since 2.0.3
34
  */
35
  public function get_raw_value( $user_id ) {
36
-
37
  $userdata = get_userdata( $user_id );
38
 
39
  return $userdata->first_name;
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_First_Name
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-first_name';
18
+ $this->properties['label'] = __( 'First name', 'codepress-admin-columns' );
 
19
  }
20
 
21
  /**
23
  * @since 2.0
24
  */
25
  public function get_value( $user_id ) {
 
26
  return $this->get_raw_value( $user_id );
27
  }
28
 
31
  * @since 2.0.3
32
  */
33
  public function get_raw_value( $user_id ) {
 
34
  $userdata = get_userdata( $user_id );
35
 
36
  return $userdata->first_name;
classes/column/user/last-name.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_Last_Name
4
  *
@@ -11,12 +12,10 @@ class CPAC_Column_User_Last_Name extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-last_name';
19
- $this->properties['label'] = __( 'Last name', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,7 +23,6 @@ class CPAC_Column_User_Last_Name extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function get_value( $user_id ) {
27
-
28
  return $this->get_raw_value( $user_id );
29
  }
30
 
@@ -33,7 +31,6 @@ class CPAC_Column_User_Last_Name extends CPAC_Column {
33
  * @since 2.0.3
34
  */
35
  function get_raw_value( $user_id ) {
36
-
37
  $userdata = get_userdata( $user_id );
38
 
39
  return $userdata->last_name;
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_Last_Name
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-last_name';
18
+ $this->properties['label'] = __( 'Last name', 'codepress-admin-columns' );
 
19
  }
20
 
21
  /**
23
  * @since 2.0
24
  */
25
  function get_value( $user_id ) {
 
26
  return $this->get_raw_value( $user_id );
27
  }
28
 
31
  * @since 2.0.3
32
  */
33
  function get_raw_value( $user_id ) {
 
34
  $userdata = get_userdata( $user_id );
35
 
36
  return $userdata->last_name;
classes/column/user/nickname.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_Nickname
4
  *
@@ -11,12 +12,11 @@ class CPAC_Column_User_Nickname extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-nickname';
19
- $this->properties['label'] = __( 'Nickname', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,7 +24,6 @@ class CPAC_Column_User_Nickname extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function get_value( $user_id ) {
27
-
28
  return $this->get_raw_value( $user_id );
29
  }
30
 
@@ -33,7 +32,6 @@ class CPAC_Column_User_Nickname extends CPAC_Column {
33
  * @since 2.0.3
34
  */
35
  function get_raw_value( $user_id ) {
36
-
37
  $userdata = get_userdata( $user_id );
38
 
39
  return $userdata->nickname;
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_Nickname
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+
18
+ $this->properties['type'] = 'column-nickname';
19
+ $this->properties['label'] = __( 'Nickname', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
24
  * @since 2.0
25
  */
26
  function get_value( $user_id ) {
 
27
  return $this->get_raw_value( $user_id );
28
  }
29
 
32
  * @since 2.0.3
33
  */
34
  function get_raw_value( $user_id ) {
 
35
  $userdata = get_userdata( $user_id );
36
 
37
  return $userdata->nickname;
classes/column/user/post-count.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_Post_Count
4
  *
@@ -11,13 +12,12 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
  // Properties
18
- $this->properties['type'] = 'column-user_postcount';
19
- $this->properties['label'] = __( 'Post Count', 'codepress-admin-columns' );
20
- $this->properties['is_cloneable'] = true;
21
 
22
  // Options
23
  $this->options['post_type'] = '';
@@ -29,7 +29,6 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
29
  * @since 2.0
30
  */
31
  public function get_count( $user_id ) {
32
-
33
  return $this->get_user_postcount( $user_id, $this->options->post_type );
34
  }
35
 
@@ -38,12 +37,12 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
38
  * @since 2.0
39
  */
40
  function get_value( $user_id ) {
41
-
42
  $value = '0';
43
 
44
  $count = $this->get_raw_value( $user_id );
45
- if ( $count > 0 )
46
  $value = "<a href='edit.php?post_type={$this->options->post_type}&author={$user_id}'>{$count}</a>";
 
47
 
48
  return $value;
49
  }
@@ -53,7 +52,6 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
53
  * @since 2.0.3
54
  */
55
  function get_raw_value( $user_id ) {
56
-
57
  return $this->get_count( $user_id );
58
  }
59
 
@@ -64,18 +62,19 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
64
  * @since 2.0
65
  */
66
  function display_settings() {
67
-
68
  $ptypes = array();
69
 
70
- if ( post_type_exists( 'post' ) )
71
  $ptypes['post'] = 'post';
 
72
 
73
- if ( post_type_exists( 'page' ) )
74
  $ptypes['page'] = 'page';
 
75
 
76
  $ptypes = array_merge( $ptypes, get_post_types( array(
77
- '_builtin' => false
78
- )));
79
 
80
  // get posttypes and name
81
  $post_types = array();
@@ -89,9 +88,9 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
89
  <?php $this->label_view( __( 'Post Type', 'codepress-admin-columns' ), '', 'post_type' ); ?>
90
  <td class="input">
91
  <select name="<?php $this->attr_name( 'post_type' ); ?>" id="<?php $this->attr_id( 'post_type' ); ?>">
92
- <?php foreach ( $post_types as $key => $label ) : ?>
93
- <option value="<?php echo $key; ?>"<?php selected( $key, $this->options->post_type ) ?>><?php echo $label; ?></option>
94
- <?php endforeach; ?>
95
  </select>
96
  </td>
97
  </tr>
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_Post_Count
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
  // Properties
18
+ $this->properties['type'] = 'column-user_postcount';
19
+ $this->properties['label'] = __( 'Post Count', 'codepress-admin-columns' );
20
+ $this->properties['is_cloneable'] = true;
21
 
22
  // Options
23
  $this->options['post_type'] = '';
29
  * @since 2.0
30
  */
31
  public function get_count( $user_id ) {
 
32
  return $this->get_user_postcount( $user_id, $this->options->post_type );
33
  }
34
 
37
  * @since 2.0
38
  */
39
  function get_value( $user_id ) {
 
40
  $value = '0';
41
 
42
  $count = $this->get_raw_value( $user_id );
43
+ if ( $count > 0 ) {
44
  $value = "<a href='edit.php?post_type={$this->options->post_type}&author={$user_id}'>{$count}</a>";
45
+ }
46
 
47
  return $value;
48
  }
52
  * @since 2.0.3
53
  */
54
  function get_raw_value( $user_id ) {
 
55
  return $this->get_count( $user_id );
56
  }
57
 
62
  * @since 2.0
63
  */
64
  function display_settings() {
 
65
  $ptypes = array();
66
 
67
+ if ( post_type_exists( 'post' ) ) {
68
  $ptypes['post'] = 'post';
69
+ }
70
 
71
+ if ( post_type_exists( 'page' ) ) {
72
  $ptypes['page'] = 'page';
73
+ }
74
 
75
  $ptypes = array_merge( $ptypes, get_post_types( array(
76
+ '_builtin' => false
77
+ ) ) );
78
 
79
  // get posttypes and name
80
  $post_types = array();
88
  <?php $this->label_view( __( 'Post Type', 'codepress-admin-columns' ), '', 'post_type' ); ?>
89
  <td class="input">
90
  <select name="<?php $this->attr_name( 'post_type' ); ?>" id="<?php $this->attr_id( 'post_type' ); ?>">
91
+ <?php foreach ( $post_types as $key => $label ) : ?>
92
+ <option value="<?php echo $key; ?>"<?php selected( $key, $this->options->post_type ) ?>><?php echo $label; ?></option>
93
+ <?php endforeach; ?>
94
  </select>
95
  </td>
96
  </tr>
classes/column/user/registered.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_Registered
4
  *
@@ -11,12 +12,11 @@ class CPAC_Column_User_Registered extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
  // Properties
18
- $this->properties['type'] = 'column-user_registered';
19
- $this->properties['label'] = __( 'Registered', 'codepress-admin-columns' );
20
 
21
  // Options
22
  $this->options['date_format'] = '';
@@ -27,7 +27,6 @@ class CPAC_Column_User_Registered extends CPAC_Column {
27
  * @since 2.0
28
  */
29
  function get_value( $user_id ) {
30
-
31
  $user_registered = $this->get_raw_value( $user_id );
32
 
33
  // GMT offset is used
@@ -39,7 +38,6 @@ class CPAC_Column_User_Registered extends CPAC_Column {
39
  * @since 2.0.3
40
  */
41
  function get_raw_value( $user_id ) {
42
-
43
  $userdata = get_userdata( $user_id );
44
 
45
  return $userdata->user_registered;
@@ -50,7 +48,6 @@ class CPAC_Column_User_Registered extends CPAC_Column {
50
  * @since 2.0
51
  */
52
  function display_settings() {
53
-
54
  $this->display_field_date_format();
55
  }
56
  }
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_Registered
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
  // Properties
18
+ $this->properties['type'] = 'column-user_registered';
19
+ $this->properties['label'] = __( 'Registered', 'codepress-admin-columns' );
20
 
21
  // Options
22
  $this->options['date_format'] = '';
27
  * @since 2.0
28
  */
29
  function get_value( $user_id ) {
 
30
  $user_registered = $this->get_raw_value( $user_id );
31
 
32
  // GMT offset is used
38
  * @since 2.0.3
39
  */
40
  function get_raw_value( $user_id ) {
 
41
  $userdata = get_userdata( $user_id );
42
 
43
  return $userdata->user_registered;
48
  * @since 2.0
49
  */
50
  function display_settings() {
 
51
  $this->display_field_date_format();
52
  }
53
  }
classes/column/user/rich-editing.php CHANGED
@@ -1,9 +1,5 @@
1
  <?php
2
- /**
3
- * CPAC_Column_User_Rich_Editing
4
- *
5
- * @since 2.0
6
- */
7
  class CPAC_Column_User_Rich_Editing extends CPAC_Column {
8
 
9
  /**
@@ -11,12 +7,10 @@ class CPAC_Column_User_Rich_Editing extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-rich_editing';
19
- $this->properties['label'] = __( 'Visual Editor', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,13 +18,7 @@ class CPAC_Column_User_Rich_Editing extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function get_value( $user_id ) {
27
-
28
- $value = $this->get_asset_image( 'checkmark.png' );
29
- if ( 'false' === $this->get_raw_value( $user_id ) ) {
30
- $value = $this->get_asset_image( 'no.png' );
31
- }
32
-
33
- return $value;
34
  }
35
 
36
  /**
@@ -38,7 +26,6 @@ class CPAC_Column_User_Rich_Editing extends CPAC_Column {
38
  * @since 2.0.3
39
  */
40
  function get_raw_value( $user_id ) {
41
-
42
  $userdata = get_userdata( $user_id );
43
 
44
  return $userdata->rich_editing;
1
  <?php
2
+
 
 
 
 
3
  class CPAC_Column_User_Rich_Editing extends CPAC_Column {
4
 
5
  /**
7
  * @since 2.2.1
8
  */
9
  public function init() {
 
10
  parent::init();
11
 
12
+ $this->properties['type'] = 'column-rich_editing';
13
+ $this->properties['label'] = __( 'Visual Editor', 'codepress-admin-columns' );
 
14
  }
15
 
16
  /**
18
  * @since 2.0
19
  */
20
  function get_value( $user_id ) {
21
+ return $this->get_raw_value( $user_id ) ? '<span class="dashicons dashicons-yes cpac_status_yes"></span>' : '<span class="dashicons dashicons-no cpac_status_no"></span>';
 
 
 
 
 
 
22
  }
23
 
24
  /**
26
  * @since 2.0.3
27
  */
28
  function get_raw_value( $user_id ) {
 
29
  $userdata = get_userdata( $user_id );
30
 
31
  return $userdata->rich_editing;
classes/column/user/url.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * CPAC_Column_User_Url
4
  *
@@ -11,12 +12,10 @@ class CPAC_Column_User_Url extends CPAC_Column {
11
  * @since 2.2.1
12
  */
13
  public function init() {
14
-
15
  parent::init();
16
 
17
- // Properties
18
- $this->properties['type'] = 'column-user_url';
19
- $this->properties['label'] = __( 'Url', 'codepress-admin-columns' );
20
  }
21
 
22
  /**
@@ -24,7 +23,6 @@ class CPAC_Column_User_Url extends CPAC_Column {
24
  * @since 2.0
25
  */
26
  function get_value( $user_id ) {
27
-
28
  return $this->get_raw_value( $user_id );
29
  }
30
 
@@ -33,7 +31,6 @@ class CPAC_Column_User_Url extends CPAC_Column {
33
  * @since 2.0.3
34
  */
35
  function get_raw_value( $user_id ) {
36
-
37
  $userdata = get_userdata( $user_id );
38
 
39
  return $userdata->user_url;
1
  <?php
2
+
3
  /**
4
  * CPAC_Column_User_Url
5
  *
12
  * @since 2.2.1
13
  */
14
  public function init() {
 
15
  parent::init();
16
 
17
+ $this->properties['type'] = 'column-user_url';
18
+ $this->properties['label'] = __( 'Url', 'codepress-admin-columns' );
 
19
  }
20
 
21
  /**
23
  * @since 2.0
24
  */
25
  function get_value( $user_id ) {
 
26
  return $this->get_raw_value( $user_id );
27
  }
28
 
31
  * @since 2.0.3
32
  */
33
  function get_raw_value( $user_id ) {
 
34
  $userdata = get_userdata( $user_id );
35
 
36
  return $userdata->user_url;
classes/column/wc-placeholder.php CHANGED
@@ -1,25 +1,24 @@
1
  <?php
 
2
  /**
3
  * @since 2.4.7
4
  */
5
  class CPAC_Column_WC_Placeholder extends CPAC_Column {
6
 
7
  public function init() {
8
-
9
  parent::init();
10
 
11
- // Properties
12
- $this->properties['type'] = 'column-wc_placeholder';
13
- $this->properties['label'] = __( 'WooCommerce', 'codepress-admin-columns' );
14
- $this->properties['is_pro_only'] = true;
15
- $this->properties['group'] = 'woocommerce';
16
  }
17
 
18
  public function apply_conditional() {
19
- return in_array( $this->storage_model->get_post_type(), array( 'product', 'shop_order', 'shop_coupon' ) );
20
  }
21
 
22
- public function display_settings() {
23
  $this->display_settings_placeholder( ac_get_site_url( 'woocommerce-columns' ) );
24
  }
25
  }
1
  <?php
2
+
3
  /**
4
  * @since 2.4.7
5
  */
6
  class CPAC_Column_WC_Placeholder extends CPAC_Column {
7
 
8
  public function init() {
 
9
  parent::init();
10
 
11
+ $this->properties['type'] = 'column-wc_placeholder';
12
+ $this->properties['label'] = __( 'WooCommerce', 'codepress-admin-columns' );
13
+ $this->properties['is_pro_only'] = true;
14
+ $this->properties['group'] = 'woocommerce';
 
15
  }
16
 
17
  public function apply_conditional() {
18
+ return in_array( $this->get_post_type(), array( 'product', 'shop_order', 'shop_coupon' ) );
19
  }
20
 
21
+ public function display_settings() {
22
  $this->display_settings_placeholder( ac_get_site_url( 'woocommerce-columns' ) );
23
  }
24
  }
classes/settings.php CHANGED
@@ -7,6 +7,8 @@
7
  */
8
  class CPAC_Settings {
9
 
 
 
10
  /**
11
  * CPAC class
12
  *
@@ -37,6 +39,7 @@ class CPAC_Settings {
37
  add_action( 'admin_init', array( $this, 'handle_column_request' ), 1000 );
38
 
39
  add_action( 'wp_ajax_cpac_column_refresh', array( $this, 'ajax_column_refresh' ) );
 
40
 
41
  add_action( 'cpac_messages', array( $this, 'maybe_display_addon_statuschange_message' ) );
42
  }
@@ -105,7 +108,6 @@ class CPAC_Settings {
105
  * @since 2.2
106
  */
107
  public function maybe_display_addon_statuschange_message() {
108
-
109
  if ( empty( $_REQUEST['tab'] ) || $_REQUEST['tab'] != 'addons' ) {
110
  return;
111
  }
@@ -114,7 +116,8 @@ class CPAC_Settings {
114
 
115
  if ( ! empty( $_REQUEST['activate'] ) ) {
116
  $message = __( 'Add-on successfully activated.', 'codepress-admin-columns' );
117
- } else if ( ! empty( $_REQUEST['deactivate'] ) ) {
 
118
  $message = __( 'Add-on successfully deactivated.', 'codepress-admin-columns' );
119
  }
120
 
@@ -132,36 +135,47 @@ class CPAC_Settings {
132
  * @since 2.2
133
  */
134
  public function ajax_column_refresh() {
135
- if ( ! empty( $_POST['formdata'] ) && ! empty( $_POST['column'] ) ) {
136
- parse_str( $_POST['formdata'], $formdata );
137
- $storagemodel_key = ! empty( $formdata['cpac_key'] ) ? $formdata['cpac_key'] : '';
138
 
139
- if ( $storagemodel_key && ! empty( $formdata[ $storagemodel_key ][ $_POST['column'] ] ) ) {
140
- $columndata = $formdata[ $formdata['cpac_key'] ][ $_POST['column'] ];
141
- $storage_model = $this->cpac->get_storage_model( $formdata['cpac_key'] );
142
- $registered_columns = $storage_model->get_registered_columns();
143
 
144
- if ( in_array( $columndata['type'], array_keys( $registered_columns ) ) ) {
145
- $column = clone $registered_columns[ $columndata['type'] ];
146
- $column->set_clone( $columndata['clone'] );
147
 
148
- foreach ( $columndata as $optionname => $optionvalue ) {
149
- $column->set_options( $optionname, $optionvalue );
150
- }
151
 
152
- $column->sanitize_label();
153
 
154
- $columns = array( $column->properties->name => $column );
 
 
155
 
156
- do_action( 'cac/columns', $columns );
157
- do_action( "cac/columns/storage_key={$storagemodel_key}", $columns );
158
 
159
- $column->display();
160
- }
161
- }
 
162
  }
163
 
164
- exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  }
166
 
167
  /**
@@ -234,9 +248,51 @@ class CPAC_Settings {
234
  // javascript translations
235
  wp_localize_script( 'cpac-admin-settings', 'cpac_i18n', array(
236
  'clone' => __( '%s column is already present and can not be duplicated.', 'codepress-admin-columns' ),
 
 
 
 
 
 
237
  ) );
238
  }
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  /**
241
  * @since 1.0
242
  */
@@ -254,20 +310,18 @@ class CPAC_Settings {
254
 
255
  switch ( $action ) :
256
 
257
- case 'update_by_type' :
258
- if ( wp_verify_nonce( $nonce, 'update-type' ) && $key ) {
259
- if ( $storage_model = $this->cpac->get_storage_model( $key ) ) {
260
- $storage_model->store();
261
- $storage_model->set_columns();
262
- }
263
- }
264
- break;
265
-
266
  case 'restore_by_type' :
267
  if ( wp_verify_nonce( $nonce, 'restore-type' ) && $key ) {
268
  if ( $storage_model = $this->cpac->get_storage_model( $key ) ) {
 
 
 
 
 
269
  $storage_model->restore();
270
- $storage_model->set_columns();
 
 
271
  }
272
  }
273
  break;
@@ -288,8 +342,8 @@ class CPAC_Settings {
288
  */
289
  private function restore_all() {
290
  global $wpdb;
291
-
292
  $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'cpac_options_%'" );
 
293
 
294
  cpac_admin_message( __( 'Default settings succesfully restored.', 'codepress-admin-columns' ), 'updated' );
295
  }
@@ -570,17 +624,15 @@ class CPAC_Settings {
570
  <?php
571
  }
572
  }
573
-
574
  ?>
575
 
576
  <tr class="restore">
577
  <th scope="row">
578
  <h3><?php _e( 'Restore Settings', 'codepress-admin-columns' ); ?></h3>
579
-
580
  <p><?php _e( 'This will delete all column settings and restore the default settings.', 'codepress-admin-columns' ); ?></p>
581
  </th>
582
  <td class="padding-22">
583
- <form method="post" action="">
584
  <?php wp_nonce_field( 'restore-all', '_cpac_nonce' ); ?>
585
  <input type="hidden" name="cpac_action" value="restore_all"/>
586
  <input type="submit" class="button" name="cpac-restore-defaults" value="<?php _e( 'Restore default settings', 'codepress-admin-columns' ) ?>" onclick="return confirm('<?php _e( "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \'OK\' to delete, \'Cancel\' to stop", 'codepress-admin-columns' ); ?>');"/>
@@ -594,17 +646,58 @@ class CPAC_Settings {
594
  <?php
595
  }
596
 
597
- /**
598
- * @since 2.4.1
599
- */
600
- private function get_menu_types() {
601
- $menu_types = array(
602
- 'post' => __( 'Posttypes', 'codepress-admin-columns' ),
603
- 'other' => __( 'Others', 'codepress-admin-columns' ),
604
- 'taxonomy' => __( 'Taxonomies', 'codepress-admin-columns' ),
605
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
606
 
607
- return apply_filters( 'cac/menu_types', $menu_types );
 
 
 
 
 
 
 
 
 
 
 
608
  }
609
 
610
  /**
@@ -648,86 +741,92 @@ class CPAC_Settings {
648
  switch ( $current_tab ) :
649
  case 'general':
650
 
651
- $keys = array_keys( $this->cpac->storage_models );
652
- $first = array_shift( $keys );
 
 
 
 
 
 
 
 
 
653
 
654
- $storage_models_by_type = array();
655
- foreach ( $this->cpac->storage_models as $k => $storage_model ) {
656
- $storage_models_by_type[ $storage_model->menu_type ][ $k ] = $storage_model;
 
 
 
 
 
 
657
  }
658
 
659
  ?>
660
- <div class="cpac-menu">
661
- <?php
662
- foreach ( $this->get_menu_types() as $menu_type => $label ) {
663
- if ( ! empty( $storage_models_by_type[ $menu_type ] ) ) {
664
- $count = 0; ?>
665
- <ul class="subsubsub">
666
- <li class="first"><?php echo $label; ?>:</li>
667
- <?php foreach ( $storage_models_by_type[ $menu_type ] as $storage_model ) : ?>
668
- <li>
669
- <?php echo $count ++ != 0 ? ' | ' : ''; ?>
670
- <a href="#cpac-box-<?php echo $storage_model->key; ?>" <?php echo $storage_model->is_menu_type_current( $first ) ? ' class="current"' : ''; ?> ><?php echo $storage_model->label; ?></a>
671
- </li>
672
- <?php endforeach; ?>
673
- </ul>
674
- <?php
675
- }
676
- }
677
- ?>
678
- </div>
679
 
680
  <?php do_action( 'cac/settings/after_menu' ); ?>
681
 
682
- <?php foreach ( $this->cpac->storage_models as $storage_model ) : ?>
683
- <div class="columns-container" data-type="<?php echo $storage_model->key ?>"<?php echo $storage_model->is_menu_type_current( $first ) ? '' : ' style="display:none"'; ?>>
684
 
685
- <div class="columns-left">
686
- <div id="titlediv">
687
- <h2>
688
- <?php echo $storage_model->label; ?>
689
- <?php $storage_model->screen_link(); ?>
690
- </h2>
 
 
 
 
 
 
 
 
 
691
  </div>
692
 
693
- <?php if ( $storage_model->is_using_php_export() ) : ?>
694
- <div class="error below-h2">
695
- <p><?php printf( __( 'The columns for %s are set up via PHP and can therefore not be edited in the admin panel.', 'codepress-admin-columns' ), '<strong>' . $storage_model->label . '</strong>' ); ?></p>
696
- </div>
697
- <?php endif; ?>
698
  </div>
699
 
700
  <div class="columns-right">
701
  <div class="columns-right-inside">
702
  <?php if ( ! $storage_model->is_using_php_export() ) : ?>
703
- <div class="sidebox" id="form-actions">
 
704
  <h3>
705
- <?php _e( 'Store settings', 'codepress-admin-columns' ) ?>
 
706
  </h3>
707
- <?php $has_been_stored = $storage_model->get_stored_columns() ? true : false; ?>
708
  <div class="form-update">
709
- <a href="javascript:;" class="button-primary submit-update"><?php echo $has_been_stored ? __( 'Update' ) : __( 'Save' ); ?><?php echo ' ' . $storage_model->label; ?></a>
 
710
  </div>
711
- <?php if ( $has_been_stored ) : ?>
712
- <div class="form-reset">
713
- <a href="<?php echo add_query_arg( array(
714
- '_cpac_nonce' => wp_create_nonce( 'restore-type' ),
715
- 'cpac_key' => $storage_model->key,
716
- 'cpac_action' => 'restore_by_type'
717
- ), $this->get_settings_url( 'admin' ) ); ?>" class="reset-column-type" onclick="return confirm('<?php printf( __( "Warning! The %s columns data will be deleted. This cannot be undone. \'OK\' to delete, \'Cancel\' to stop", 'codepress-admin-columns' ), $storage_model->label ); ?>');">
718
- <?php _e( 'Restore', 'codepress-admin-columns' ); ?>
719
- <?php echo ' ' . $storage_model->label . ' '; ?>
720
- <?php _e( 'columns', 'codepress-admin-columns' ); ?>
721
- </a>
722
- </div>
723
- <?php endif; ?>
724
 
725
  <?php do_action( 'cac/settings/form_actions', $storage_model ); ?>
726
 
727
  </div><!--form-actions-->
728
  <?php endif; ?>
729
 
 
 
730
  <?php if ( ! cpac_is_pro_active() ) : ?>
 
731
  <?php $url_args = array(
732
  'utm_source' => 'plugin-installation',
733
  'utm_medium' => 'banner',
@@ -852,62 +951,83 @@ class CPAC_Settings {
852
  </div><!--.columns-right-->
853
 
854
  <div class="columns-left">
855
- <div class="cpac-boxes">
856
- <?php if ( ! $storage_model->is_using_php_export() ) : ?>
857
- <div class="cpac-columns">
 
 
 
 
858
 
859
- <form method="post" action="">
860
- <?php wp_nonce_field( 'update-type', '_cpac_nonce' ); ?>
861
 
862
- <input type="hidden" name="cpac_key" value="<?php echo $storage_model->key; ?>"/>
863
- <input type="hidden" name="cpac_action" value="update_by_type"/>
 
 
 
864
 
865
- <?php
866
- foreach ( $storage_model->columns as $column ) {
867
- $column->display();
868
- }
869
- ?>
870
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
871
 
872
- </div><!--.cpac-columns-->
873
 
874
- <div class="column-footer">
 
875
  <div class="order-message">
876
  <?php _e( 'Drag and drop to reorder', 'codepress-admin-columns' ); ?>
877
  </div>
878
  <div class="button-container">
879
- <a href="javascript:;" class="add_column button button-primary">+ <?php _e( 'Add Column', 'codepress-admin-columns' ); ?></a><br/>
 
 
880
  </div>
 
 
881
 
882
- </div><!--.cpac-column-footer-->
883
- <?php endif; ?>
884
  </div><!--.cpac-boxes-->
 
 
 
885
  </div><!--.columns-left-->
886
  <div class="clear"></div>
887
 
888
  <div class="for-cloning-only" style="display:none">
889
  <?php
890
- foreach ( $storage_model->get_registered_columns() as $column ) {
891
  $column->display();
892
  }
893
  ?>
894
  </div>
 
895
  </div><!--.columns-container-->
896
- <?php endforeach; // storage_models
897
- ?>
898
 
899
  <div class="clear"></div>
900
  <?php
901
- break; // case: general
902
  case 'settings' :
903
  $this->display_settings();
904
  break;
905
  case 'addons' :
906
  $this->tab_addons();
907
  break;
908
- case 'help' :
909
- //$this->tab_addons();
910
- break;
911
  default:
912
 
913
  /**
7
  */
8
  class CPAC_Settings {
9
 
10
+ CONST OPTION_CURRENT = 'cpac_current_model';
11
+
12
  /**
13
  * CPAC class
14
  *
39
  add_action( 'admin_init', array( $this, 'handle_column_request' ), 1000 );
40
 
41
  add_action( 'wp_ajax_cpac_column_refresh', array( $this, 'ajax_column_refresh' ) );
42
+ add_action( 'wp_ajax_cpac_columns_update', array( $this, 'ajax_columns_update' ) );
43
 
44
  add_action( 'cpac_messages', array( $this, 'maybe_display_addon_statuschange_message' ) );
45
  }
108
  * @since 2.2
109
  */
110
  public function maybe_display_addon_statuschange_message() {
 
111
  if ( empty( $_REQUEST['tab'] ) || $_REQUEST['tab'] != 'addons' ) {
112
  return;
113
  }
116
 
117
  if ( ! empty( $_REQUEST['activate'] ) ) {
118
  $message = __( 'Add-on successfully activated.', 'codepress-admin-columns' );
119
+ }
120
+ else if ( ! empty( $_REQUEST['deactivate'] ) ) {
121
  $message = __( 'Add-on successfully deactivated.', 'codepress-admin-columns' );
122
  }
123
 
135
  * @since 2.2
136
  */
137
  public function ajax_column_refresh() {
138
+ check_ajax_referer( 'cpac-settings' );
 
 
139
 
140
+ if ( ! current_user_can( 'manage_admin_columns' ) ) {
141
+ wp_die();
142
+ }
 
143
 
144
+ $formdata = filter_input( INPUT_POST, 'formdata' );
145
+ $column = filter_input( INPUT_POST, 'column' );
 
146
 
147
+ if ( ! $formdata || ! $column ) {
148
+ wp_die();
149
+ }
150
 
151
+ parse_str( $_POST['formdata'], $formdata );
152
 
153
+ if ( empty( $formdata['cpac_key'] ) ) {
154
+ wp_die();
155
+ }
156
 
157
+ $storage_model = cpac()->get_storage_model( $formdata['cpac_key'] );
 
158
 
159
+ $storage_model->set_layout( $_POST['layout'] );
160
+
161
+ if ( ! $storage_model || empty( $formdata[ $storage_model->key ][ $column ] ) ) {
162
+ wp_die();
163
  }
164
 
165
+ $columndata = $formdata[ $storage_model->key ][ $column ];
166
+
167
+ $column = $storage_model->create_column( $columndata );
168
+ if ( ! $column ) {
169
+ wp_die();
170
+ }
171
+
172
+ // Trigger add-ons like inline-edit and sortable
173
+ do_action( "cac/columns", array( $column->properties->name => $column ), $storage_model );
174
+ do_action( "cac/columns/storage_key={$storage_model->key}", array( $column->properties->name => $column ), $storage_model );
175
+
176
+ ob_start();
177
+ $column->display();
178
+ wp_send_json_success( ob_get_clean() );
179
  }
180
 
181
  /**
248
  // javascript translations
249
  wp_localize_script( 'cpac-admin-settings', 'cpac_i18n', array(
250
  'clone' => __( '%s column is already present and can not be duplicated.', 'codepress-admin-columns' ),
251
+ 'error' => __( 'Invalid response.', 'codepress-admin-columns' ),
252
+ ) );
253
+
254
+ // nonce
255
+ wp_localize_script( 'cpac-admin-settings', 'cpac', array(
256
+ '_ajax_nonce' => wp_create_nonce( 'cpac-settings' )
257
  ) );
258
  }
259
 
260
+ /**
261
+ * @since 2.5
262
+ */
263
+ public function ajax_columns_update() {
264
+ check_ajax_referer( 'cpac-settings' );
265
+
266
+ if ( ! current_user_can( 'manage_admin_columns' ) ) {
267
+ wp_die();
268
+ }
269
+
270
+ $storage_model = $this->cpac->get_storage_model( filter_input( INPUT_POST, 'storage_model' ) );
271
+
272
+ if ( ! $storage_model ) {
273
+ wp_die();
274
+ }
275
+
276
+ $storage_model->set_layout( filter_input( INPUT_POST, 'layout' ) );
277
+
278
+ parse_str( $_POST['data'], $formdata );
279
+
280
+ if ( ! isset( $formdata[ $storage_model->key ] ) ) {
281
+ wp_die();
282
+ }
283
+
284
+ $stored = $storage_model->store( $formdata[ $storage_model->key ] );
285
+
286
+ if ( is_wp_error( $stored ) ) {
287
+ wp_send_json_error( $stored->get_error_message() );
288
+ }
289
+
290
+ wp_send_json_success(
291
+ sprintf( __( 'Settings for %s updated successfully.', 'codepress-admin-columns' ), "<strong>" . $storage_model->get_label_or_layout_name() . "</strong>" )
292
+ . ' <a href="' . $storage_model->get_link() . '">' . sprintf( __( 'View %s screen', 'codepress-admin-columns' ), $storage_model->label ) . '</a>'
293
+ );
294
+ }
295
+
296
  /**
297
  * @since 1.0
298
  */
310
 
311
  switch ( $action ) :
312
 
 
 
 
 
 
 
 
 
 
313
  case 'restore_by_type' :
314
  if ( wp_verify_nonce( $nonce, 'restore-type' ) && $key ) {
315
  if ( $storage_model = $this->cpac->get_storage_model( $key ) ) {
316
+
317
+ if ( isset( $_POST['cpac_layout'] ) ) {
318
+ $storage_model->set_layout( $_POST['cpac_layout'] );
319
+ }
320
+
321
  $storage_model->restore();
322
+ $storage_model->flush_columns();
323
+
324
+ cpac_admin_message( sprintf( __( 'Settings for %s restored successfully.', 'codepress-admin-columns' ), "<strong>" . $storage_model->get_label_or_layout_name() . "</strong>" ), 'updated' );
325
  }
326
  }
327
  break;
342
  */
343
  private function restore_all() {
344
  global $wpdb;
 
345
  $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'cpac_options_%'" );
346
+ $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'cpac_layouts%'" );
347
 
348
  cpac_admin_message( __( 'Default settings succesfully restored.', 'codepress-admin-columns' ), 'updated' );
349
  }
624
  <?php
625
  }
626
  }
 
627
  ?>
628
 
629
  <tr class="restore">
630
  <th scope="row">
631
  <h3><?php _e( 'Restore Settings', 'codepress-admin-columns' ); ?></h3>
 
632
  <p><?php _e( 'This will delete all column settings and restore the default settings.', 'codepress-admin-columns' ); ?></p>
633
  </th>
634
  <td class="padding-22">
635
+ <form method="post">
636
  <?php wp_nonce_field( 'restore-all', '_cpac_nonce' ); ?>
637
  <input type="hidden" name="cpac_action" value="restore_all"/>
638
  <input type="submit" class="button" name="cpac-restore-defaults" value="<?php _e( 'Restore default settings', 'codepress-admin-columns' ) ?>" onclick="return confirm('<?php _e( "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \'OK\' to delete, \'Cancel\' to stop", 'codepress-admin-columns' ); ?>');"/>
646
  <?php
647
  }
648
 
649
+ public function sort_by_label( $a, $b ) {
650
+ return strcmp( $a->label, $b->label );
651
+ }
652
+
653
+ private function set_user_model_preference( $storage_model_key ) {
654
+ update_user_meta( get_current_user_id(), self::OPTION_CURRENT, $storage_model_key );
655
+ }
656
+
657
+ private function delete_user_model_preference() {
658
+ delete_user_meta( get_current_user_id(), self::OPTION_CURRENT );
659
+ }
660
+
661
+ private function get_user_model_preference() {
662
+ return cpac()->get_storage_model( get_user_meta( get_current_user_id(), self::OPTION_CURRENT, true ) );
663
+ }
664
+
665
+ public function get_settings_storage_model() {
666
+
667
+ if ( isset( $_REQUEST['cpac_key'] ) ) {
668
+
669
+ // By request
670
+ if ( $_storage_model = cpac()->get_storage_model( $_REQUEST['cpac_key'] ) ) {
671
+ $storage_model = $_storage_model;
672
+ }
673
+
674
+ // User preference
675
+ else if ( $_storage_model = $this->get_user_model_preference() ) {
676
+ $storage_model = $_storage_model;
677
+ }
678
+
679
+ // First one served
680
+ else {
681
+ $storage_model = cpac()->get_first_storage_model();
682
+ }
683
+
684
+ $this->set_user_model_preference( $storage_model->key );
685
+ }
686
+
687
+ else {
688
 
689
+ // User preference
690
+ if ( $exists = $this->get_user_model_preference() ) {
691
+ $storage_model = $exists;
692
+ }
693
+
694
+ // First one served
695
+ else {
696
+ $storage_model = cpac()->get_first_storage_model();
697
+ }
698
+ }
699
+
700
+ return $storage_model;
701
  }
702
 
703
  /**
741
  switch ( $current_tab ) :
742
  case 'general':
743
 
744
+ $storage_model = $this->get_settings_storage_model();
745
+ $storage_model->init_layout();
746
+
747
+ $has_been_stored = $storage_model->get_stored_columns() ? true : false;
748
+
749
+ // columns should not be editable when layout isn't
750
+ if ( $layout = $storage_model->get_layout_object() ) {
751
+ if ( isset( $layout->not_editable ) ) {
752
+ $storage_model->enable_php_export();
753
+ }
754
+ }
755
 
756
+ // Grouped storage models
757
+ $grouped = array();
758
+ foreach ( cpac()->get_storage_models() as $_storage_model ) {
759
+ $grouped[ $_storage_model->get_menu_type() ][] = (object) array(
760
+ 'key' => $_storage_model->key,
761
+ 'link' => $_storage_model->get_edit_link(),
762
+ 'label' => $_storage_model->label
763
+ );
764
+ usort( $grouped[ $_storage_model->get_menu_type() ], array( $this, 'sort_by_label' ) );
765
  }
766
 
767
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
768
 
769
  <?php do_action( 'cac/settings/after_menu' ); ?>
770
 
771
+ <div class="columns-container<?php echo $has_been_stored ? ' stored' : ''; ?>" data-type="<?php echo $storage_model->key ?>" data-layout="<?php echo $storage_model->get_layout(); ?>">
 
772
 
773
+ <div class="main">
774
+
775
+ <div class="menu">
776
+ <select id="cpac_storage_modal_select">
777
+ <?php foreach ( $grouped as $menu_type => $models ) : ?>
778
+ <optgroup label="<?php echo esc_attr( $menu_type ); ?>">
779
+ <?php foreach ( $models as $model ) : ?>
780
+ <option value="<?php echo esc_attr( $model->link ); ?>" <?php selected( $model->key, $storage_model->key ); ?>><?php echo esc_html( $model->label ); ?></option>
781
+ <?php endforeach; ?>
782
+ </optgroup>
783
+ <?php endforeach; ?>
784
+ </select>
785
+ <span class="spinner"></span>
786
+
787
+ <?php $storage_model->screen_link(); ?>
788
  </div>
789
 
790
+
791
+ <?php do_action( 'cac/settings/after_title', $storage_model ); ?>
792
+
 
 
793
  </div>
794
 
795
  <div class="columns-right">
796
  <div class="columns-right-inside">
797
  <?php if ( ! $storage_model->is_using_php_export() ) : ?>
798
+ <div class="sidebox form-actions">
799
+ <?php $label = __( 'Store settings', 'codepress-admin-columns' ); ?>
800
  <h3>
801
+ <span class="left"><?php echo $label; ?></span>
802
+ <span class="right"><?php echo esc_html( $storage_model->get_truncated_side_label( $label ) ); ?></span>
803
  </h3>
804
+
805
  <div class="form-update">
806
+ <a href="javascript:;" class="button-primary submit update"><?php _e( 'Update' ); ?></a>
807
+ <a href="javascript:;" class="button-primary submit save"><?php _e( 'Save' ); ?></a>
808
  </div>
809
+
810
+ <form class="form-reset" method="post">
811
+ <input type="hidden" name="cpac_key" value="<?php echo $storage_model->key; ?>"/>
812
+ <input type="hidden" name="cpac_action" value="restore_by_type"/>
813
+ <input type="hidden" name="cpac_layout" value="<?php echo $storage_model->layout; ?>"/>
814
+ <?php wp_nonce_field( 'restore-type', '_cpac_nonce' ); ?>
815
+
816
+ <?php $onclick = $this->cpac->use_delete_confirmation() ? ' onclick="return confirm(\'' . esc_attr( addslashes( sprintf( __( "Warning! The %s columns data will be deleted. This cannot be undone. 'OK' to delete, 'Cancel' to stop", 'codepress-admin-columns' ), "'" . $storage_model->get_label_or_layout_name() . "'" ) ) ) . '\');"' : ''; ?>
817
+ <input class="reset-column-type" type="submit"<?php echo $onclick; ?> value="<?php _e( 'Restore columns', 'codepress-admin-columns' ); ?>">
818
+ <span class="spinner"></span>
819
+ </form>
 
 
820
 
821
  <?php do_action( 'cac/settings/form_actions', $storage_model ); ?>
822
 
823
  </div><!--form-actions-->
824
  <?php endif; ?>
825
 
826
+ <?php do_action( 'cac/settings/sidebox', $storage_model ); ?>
827
+
828
  <?php if ( ! cpac_is_pro_active() ) : ?>
829
+
830
  <?php $url_args = array(
831
  'utm_source' => 'plugin-installation',
832
  'utm_medium' => 'banner',
951
  </div><!--.columns-right-->
952
 
953
  <div class="columns-left">
954
+ <?php if ( ! $storage_model->get_default_stored_columns() ): ?>
955
+ <div class="cpac-notice">
956
+ <p>
957
+ <?php echo sprintf( __( 'Please visit the %s screen once to load all available columns', 'codepress-admin-columns' ), "<a href='" . $storage_model->get_link() . "'>" . esc_html( $storage_model->label ) . "</a>" ); ?>
958
+ </p>
959
+ </div>
960
+ <?php endif ?>
961
 
962
+ <div class="ajax-message"><p></p></div>
 
963
 
964
+ <?php if ( $storage_model->is_using_php_export() ) : ?>
965
+ <div class="notice notice-warning below-h2">
966
+ <p><?php printf( __( 'The columns for %s are set up via PHP and can therefore not be edited', 'codepress-admin-columns' ), '<strong>' . $storage_model->label . '</strong>' ); ?></p>
967
+ </div>
968
+ <?php endif; ?>
969
 
970
+ <div class="cpac-boxes<?php echo $storage_model->is_using_php_export() ? ' disabled' : ''; ?>">
971
+
972
+ <div class="cpac-columns">
973
+ <form method="post" action="<?php echo $storage_model->get_edit_link(); ?>">
974
+
975
+ <input type="hidden" name="cpac_key" value="<?php echo $storage_model->key; ?>"/>
976
+ <input type="hidden" name="cpac_action" value="update_by_type"/>
977
+ <input type="hidden" name="cpac_layout" value="<?php echo $storage_model->layout; ?>"/>
978
+
979
+ <?php do_action( 'cac/settings/form_columns', $storage_model ); ?>
980
+
981
+ <?php wp_nonce_field( 'update-type', '_cpac_nonce' ); ?>
982
+
983
+ <?php
984
+ foreach ( $storage_model->get_columns() as $column ) {
985
+ $column->display();
986
+ }
987
+ ?>
988
+ </form>
989
 
990
+ </div><!--.cpac-columns-->
991
 
992
+ <div class="column-footer">
993
+ <?php if ( ! $storage_model->is_using_php_export() ) : ?>
994
  <div class="order-message">
995
  <?php _e( 'Drag and drop to reorder', 'codepress-admin-columns' ); ?>
996
  </div>
997
  <div class="button-container">
998
+ <a href="javascript:;" class="add_column button-primary">+ <?php _e( 'Add Column', 'codepress-admin-columns' ); ?></a>
999
+ <?php /*<a href="javascript:;" class="button-primary submit update"><?php _e( 'Update' ); ?></a>*/ ?>
1000
+ <?php /*<a href="javascript:;" class="button-primary submit save"><?php _e( 'Save' ); ?></a>*/ ?>
1001
  </div>
1002
+ <?php endif; ?>
1003
+ </div><!--.cpac-column-footer-->
1004
 
 
 
1005
  </div><!--.cpac-boxes-->
1006
+
1007
+ <?php do_action( 'cac/settings/after_columns', $storage_model ); ?>
1008
+
1009
  </div><!--.columns-left-->
1010
  <div class="clear"></div>
1011
 
1012
  <div class="for-cloning-only" style="display:none">
1013
  <?php
1014
+ foreach ( $storage_model->get_column_types() as $column ) {
1015
  $column->display();
1016
  }
1017
  ?>
1018
  </div>
1019
+
1020
  </div><!--.columns-container-->
 
 
1021
 
1022
  <div class="clear"></div>
1023
  <?php
1024
+ break;
1025
  case 'settings' :
1026
  $this->display_settings();
1027
  break;
1028
  case 'addons' :
1029
  $this->tab_addons();
1030
  break;
 
 
 
1031
  default:
1032
 
1033
  /**
classes/storage_model.php CHANGED
@@ -7,6 +7,10 @@
7
  */
8
  abstract class CPAC_Storage_Model {
9
 
 
 
 
 
10
  /**
11
  * @since 2.0
12
  */
@@ -62,6 +66,20 @@ abstract class CPAC_Storage_Model {
62
  */
63
  public $subpage;
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  /**
66
  * Uses PHP export to display settings
67
  *
@@ -80,37 +98,25 @@ abstract class CPAC_Storage_Model {
80
  * @since 2.0.1
81
  * @var array
82
  */
83
- public $columns = array();
84
 
85
  /**
86
- * @since 2.1.0
87
- * @var array
88
- */
89
- public $custom_columns = array();
90
-
91
- /**
92
- * @since 2.1.0
93
- * @var array
94
- */
95
- public $default_columns = array();
96
-
97
- /**
98
- * @since 2.4.9
99
  * @var array
100
  */
101
- private $default_wp_columns = array();
102
 
103
  /**
104
- * @since 2.2
105
  * @var array
106
  */
107
- public $stored_columns = null;
108
 
109
  /**
110
- * @since 2.2
111
  * @var array
112
  */
113
- public $column_types = array();
114
 
115
  /**
116
  * @since 2.4.4
@@ -127,17 +133,213 @@ abstract class CPAC_Storage_Model {
127
  * @since 2.2
128
  */
129
  function __construct() {
130
-
131
- // set columns paths
132
  $this->set_columns_filepath();
133
  }
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  /**
136
  * initialize callback for managing the headers and values for columns
137
  * @since 2.4.10
138
  *
139
  */
140
- public function init_manage_columns(){}
 
141
 
142
  /**
143
  * @since 2.0.3
@@ -145,6 +347,7 @@ abstract class CPAC_Storage_Model {
145
  */
146
  public function is_current_screen() {
147
  global $pagenow;
 
148
  return $this->page . '.php' === $pagenow && $this->subpage == filter_input( INPUT_GET, 'page' );
149
  }
150
 
@@ -159,6 +362,22 @@ abstract class CPAC_Storage_Model {
159
  return $this;
160
  }
161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  /**
163
  * Checks if menu type is currently viewed
164
  *
@@ -209,17 +428,18 @@ abstract class CPAC_Storage_Model {
209
  * @return array
210
  */
211
  public function get_meta_keys() {
212
-
213
  if ( $cache = wp_cache_get( $this->key, 'cac_columns' ) ) {
214
  $keys = $cache;
215
- } else {
 
216
  $keys = $this->get_meta();
217
  wp_cache_add( $this->key, $keys, 'cac_columns', 10 ); // 10 sec.
218
  }
219
 
220
  if ( is_wp_error( $keys ) || empty( $keys ) ) {
221
  $keys = false;
222
- } else {
 
223
  $keys = $this->format_meta_keys( $keys );
224
  }
225
 
@@ -277,28 +497,213 @@ abstract class CPAC_Storage_Model {
277
  }
278
 
279
  /**
280
- * @since 2.0
 
 
281
  */
282
- public function restore() {
 
 
 
 
 
 
283
 
284
- delete_option( "cpac_options_{$this->key}" );
 
285
 
286
- cpac_admin_message( "<strong>{$this->label}</strong> " . __( 'settings succesfully restored.', 'codepress-admin-columns' ), 'updated' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  }
288
 
289
  /**
290
  * @since 2.0
291
  */
292
- public function store( $columns = '' ) {
 
 
293
 
294
- if ( ! empty( $_POST[ $this->key ] ) ) {
295
- $columns = array_filter( $_POST[ $this->key ] );
 
 
 
 
 
 
296
  }
297
 
298
- if ( ! $columns ) {
299
- cpac_admin_message( __( 'No columns settings available.', 'codepress-admin-columns' ), 'error' );
300
 
301
- return false;
 
 
 
 
 
 
 
 
 
302
  }
303
 
304
  // sanitize user inputs
@@ -313,18 +718,15 @@ abstract class CPAC_Storage_Model {
313
  }
314
 
315
  // store columns
316
- $result = update_option( "cpac_options_{$this->key}", $columns );
317
- $result_default = update_option( "cpac_options_{$this->key}_default", array_keys( $this->get_default_columns() ) );
318
 
319
- // error
320
- if ( ! $result && ! $result_default ) {
321
- cpac_admin_message( sprintf( __( 'You are trying to store the same settings for %s.', 'codepress-admin-columns' ), "<strong>{$this->label}</strong>" ), 'error' );
322
 
323
- return false;
 
324
  }
325
 
326
- cpac_admin_message( sprintf( __( 'Settings for %s updated successfully.', 'codepress-admin-columns' ), "<strong>{$this->label}</strong>" ), 'updated' );
327
-
328
  /**
329
  * Fires after a new column setup is stored in the database
330
  * Primarily used when columns are saved through the Admin Columns settings screen
@@ -339,6 +741,17 @@ abstract class CPAC_Storage_Model {
339
  return true;
340
  }
341
 
 
 
 
 
 
 
 
 
 
 
 
342
  /**
343
  * Goes through all files in 'classes/column' and includes each file.
344
  *
@@ -347,6 +760,10 @@ abstract class CPAC_Storage_Model {
347
  */
348
  public function set_columns_filepath() {
349
 
 
 
 
 
350
  $columns = array(
351
  'CPAC_Column_Custom_Field' => CPAC_DIR . 'classes/column/custom-field.php',
352
  'CPAC_Column_Taxonomy' => CPAC_DIR . 'classes/column/taxonomy.php',
@@ -430,8 +847,7 @@ abstract class CPAC_Storage_Model {
430
  */
431
  public function create_column_instance( $column_name, $label ) {
432
 
433
- // create column instance
434
- $column = new CPAC_Column( $this );
435
 
436
  $column
437
  ->set_properties( 'type', $column_name )
@@ -439,7 +855,7 @@ abstract class CPAC_Storage_Model {
439
  ->set_properties( 'label', $label )
440
  ->set_properties( 'is_cloneable', false )
441
  ->set_properties( 'default', true )
442
- ->set_properties( 'group', 'plugin' )
443
  ->set_options( 'label', $label )
444
  ->set_options( 'state', 'on' );
445
 
@@ -453,81 +869,9 @@ abstract class CPAC_Storage_Model {
453
  $column->set_properties( 'label', ucfirst( $column_name ) );
454
  }
455
 
456
- /**
457
- * Filter the default column names
458
- *
459
- * @since 2.4.4
460
- *
461
- * @param array $default_column_names Default column names
462
- * @param object $column Column object
463
- * @param object $this Storage_Model object
464
- */
465
- $default_column_names = apply_filters( 'cac/columns/defaults', $this->get_default_column_names(), $column, $this );
466
- $default_column_names = apply_filters( 'cac/columns/defaults/type=' . $this->get_type(), $default_column_names, $column, $this );
467
- $default_column_names = apply_filters( 'cac/columns/defaults/post_type=' . $this->get_post_type(), $default_column_names, $column, $this );
468
-
469
- // set group for WP Default
470
- if ( $default_column_names && in_array( $column_name, $default_column_names ) ) {
471
- $column->set_properties( 'group', 'default' );
472
- }
473
-
474
  return $column;
475
  }
476
 
477
- /**
478
- * @since 2.0
479
- * @return array Column Type | Column Instance
480
- */
481
- private function get_default_registered_columns() {
482
-
483
- $columns = array();
484
- foreach ( $this->default_wp_columns as $column_name => $label ) {
485
-
486
- // checkboxes are mandatory
487
- if ( 'cb' == $column_name ) {
488
- continue;
489
- }
490
- $column = $this->create_column_instance( $column_name, $label );
491
- $columns[ $column->properties->name ] = $column;
492
- }
493
-
494
- do_action( "cac/columns/registered/default", $columns, $this );
495
- do_action( "cac/columns/registered/default/storage_key={$this->key}", $columns, $this );
496
-
497
- return $columns;
498
- }
499
-
500
- /**
501
- * @since 2.0
502
- * @return array Column Type | Column Instance
503
- */
504
- public function get_custom_registered_columns() {
505
-
506
- $columns = array();
507
-
508
- foreach ( $this->columns_filepath as $classname => $path ) {
509
- include_once $path;
510
-
511
- if ( ! class_exists( $classname ) ) {
512
- continue;
513
- }
514
-
515
- $column = new $classname( $this );
516
-
517
- // exclude columns that are not registered based on conditional logic within the child column
518
- if ( ! $column->properties->is_registered ) {
519
- continue;
520
- }
521
-
522
- $columns[ $column->properties->type ] = $column;
523
- }
524
-
525
- do_action( "cac/columns/registered/custom", $columns, $this );
526
- do_action( "cac/columns/registered/custom/storage_key={$this->key}", $columns, $this );
527
-
528
- return $columns;
529
- }
530
-
531
  /**
532
  * @since 1.0
533
  *
@@ -536,12 +880,19 @@ abstract class CPAC_Storage_Model {
536
  * @return array Column options
537
  */
538
  public function get_default_stored_columns() {
 
 
539
 
540
- if ( ! $columns = get_option( "cpac_options_{$this->key}_default" ) ) {
541
- return array();
542
- }
 
 
 
 
543
 
544
- return $columns;
 
545
  }
546
 
547
  /**
@@ -549,35 +900,19 @@ abstract class CPAC_Storage_Model {
549
  * @return array Column options
550
  */
551
  public function get_stored_columns() {
 
552
 
553
- if ( $this->is_using_php_export() ) {
554
- $columns = $this->stored_columns;
555
- }
556
- else {
557
- $columns = $this->get_database_columns();
558
- }
559
-
560
- $columns = apply_filters( 'cpac/storage_model/stored_columns', $columns, $this );
561
- $columns = apply_filters( 'cpac/storage_model/stored_columns/storage_key=' . $this->key, $columns, $this );
562
 
563
- if ( ! $columns ) {
564
- return array();
565
  }
566
 
567
- return $columns;
568
  }
569
 
570
  public function get_database_columns() {
571
- return get_option( "cpac_options_{$this->key}" );
572
- }
573
-
574
- /**
575
- * Set stopred column by 3rd party plugins
576
- *
577
- * @since 2.3
578
- */
579
- public function set_stored_columns( $columns ) {
580
- $this->stored_columns = $columns;
581
  }
582
 
583
  /**
@@ -617,181 +952,13 @@ abstract class CPAC_Storage_Model {
617
  return $this->meta_type;
618
  }
619
 
620
- /**
621
- * @since 2.0.2
622
- */
623
- public function set_columns() {
624
-
625
- do_action( 'cac/set_columns', $this );
626
-
627
- $this->custom_columns = $this->get_custom_registered_columns();
628
- $this->default_wp_columns = $this->get_default_columns();
629
- $this->default_columns = $this->get_default_registered_columns();
630
- $this->column_types = $this->get_grouped_column_types();
631
- $this->columns = $this->get_columns();
632
-
633
- do_action( 'cac/set_columns/after', $this );
634
- }
635
-
636
- public function get_grouped_column_types() {
637
-
638
- $types = array();
639
- $groups = array_keys( $this->get_column_type_groups() );
640
-
641
- $columns = array_merge( $this->default_columns, $this->custom_columns );
642
-
643
- foreach ( $groups as $group ) {
644
- $grouptypes = array();
645
-
646
- foreach ( $columns as $index => $column ) {
647
- if ( $column->properties->group == $group ) {
648
- $grouptypes[ $index ] = $column;
649
- unset( $columns[ $index ] );
650
- }
651
- }
652
-
653
- $types[ $group ] = $grouptypes;
654
- }
655
-
656
- return $types;
657
- }
658
-
659
- public function get_column_type_groups() {
660
-
661
- $groups = array(
662
- 'default' => __( 'Default', 'codepress-admin-columns' ),
663
- 'custom-field' => __( 'Custom Field', 'codepress-admin-columns' ),
664
- 'custom' => __( 'Custom', 'codepress-admin-columns' ),
665
- 'plugin' => __( 'Columns by Plugins', 'codepress-admin-columns' ),
666
- 'acf' => __( 'Advanced Custom Fields', 'codepress-admin-columns' ),
667
- 'woocommerce' => __( 'WooCommerce', 'codepress-admin-columns' )
668
- );
669
-
670
- /**
671
- * Filter the available column type groups
672
- *
673
- * @since 2.2
674
- *
675
- * @param array $groups Available groups ([groupid] => [label])
676
- * @param CPAC_Storage_Model $storage_model_instance Storage model class instance
677
- */
678
- $groups = apply_filters( "cac/storage_model/column_type_groups", $groups, $this );
679
- $groups = apply_filters( "cac/storage_model/column_type_groups/storage_key={$this->key}", $groups, $this );
680
-
681
- return $groups;
682
- }
683
-
684
- /**
685
- * @since 2.0.2
686
- */
687
- public function get_registered_columns() {
688
- $types = array();
689
- foreach ( $this->column_types as $grouptypes ) {
690
- $types = array_merge( $types, $grouptypes );
691
- }
692
-
693
- return $types;
694
- }
695
-
696
- /**
697
- * @since 2.3.4
698
- *
699
- * @param string Column Type
700
- */
701
- public function get_registered_column( $column_type ) {
702
- $columns = $this->get_registered_columns();
703
-
704
- return isset( $columns[ $column_type ] ) ? $columns[ $column_type ] : false;
705
- }
706
-
707
- /**
708
- * @since 2.0
709
- */
710
- public function get_columns() {
711
-
712
- do_action( 'cac/get_columns', $this );
713
-
714
- $columns = array();
715
-
716
- if ( ! $this->default_wp_columns ) {
717
- $this->default_wp_columns = $this->get_default_columns();
718
- }
719
- $registered_columns = $this->get_registered_columns();
720
-
721
- if ( $stored_columns = $this->get_stored_columns() ) {
722
-
723
- foreach ( $stored_columns as $name => $options ) {
724
- if ( ! isset( $options['type'] ) ) {
725
- continue;
726
- }
727
-
728
- // In case of a disabled plugin, we will skip column.
729
- // This means the stored column type is not available anymore.
730
- if ( ! in_array( $options['type'], array_keys( $registered_columns ) ) ) {
731
- continue;
732
- }
733
-
734
- // add an clone number which defines the instance
735
- $column = clone $registered_columns[ $options['type'] ];
736
- $column->set_clone( $options['clone'] );
737
-
738
- // merge default options with stored
739
- $column->options = (object) array_merge( (array) $column->options, $options );
740
-
741
- $column->sanitize_label();
742
-
743
- $columns[ $name ] = $column;
744
- }
745
-
746
- // In case of an enabled plugin, we will add that column.
747
- // When $diff contains items, it means a default column has not been stored.
748
- if ( $diff = array_diff( array_keys( $this->default_wp_columns ), $this->get_default_stored_columns() ) ) {
749
- foreach ( $diff as $name ) {
750
- // because of the filter "manage_{$post_type}_posts_columns" the columns
751
- // that are being added by CPAC will also appear in the $this->default_wp_columns.
752
- // this will filter out those columns.
753
- if ( isset( $columns[ $name ] ) ) {
754
- continue;
755
- }
756
-
757
- // is the column registered?
758
- if ( ! isset( $registered_columns[ $name ] ) ) {
759
- continue;
760
- }
761
-
762
- $columns[ $name ] = clone $registered_columns[ $name ];
763
- }
764
- }
765
- } // When nothing has been saved yet, we return the default WP columns.
766
- else {
767
- foreach ( array_keys( $this->default_wp_columns ) as $name ) {
768
- if ( isset( $registered_columns[ $name ] ) ) {
769
- $columns[ $name ] = clone $registered_columns[ $name ];
770
- }
771
- }
772
-
773
- /**te
774
- * Filter the columns that should be loaded if there were no stored columns
775
- *
776
- * @since 2.2.4
777
- *
778
- * @param array $columns List of columns ([column name] => [column instance])
779
- * @param CPAC_Storage_Model $storage_model_instance Storage model class instance
780
- */
781
- $columns = apply_filters( 'cpac/storage_model/columns_default', $columns, $this );
782
- }
783
-
784
- do_action( "cac/columns", $columns );
785
- do_action( "cac/columns/storage_key={$this->key}", $columns );
786
-
787
- return $columns;
788
- }
789
-
790
  /**
791
  * @since 2.0
792
  */
793
  public function get_column_by_name( $name ) {
794
- return isset( $this->columns[ $name ] ) ? $this->columns[ $name ] : false;
 
 
795
  }
796
 
797
  /**
@@ -799,13 +966,20 @@ abstract class CPAC_Storage_Model {
799
  */
800
  public function add_headings( $columns ) {
801
 
 
 
 
 
 
802
  // make sure we run this only once
803
  if ( $this->column_headings ) {
804
  return $this->column_headings;
805
  }
806
 
807
- if ( ! $this->default_columns ) {
808
- return $columns;
 
 
809
  }
810
 
811
  if ( ! ( $stored_columns = $this->get_stored_columns() ) ) {
@@ -819,12 +993,19 @@ abstract class CPAC_Storage_Model {
819
  $this->column_headings['cb'] = $columns['cb'];
820
  }
821
 
 
 
822
  // add active stored headings
823
  foreach ( $stored_columns as $column_name => $options ) {
824
 
825
  // Label needs stripslashes() for HTML tagged labels, like icons and checkboxes
826
  $label = stripslashes( $options['label'] );
827
 
 
 
 
 
 
828
  /**
829
  * Filter the stored column headers label for use in a WP_List_Table
830
  * Label needs stripslashes() for HTML tagged labels, like icons and checkboxes
@@ -845,7 +1026,7 @@ abstract class CPAC_Storage_Model {
845
  // Add 3rd party columns that have ( or could ) not been stored.
846
  // For example when a plugin has been activated after storing column settings.
847
  // When $diff contains items, it means an available column has not been stored.
848
- if ( ! $this->is_using_php_export() && ( $diff = array_diff( array_keys( $columns ), $this->get_default_stored_columns() ) ) ) {
849
  foreach ( $diff as $column_name ) {
850
  $this->column_headings[ $column_name ] = $columns[ $column_name ];
851
  }
@@ -859,34 +1040,67 @@ abstract class CPAC_Storage_Model {
859
  * @return string Link
860
  */
861
  protected function get_screen_link() {
862
-
863
  return is_network_admin() ? network_admin_url( $this->page . '.php' ) : admin_url( $this->page . '.php' );
864
  }
865
 
 
 
 
 
 
 
 
 
866
  /**
867
  * @since 2.0
868
  */
869
  public function screen_link() {
870
-
871
  if ( $link = $this->get_screen_link() ) {
872
- echo '<a href="' . $link . '" class="add-new-h2">' . __( 'View', 'codepress-admin-columns' ) . '</a>';
873
  }
874
  }
875
 
 
 
 
 
 
 
 
 
 
876
  /**
877
  * @since 2.0
878
  */
879
  public function get_edit_link() {
 
 
880
 
881
- return add_query_arg( array( 'page' => 'codepress-admin-columns', 'cpac_key' => $this->key ), admin_url( 'options-general.php' ) );
 
 
 
 
882
  }
883
 
 
 
 
 
 
 
 
 
 
 
 
884
 
885
  /**
886
  * @deprecated deprecated since version 2.4.9
887
  */
888
- public function is_columns_screen(){
889
  _deprecated_function( 'is_columns_screen', '2.4.9', 'is_current_screen' );
 
890
  return $this->is_current_screen();
891
  }
892
 
7
  */
8
  abstract class CPAC_Storage_Model {
9
 
10
+ CONST OPTIONS_KEY = 'cpac_options';
11
+
12
+ CONST LAYOUT_KEY = 'cpac_layouts';
13
+
14
  /**
15
  * @since 2.0
16
  */
66
  */
67
  public $subpage;
68
 
69
+ /**
70
+ * @since 2.5
71
+ * @var string
72
+ */
73
+ public $screen;
74
+
75
+ /**
76
+ * Active layout for presets
77
+ *
78
+ * @since 2.5
79
+ * @var string
80
+ */
81
+ public $layout;
82
+
83
  /**
84
  * Uses PHP export to display settings
85
  *
98
  * @since 2.0.1
99
  * @var array
100
  */
101
+ private $columns = array();
102
 
103
  /**
104
+ * @since 2.2
 
 
 
 
 
 
 
 
 
 
 
 
105
  * @var array
106
  */
107
+ private $column_types = array();
108
 
109
  /**
110
+ * @since 2.5
111
  * @var array
112
  */
113
+ private $stored_columns = array();
114
 
115
  /**
116
+ * @since 2.5
117
  * @var array
118
  */
119
+ private $default_stored = false;
120
 
121
  /**
122
  * @since 2.4.4
133
  * @since 2.2
134
  */
135
  function __construct() {
 
 
136
  $this->set_columns_filepath();
137
  }
138
 
139
+ /**
140
+ * Get the default column widths in percentages
141
+ *
142
+ * @since 2.5
143
+ */
144
+ protected function get_default_column_widths() {}
145
+
146
+ /**
147
+ * @since 2.5
148
+ */
149
+ public function get_grouped_columns() {
150
+ $grouped = array();
151
+ foreach ( $this->column_types as $type => $column ) {
152
+
153
+ // Labels with html will be replaced by the it's name.
154
+ $grouped[ $column->properties->group ][ $type ] = ( 0 === strlen( strip_tags( $column->properties->label ) ) ) ? ucfirst( $column->properties->name ) : ucfirst( $column->properties->label );
155
+ asort( $grouped[ $column->properties->group ] );
156
+ }
157
+
158
+ krsort( $grouped );
159
+
160
+ return apply_filters( 'cac/grouped_columns', $grouped, $this );
161
+ }
162
+
163
+ public function get_screen_id() {
164
+ return $this->screen ? $this->screen : $this->page;
165
+ }
166
+
167
+ /**
168
+ * @since 2.5
169
+ */
170
+ public function get_column_types() {
171
+
172
+ if ( empty( $this->column_types ) ) {
173
+
174
+ $column_types = array();
175
+
176
+ // Get default column that have been set on the listings screen
177
+ $default_columns = $this->get_default_stored_columns();
178
+
179
+ // As a fallback we can use the table headings. this is not reliable, because most 3rd party column will not be loaded at this point.
180
+ if ( empty( $default_columns ) ) {
181
+ $default_columns = $this->get_default_column_headings();
182
+ }
183
+
184
+ // Hook for 3rd party columns that have no other way of being initialized
185
+ $default_columns = apply_filters( 'cac/column_types/defaults', $default_columns, $this );
186
+
187
+ // Default columns
188
+ if ( $default_columns ) {
189
+
190
+ // Remove checkbox
191
+ if ( isset( $default_columns['cb'] ) ) {
192
+ unset( $default_columns['cb'] );
193
+ }
194
+
195
+ /**
196
+ * Filter the default column names
197
+ *
198
+ * @since 2.4.4
199
+ *
200
+ * @param array $default_column_names Default column names
201
+ * @param object $column Column object
202
+ * @param object $this Storage_Model object
203
+ */
204
+ $default_column_names = apply_filters( 'cac/default_column_names', $this->get_default_column_names(), $this );
205
+ $default_column_widths = apply_filters( 'cac/default_column_widths', $this->get_default_column_widths(), $this );
206
+
207
+ foreach ( $default_columns as $name => $label ) {
208
+ $column = $this->create_column_instance( $name, $label );
209
+
210
+ // If it's not a default column it probably is set by a plugin
211
+ if ( $default_column_names && ! in_array( $name, $default_column_names ) ) {
212
+ $column->set_properties( 'group', __( 'Columns by Plugins', 'codepress-admin-columns' ) );
213
+ }
214
+
215
+ // Set the default percentage
216
+ if ( $default_column_widths && isset( $default_column_widths[ $name ] ) ) {
217
+ $column->set_options( 'width', $default_column_widths[ $name ]['width'] );
218
+
219
+ if ( isset( $default_column_widths[ $name ]['unit'] ) ) {
220
+ $column->set_options( 'width_unit', $default_column_widths[ $name ]['unit'] );
221
+ }
222
+ }
223
+
224
+ $column_types[ $name ] = $column;
225
+ }
226
+ }
227
+
228
+ // Custom columns
229
+ foreach ( $this->columns_filepath as $classname => $path ) {
230
+ include_once $path;
231
+ if ( class_exists( $classname, false ) ) {
232
+ $column = new $classname( $this->key );
233
+ if ( $column->is_registered() ) {
234
+ $column_types[ $column->get_type() ] = $column;
235
+ }
236
+ }
237
+ }
238
+
239
+ $this->column_types = $column_types;
240
+
241
+ // @since 2.5
242
+ do_action( "cac/column_types", $this->column_types, $this );
243
+ do_action( "cac/column_types/storage_key={$this->key}", $this->column_types, $this );
244
+ }
245
+
246
+ return $this->column_types;
247
+ }
248
+
249
+ /**
250
+ * @since 2.5
251
+ */
252
+ private function get_default_colummn_types() {
253
+ $defaults = array();
254
+ $default_columns = $this->get_default_stored_columns();
255
+
256
+ foreach ( $this->get_column_types() as $type => $column ) {
257
+ if ( $column->is_default() || ( $default_columns && in_array( $type, array_keys( $default_columns ) ) ) ) {
258
+ $defaults[ $type ] = $column;
259
+ }
260
+ }
261
+
262
+ return $defaults;
263
+ }
264
+
265
+ /**
266
+ * @since 2.5
267
+ */
268
+ public function get_column_type( $type ) {
269
+ $column_types = $this->get_column_types();
270
+
271
+ return isset( $column_types[ $type ] ) ? $column_types[ $type ] : false;
272
+ }
273
+
274
+ /**
275
+ * @since 2.5
276
+ */
277
+ public function create_column( $options ) {
278
+ $column_types = $this->get_column_types();
279
+
280
+ if ( ! isset( $options['type'] ) || ! isset( $column_types[ $options['type'] ] ) ) {
281
+ return false;
282
+ }
283
+
284
+ $column = clone $column_types[ $options['type'] ];
285
+
286
+ if ( isset( $options['clone'] ) ) {
287
+ $column->set_clone( $options['clone'] );
288
+ }
289
+
290
+ // merge default options with stored
291
+ $column->options = (object) array_merge( (array) $column->options, $options );
292
+
293
+ $column->sanitize_label();
294
+
295
+ return $column;
296
+ }
297
+
298
+ /**
299
+ * Clears columns variable, which allow it to be repopulated by get_columns().
300
+ *
301
+ * @since 2.5
302
+ */
303
+ public function flush_columns() {
304
+ $this->stored_columns = array();
305
+ $this->columns = array();
306
+ }
307
+
308
+ /**
309
+ * @since 2.5
310
+ */
311
+ public function get_columns() {
312
+
313
+ if ( empty( $this->columns ) ) {
314
+
315
+ // Stored columns
316
+ if ( $stored = $this->get_stored_columns() ) {
317
+ foreach ( $stored as $name => $options ) {
318
+ if ( $column = $this->create_column( $options ) ) {
319
+ $this->columns[ $name ] = $column;
320
+ }
321
+ }
322
+ }
323
+
324
+ // Nothing stored
325
+ else {
326
+ $this->columns = $this->get_default_colummn_types();
327
+ }
328
+
329
+ do_action( "cac/columns", $this->columns, $this );
330
+ do_action( "cac/columns/storage_key={$this->key}", $this->columns, $this );
331
+ }
332
+
333
+ return $this->columns;
334
+ }
335
+
336
  /**
337
  * initialize callback for managing the headers and values for columns
338
  * @since 2.4.10
339
  *
340
  */
341
+ public function init_manage_columns() {
342
+ }
343
 
344
  /**
345
  * @since 2.0.3
347
  */
348
  public function is_current_screen() {
349
  global $pagenow;
350
+
351
  return $this->page . '.php' === $pagenow && $this->subpage == filter_input( INPUT_GET, 'page' );
352
  }
353
 
362
  return $this;
363
  }
364
 
365
+ /**
366
+ * @since 2.5
367
+ */
368
+ public function get_menu_type() {
369
+ return empty( $this->menu_type ) || 'other' === $this->menu_type ? __( 'Other', 'codepress-admin-columns' ) : $this->menu_type;
370
+ }
371
+
372
+ public function get_truncated_side_label( $main_label = '' ) {
373
+ $sidelabel = $this->label;
374
+ if ( 34 < ( strlen( $this->label ) + ( strlen( $main_label ) * 1.1 ) ) ) {
375
+ $sidelabel = substr( $this->label, 0, 34 - ( strlen( $main_label ) * 1.1 ) ) . '...';
376
+ }
377
+
378
+ return $sidelabel;
379
+ }
380
+
381
  /**
382
  * Checks if menu type is currently viewed
383
  *
428
  * @return array
429
  */
430
  public function get_meta_keys() {
 
431
  if ( $cache = wp_cache_get( $this->key, 'cac_columns' ) ) {
432
  $keys = $cache;
433
+ }
434
+ else {
435
  $keys = $this->get_meta();
436
  wp_cache_add( $this->key, $keys, 'cac_columns', 10 ); // 10 sec.
437
  }
438
 
439
  if ( is_wp_error( $keys ) || empty( $keys ) ) {
440
  $keys = false;
441
+ }
442
+ else {
443
  $keys = $this->format_meta_keys( $keys );
444
  }
445
 
497
  }
498
 
499
  /**
500
+ * Layouts
501
+ *
502
+ * @since 2.5
503
  */
504
+ public function get_layout() {
505
+ return $this->layout;
506
+ }
507
+
508
+ public function get_layout_object() {
509
+ return $this->get_layout_by_id( $this->layout );
510
+ }
511
 
512
+ public function get_layout_name() {
513
+ $object = $this->get_layout_by_id( $this->layout );
514
 
515
+ return isset( $object->name ) ? $object->name : false;
516
+ }
517
+
518
+ public function set_layout( $layout_id ) {
519
+ $this->layout = $layout_id;
520
+ $this->flush_columns(); // forces $this->columns to be repopulated
521
+ }
522
+
523
+ public function init_layout() {
524
+ if ( $this->get_layout() ) {
525
+ return;
526
+ }
527
+
528
+ // try user preference..
529
+ $layout_id = $this->get_user_layout_preference();
530
+
531
+ // ..when not found use the first one
532
+ if ( ! $this->layout_exists( $layout_id ) ) {
533
+ $layout_id = $this->get_single_layout_id();
534
+ }
535
+
536
+ $this->set_layout( $layout_id );
537
+ }
538
+
539
+ public function set_single_layout_id() {
540
+ $this->set_layout( $this->get_single_layout_id() );
541
+ }
542
+
543
+ public function layout_exists( $id ) {
544
+ return $this->get_layout_by_id( $id ) ? true : false;
545
+ }
546
+
547
+ public function get_single_layout_id() {
548
+ $layouts = array_values( (array) $this->get_layouts() );
549
+
550
+ return isset( $layouts[0]->id ) ? $layouts[0]->id : null;
551
+ }
552
+
553
+ public function get_layouts() {
554
+ global $wpdb;
555
+ $layouts = array();
556
+ if ( $results = $wpdb->get_col( $wpdb->prepare( "SELECT option_value FROM {$wpdb->options} WHERE option_name LIKE %s ORDER BY option_id DESC", $this->get_layout_key() . '%' ) ) ) {
557
+ foreach ( $results as $result ) {
558
+ $layout = (object) maybe_unserialize( $result );
559
+ $layouts[ $layout->id ] = $layout;
560
+ }
561
+ }
562
+
563
+ if ( empty( $layouts ) ) {
564
+ $layouts = array();
565
+ }
566
+
567
+ return apply_filters( 'ac/layouts', $layouts, $this );
568
+ }
569
+
570
+ public function get_layout_by_id( $id ) {
571
+ $layouts = $this->get_layouts();
572
+
573
+ return isset( $layouts[ $id ] ) ? $layouts[ $id ] : false;
574
+ }
575
+
576
+ public function get_delete_layout_link( $layout_id ) {
577
+ return add_query_arg( array( 'layout_id' => $layout_id, 'cpac_action' => 'delete_layout', '_cpac_nonce' => wp_create_nonce( 'delete-layout' ) ), $this->settings_url() );
578
+ }
579
+
580
+ private function get_layout_key( $layout_id = '' ) {
581
+ return self::LAYOUT_KEY . $this->key . $layout_id;
582
+ }
583
+
584
+ public function set_user_layout_preference() {
585
+ update_user_meta( get_current_user_id(), $this->get_layout_key(), $this->layout );
586
+ }
587
+
588
+ public function get_user_layout_preference() {
589
+ $id = get_user_meta( get_current_user_id(), $this->get_layout_key(), true );
590
+
591
+ return $this->layout_exists( $id ) ? $id : false;
592
+ }
593
+
594
+ public function get_layouts_for_current_user() {
595
+ $user_layouts = array();
596
+
597
+ $current_user = get_current_user_id();
598
+ $layouts = $this->get_layouts();
599
+ foreach ( $layouts as $k => $layout ) {
600
+
601
+ // Roles
602
+ if ( ! empty( $layout->roles ) ) {
603
+ foreach ( $layout->roles as $role ) {
604
+ if ( current_user_can( $role ) ) {
605
+ $user_layouts[ $k ] = $layout;
606
+ }
607
+ }
608
+ }
609
+
610
+ // Users
611
+ if ( ! empty( $layout->users ) ) {
612
+ foreach ( $layout->users as $user ) {
613
+ if ( $current_user == $user ) {
614
+ $user_layouts[ $k ] = $layout;
615
+ }
616
+ }
617
+ }
618
+
619
+ // Both
620
+ if ( empty( $layout->roles ) && empty( $layout->users ) ) {
621
+ $user_layouts[ $k ] = $layout;
622
+ }
623
+ }
624
+
625
+ return $user_layouts;
626
+ }
627
+
628
+ public function get_default_layout_args( $args = array() ) {
629
+ $default = array(
630
+ 'id' => null,
631
+ 'name' => __( 'Default' ),
632
+ 'roles' => '',
633
+ 'users' => '',
634
+ );
635
+ return array_merge( $default, $args );
636
+ }
637
+
638
+ public function save_layout( $id, $args ) {
639
+
640
+ if ( empty( $args['name'] ) ) {
641
+ return new WP_Error( 'empty-name' );
642
+ }
643
+
644
+ update_option( $this->get_layout_key( $id ), (object) array(
645
+ 'id' => $id ? $id : null,
646
+ 'name' => trim( $args['name'] ),
647
+ 'roles' => isset( $args['roles'] ) ? $args['roles'] : '',
648
+ 'users' => isset( $args['users'] ) ? $args['users'] : '',
649
+ ) );
650
+
651
+ return $this->get_layout_by_id( $id );
652
+ }
653
+
654
+ public function create_layout( $args, $is_default = false ) {
655
+
656
+ // The default layout has an empty ID, that way it stays compatible when layouts is disabled.
657
+ $id = $is_default ? null : uniqid();
658
+ $this->save_layout( $id, $args );
659
+
660
+ return $id;
661
+ }
662
+
663
+ public function delete_layout( $id ) {
664
+ return delete_option( $this->get_layout_key( $id ) );
665
+ }
666
+
667
+ /**
668
+ * Get store ID
669
+ * @since 2.5
670
+ */
671
+ private function get_storage_id() {
672
+ $layout = $this->layout ? $this->layout : null;
673
+
674
+ return self::OPTIONS_KEY . '_' . $this->key . $layout;
675
  }
676
 
677
  /**
678
  * @since 2.0
679
  */
680
+ public function restore() {
681
+ return delete_option( $this->get_storage_id() );
682
+ }
683
 
684
+ /**
685
+ * @since 2.5
686
+ */
687
+ public function get_label_or_layout_name() {
688
+ $label = $this->label;
689
+
690
+ if ( $name = $this->get_layout_name() ) {
691
+ $label = $name;
692
  }
693
 
694
+ return $label;
695
+ }
696
 
697
+ /**
698
+ * @since 2.0
699
+ *
700
+ * @param array $columns
701
+ * @param array $default_columns Default columns heading names.
702
+ */
703
+ public function store( $columns ) {
704
+
705
+ if ( ! $columns ) {
706
+ return new WP_Error( 'no-settings', __( 'No columns settings available.', 'codepress-admin-columns' ) );
707
  }
708
 
709
  // sanitize user inputs
718
  }
719
 
720
  // store columns
721
+ $result = update_option( $this->get_storage_id(), $columns );
 
722
 
723
+ // reset object
724
+ $this->flush_columns();
 
725
 
726
+ if ( ! $result ) {
727
+ return new WP_Error( 'same-settings', sprintf( __( 'You are trying to store the same settings for %s.', 'codepress-admin-columns' ), "<strong>" . $this->get_label_or_layout_name() . "</strong>" ) );
728
  }
729
 
 
 
730
  /**
731
  * Fires after a new column setup is stored in the database
732
  * Primarily used when columns are saved through the Admin Columns settings screen
741
  return true;
742
  }
743
 
744
+ /**
745
+ * @since 2.5
746
+ */
747
+ public function get_default_column_headings() {
748
+ $default_columns = apply_filters( "cac/default_columns", $this->get_default_columns(), $this );
749
+ $default_columns = apply_filters( "cac/default_columns/type=" . $this->type, $default_columns, $this );
750
+ $default_columns = apply_filters( "cac/default_columns/storage_key=" . $this->key, $default_columns, $this );
751
+
752
+ return $default_columns;
753
+ }
754
+
755
  /**
756
  * Goes through all files in 'classes/column' and includes each file.
757
  *
760
  */
761
  public function set_columns_filepath() {
762
 
763
+ require_once CPAC_DIR . 'classes/column.php';
764
+ require_once CPAC_DIR . 'classes/column/default.php';
765
+ require_once CPAC_DIR . 'classes/column/actions.php';
766
+
767
  $columns = array(
768
  'CPAC_Column_Custom_Field' => CPAC_DIR . 'classes/column/custom-field.php',
769
  'CPAC_Column_Taxonomy' => CPAC_DIR . 'classes/column/taxonomy.php',
847
  */
848
  public function create_column_instance( $column_name, $label ) {
849
 
850
+ $column = new CPAC_Column( $this->key );
 
851
 
852
  $column
853
  ->set_properties( 'type', $column_name )
855
  ->set_properties( 'label', $label )
856
  ->set_properties( 'is_cloneable', false )
857
  ->set_properties( 'default', true )
858
+ ->set_properties( 'group', __( 'Default', 'codepress-admin-columns' ) )
859
  ->set_options( 'label', $label )
860
  ->set_options( 'state', 'on' );
861
 
869
  $column->set_properties( 'label', ucfirst( $column_name ) );
870
  }
871
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
872
  return $column;
873
  }
874
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
875
  /**
876
  * @since 1.0
877
  *
880
  * @return array Column options
881
  */
882
  public function get_default_stored_columns() {
883
+ return get_option( $this->get_storage_key() . "__default", array() );
884
+ }
885
 
886
+ private function delete_default_stored_columns() {
887
+ delete_option( $this->get_storage_key() . "__default" );
888
+ }
889
+
890
+ private function store_default_columns( $columns ) {
891
+ return update_option( $this->get_storage_key() . "__default", $columns );
892
+ }
893
 
894
+ private function get_storage_key() {
895
+ return self::OPTIONS_KEY . '_' . $this->key;
896
  }
897
 
898
  /**
900
  * @return array Column options
901
  */
902
  public function get_stored_columns() {
903
+ if ( empty( $this->stored_columns ) ) {
904
 
905
+ $columns = apply_filters( 'cpac/storage_model/stored_columns', $this->get_database_columns(), $this );
906
+ $columns = apply_filters( 'cpac/storage_model/stored_columns/storage_key=' . $this->key, $columns, $this );
 
 
 
 
 
 
 
907
 
908
+ $this->stored_columns = ! empty( $columns ) ? $columns : array();
 
909
  }
910
 
911
+ return $this->stored_columns;
912
  }
913
 
914
  public function get_database_columns() {
915
+ return get_option( $this->get_storage_id() );
 
 
 
 
 
 
 
 
 
916
  }
917
 
918
  /**
952
  return $this->meta_type;
953
  }
954
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
955
  /**
956
  * @since 2.0
957
  */
958
  public function get_column_by_name( $name ) {
959
+ $columns = $this->get_columns();
960
+
961
+ return isset( $columns[ $name ] ) ? $columns[ $name ] : false;
962
  }
963
 
964
  /**
966
  */
967
  public function add_headings( $columns ) {
968
 
969
+ // in case a 3rd party plugin removes all columns we can skip this
970
+ if ( empty( $columns ) ) {
971
+ return $columns;
972
+ }
973
+
974
  // make sure we run this only once
975
  if ( $this->column_headings ) {
976
  return $this->column_headings;
977
  }
978
 
979
+ // Stores the default columns on the listings screen
980
+ if ( ! $this->default_stored && $this->is_current_screen() ) {
981
+ $this->store_default_columns( $columns );
982
+ $this->default_stored = true;
983
  }
984
 
985
  if ( ! ( $stored_columns = $this->get_stored_columns() ) ) {
993
  $this->column_headings['cb'] = $columns['cb'];
994
  }
995
 
996
+ $types = array_keys( $this->get_column_types() );
997
+
998
  // add active stored headings
999
  foreach ( $stored_columns as $column_name => $options ) {
1000
 
1001
  // Label needs stripslashes() for HTML tagged labels, like icons and checkboxes
1002
  $label = stripslashes( $options['label'] );
1003
 
1004
+ // Remove 3rd party columns that are no longer available (deactivated or removed from code)
1005
+ if ( ! in_array( $options['type'], $types ) ) {
1006
+ continue;
1007
+ }
1008
+
1009
  /**
1010
  * Filter the stored column headers label for use in a WP_List_Table
1011
  * Label needs stripslashes() for HTML tagged labels, like icons and checkboxes
1026
  // Add 3rd party columns that have ( or could ) not been stored.
1027
  // For example when a plugin has been activated after storing column settings.
1028
  // When $diff contains items, it means an available column has not been stored.
1029
+ if ( ! $this->is_using_php_export() && ( $diff = array_diff( array_keys( $columns ), array_keys( $this->get_default_stored_columns() ) ) ) ) {
1030
  foreach ( $diff as $column_name ) {
1031
  $this->column_headings[ $column_name ] = $columns[ $column_name ];
1032
  }
1040
  * @return string Link
1041
  */
1042
  protected function get_screen_link() {
 
1043
  return is_network_admin() ? network_admin_url( $this->page . '.php' ) : admin_url( $this->page . '.php' );
1044
  }
1045
 
1046
+ /**
1047
+ * New public function to get screen link instead of making get_screen_link public. To prevent errors in other plugins
1048
+ * @since 2.5
1049
+ */
1050
+ public function get_link() {
1051
+ return $this->get_screen_link();
1052
+ }
1053
+
1054
  /**
1055
  * @since 2.0
1056
  */
1057
  public function screen_link() {
 
1058
  if ( $link = $this->get_screen_link() ) {
1059
+ echo '<a href="' . $link . '" class="page-title-action view-link">' . __( 'View', 'codepress-admin-columns' ) . '</a>';
1060
  }
1061
  }
1062
 
1063
+ public function settings_url() {
1064
+ $args = array(
1065
+ 'page' => 'codepress-admin-columns',
1066
+ 'cpac_key' => $this->key,
1067
+ );
1068
+
1069
+ return add_query_arg( $args, admin_url( 'options-general.php' ) );
1070
+ }
1071
+
1072
  /**
1073
  * @since 2.0
1074
  */
1075
  public function get_edit_link() {
1076
+ return add_query_arg( array( 'layout_id' => $this->layout ? $this->layout : '' ), $this->settings_url() );
1077
+ }
1078
 
1079
+ /**
1080
+ * @since 2.5
1081
+ */
1082
+ public function get_edit_link_by_layout( $layout_id ) {
1083
+ return add_query_arg( array( 'layout_id' => $layout_id ? $layout_id : '' ), $this->settings_url() );
1084
  }
1085
 
1086
+ /**
1087
+ * @since 2.0
1088
+ */
1089
+ public function get_restore_link() {
1090
+ $args = array(
1091
+ '_cpac_nonce' => wp_create_nonce( 'restore-type' ),
1092
+ 'cpac_action' => 'restore_by_type'
1093
+ );
1094
+
1095
+ return add_query_arg( $args, $this->settings_url() );
1096
+ }
1097
 
1098
  /**
1099
  * @deprecated deprecated since version 2.4.9
1100
  */
1101
+ public function is_columns_screen() {
1102
  _deprecated_function( 'is_columns_screen', '2.4.9', 'is_current_screen' );
1103
+
1104
  return $this->is_current_screen();
1105
  }
1106
 
classes/storage_model/comment.php CHANGED
@@ -13,7 +13,6 @@ class CPAC_Storage_Model_Comment extends CPAC_Storage_Model {
13
  $this->type = 'comment';
14
  $this->meta_type = 'comment';
15
  $this->page = 'edit-comments';
16
- $this->menu_type = 'other';
17
 
18
  parent::__construct();
19
  }
@@ -28,7 +27,16 @@ class CPAC_Storage_Model_Comment extends CPAC_Storage_Model {
28
  }
29
 
30
  public function get_default_column_names() {
31
- return array( 'cb', 'author', 'comment', 'response' );
 
 
 
 
 
 
 
 
 
32
  }
33
 
34
  public function get_default_columns() {
13
  $this->type = 'comment';
14
  $this->meta_type = 'comment';
15
  $this->page = 'edit-comments';
 
16
 
17
  parent::__construct();
18
  }
27
  }
28
 
29
  public function get_default_column_names() {
30
+ return array( 'cb', 'author', 'comment', 'response', 'date' );
31
+ }
32
+
33
+ protected function get_default_column_widths() {
34
+ return array(
35
+ 'author' => array( 'width' => 20 ),
36
+ 'response' => array( 'width' => 15 ),
37
+ 'date' => array( 'width' => 14 ),
38
+
39
+ );
40
  }
41
 
42
  public function get_default_columns() {
classes/storage_model/link.php CHANGED
@@ -4,12 +4,11 @@ class CPAC_Storage_Model_Link extends CPAC_Storage_Model {
4
 
5
  function __construct() {
6
 
7
- $this->key = 'wp-links';
8
- $this->label = __( 'Links' );
9
  $this->singular_label = __( 'Link' );
10
- $this->type = 'link';
11
- $this->page = 'link-manager';
12
- $this->menu_type = 'other';
13
 
14
  parent::__construct();
15
  }
@@ -34,7 +33,7 @@ class CPAC_Storage_Model_Link extends CPAC_Storage_Model {
34
  do_action( "cac/columns/default/storage_key={$this->key}" );
35
 
36
  // get columns
37
- $table = _get_list_table( 'WP_Links_List_Table', array( 'screen' => 'link-manager' ) );
38
  $columns = (array) $table->get_columns();
39
 
40
  return $columns;
@@ -44,7 +43,8 @@ class CPAC_Storage_Model_Link extends CPAC_Storage_Model {
44
  return array();
45
  }
46
 
47
- public function get_meta() {}
 
48
 
49
  public function manage_value( $column_name, $link_id ) {
50
 
@@ -60,5 +60,4 @@ class CPAC_Storage_Model_Link extends CPAC_Storage_Model {
60
 
61
  echo $value;
62
  }
63
-
64
  }
4
 
5
  function __construct() {
6
 
7
+ $this->key = 'wp-links';
8
+ $this->label = __( 'Links' );
9
  $this->singular_label = __( 'Link' );
10
+ $this->type = 'link';
11
+ $this->page = 'link-manager';
 
12
 
13
  parent::__construct();
14
  }
33
  do_action( "cac/columns/default/storage_key={$this->key}" );
34
 
35
  // get columns
36
+ $table = _get_list_table( 'WP_Links_List_Table', array( 'screen' => 'link-manager' ) );
37
  $columns = (array) $table->get_columns();
38
 
39
  return $columns;
43
  return array();
44
  }
45
 
46
+ public function get_meta() {
47
+ }
48
 
49
  public function manage_value( $column_name, $link_id ) {
50
 
60
 
61
  echo $value;
62
  }
 
63
  }
classes/storage_model/media.php CHANGED
@@ -4,14 +4,13 @@ class CPAC_Storage_Model_Media extends CPAC_Storage_Model {
4
 
5
  public function __construct() {
6
 
7
- $this->key = 'wp-media';
8
- $this->label = __( 'Media Library' );
9
  $this->singular_label = __( 'Media' );
10
- $this->type = 'media';
11
- $this->meta_type = 'post';
12
- $this->page = 'upload';
13
- $this->post_type = 'attachment';
14
- $this->menu_type = 'other';
15
 
16
  parent::__construct();
17
  }
@@ -34,7 +33,7 @@ class CPAC_Storage_Model_Media extends CPAC_Storage_Model {
34
  // See classes/third_party.php for an example.
35
  do_action( "cac/columns/default/storage_key={$this->key}" );
36
 
37
- $table = _get_list_table( 'WP_Media_List_Table', array( 'screen' => 'upload' ) );
38
  $columns = (array) $table->get_columns();
39
 
40
  if ( cac_is_setting_screen() ) {
@@ -44,8 +43,30 @@ class CPAC_Storage_Model_Media extends CPAC_Storage_Model {
44
  return $columns;
45
  }
46
 
 
 
 
47
  public function get_default_column_names() {
48
- return array( 'cb', 'date', 'parent', 'icon', 'title', 'author', 'comments' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
 
51
  public function get_meta() {
4
 
5
  public function __construct() {
6
 
7
+ $this->key = 'wp-media';
8
+ $this->label = __( 'Media Library' );
9
  $this->singular_label = __( 'Media' );
10
+ $this->type = 'media';
11
+ $this->meta_type = 'post';
12
+ $this->page = 'upload';
13
+ $this->post_type = 'attachment';
 
14
 
15
  parent::__construct();
16
  }
33
  // See classes/third_party.php for an example.
34
  do_action( "cac/columns/default/storage_key={$this->key}" );
35
 
36
+ $table = _get_list_table( 'WP_Media_List_Table', array( 'screen' => 'upload' ) );
37
  $columns = (array) $table->get_columns();
38
 
39
  if ( cac_is_setting_screen() ) {
43
  return $columns;
44
  }
45
 
46
+ /**
47
+ * @since 2.5
48
+ */
49
  public function get_default_column_names() {
50
+ return array(
51
+ 'cb',
52
+ 'date',
53
+ 'parent',
54
+ 'icon',
55
+ 'title',
56
+ 'author',
57
+ 'comments'
58
+ );
59
+ }
60
+
61
+ /**
62
+ * @since 2.5
63
+ */
64
+ protected function get_default_column_widths() {
65
+ return array(
66
+ 'author' => array( 'width' => 10 ),
67
+ 'parent' => array( 'width' => 15 ),
68
+ 'date' => array( 'width' => 10 ),
69
+ );
70
  }
71
 
72
  public function get_meta() {
classes/storage_model/post.php CHANGED
@@ -14,7 +14,8 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
14
  $this->type = 'post';
15
  $this->meta_type = 'post';
16
  $this->page = 'edit';
17
- $this->menu_type = 'post';
 
18
 
19
  $this->set_labels();
20
 
@@ -131,7 +132,6 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
131
  $defaults[] = 'cb';
132
  $defaults[] = 'author';
133
  $defaults[] = 'categories';
134
- $defaults[] = 'comments';
135
  $defaults[] = 'parent';
136
  $defaults[] = 'tags';
137
  }
@@ -139,6 +139,18 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
139
  return $defaults;
140
  }
141
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  /**
143
  * @since 2.0
144
  */
14
  $this->type = 'post';
15
  $this->meta_type = 'post';
16
  $this->page = 'edit';
17
+ $this->screen = $this->page . '-' . $this->post_type;
18
+ $this->menu_type = __( 'Post Type', 'codepress-admin-columns' );
19
 
20
  $this->set_labels();
21
 
132
  $defaults[] = 'cb';
133
  $defaults[] = 'author';
134
  $defaults[] = 'categories';
 
135
  $defaults[] = 'parent';
136
  $defaults[] = 'tags';
137
  }
139
  return $defaults;
140
  }
141
 
142
+ /**
143
+ * @since 2.5
144
+ */
145
+ public function get_default_column_widths() {
146
+ return array(
147
+ 'author' => array( 'width' => 10 ),
148
+ 'categories' => array( 'width' => 15 ),
149
+ 'tags' => array( 'width' => 15 ),
150
+ 'date' => array( 'width' => 10 ),
151
+ );
152
+ }
153
+
154
  /**
155
  * @since 2.0
156
  */
classes/storage_model/user.php CHANGED
@@ -13,7 +13,6 @@ class CPAC_Storage_Model_User extends CPAC_Storage_Model {
13
  $this->type = 'user';
14
  $this->meta_type = 'user';
15
  $this->page = 'users';
16
- $this->menu_type = 'other';
17
 
18
  parent::__construct();
19
  }
@@ -79,6 +78,16 @@ class CPAC_Storage_Model_User extends CPAC_Storage_Model {
79
  return array( 'cb', 'username', 'name', 'email', 'role', 'posts' );
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
82
  /**
83
  * @since 2.0.2
84
  */
13
  $this->type = 'user';
14
  $this->meta_type = 'user';
15
  $this->page = 'users';
 
16
 
17
  parent::__construct();
18
  }
78
  return array( 'cb', 'username', 'name', 'email', 'role', 'posts' );
79
  }
80
 
81
+ /**
82
+ * @since 2.5
83
+ */
84
+ protected function get_default_column_widths() {
85
+ return array(
86
+ 'role' => array( 'width' => 15 ),
87
+ 'posts' => array( 'width' => 74, 'unit' => 'px' ),
88
+ );
89
+ }
90
+
91
  /**
92
  * @since 2.0.2
93
  */
classes/third_party.php CHANGED
@@ -1,8 +1,5 @@
1
  <?php
2
- require_once CPAC_DIR . 'classes/third_party/all-in-seo.php';
3
  require_once CPAC_DIR . 'classes/third_party/acf.php';
4
- require_once CPAC_DIR . 'classes/third_party/bbpress.php';
5
  require_once CPAC_DIR . 'classes/third_party/ninja_forms.php';
6
  require_once CPAC_DIR . 'classes/third_party/woocommerce.php';
7
- require_once CPAC_DIR . 'classes/third_party/wpml.php';
8
- require_once CPAC_DIR . 'classes/third_party/yoast_seo.php';
1
  <?php
 
2
  require_once CPAC_DIR . 'classes/third_party/acf.php';
 
3
  require_once CPAC_DIR . 'classes/third_party/ninja_forms.php';
4
  require_once CPAC_DIR . 'classes/third_party/woocommerce.php';
5
+ require_once CPAC_DIR . 'classes/third_party/wpml.php';
 
classes/third_party/all-in-seo.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Add support for All in SEO columns
5
- *
6
- * @since 2.0
7
- */
8
- function cpac_load_aioseop_addmycolumns() {
9
- if ( function_exists('aioseop_addmycolumns') ) {
10
- aioseop_addmycolumns();
11
- }
12
- }
13
- add_action( 'cac/columns/default/posts', 'cpac_load_aioseop_addmycolumns' );
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/third_party/bbpress.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * bbPress - remove posttypes: forum, reply and topic
5
- *
6
- * The default columns of bbPress are not recognised by Admin Columns as of yet.
7
- *
8
- * @since 2.0
9
- *
10
- * @return array Posttypes
11
- */
12
- function cpac_posttypes_remove_bbpress( $post_types ) {
13
- if ( class_exists( 'bbPress', false ) ) {
14
- unset( $post_types['topic'] );
15
- unset( $post_types['reply'] );
16
- unset( $post_types['forum'] );
17
- }
18
-
19
- return $post_types;
20
- }
21
- add_filter( 'cac/post_types', 'cpac_posttypes_remove_bbpress' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/third_party/wpml.php CHANGED
@@ -13,16 +13,20 @@ class CPAC_WPML_COLUMN {
13
  add_filter( "manage_{$post_type}_posts_columns", array( $this, 'store_wpml_column' ), 11 ); // prio just after WPML set's it's column
14
  add_filter( "manage_edit-{$post_type}_columns", array( $this, 'replace_wpml_column' ), 101 ); // prio just after AC overwrite all columns
15
  }
 
16
  public function store_wpml_column( $columns ) {
17
  if ( empty( $this->column ) && isset( $columns[ self::COLUMN_NAME ] ) ) {
18
  $this->column = $columns[ self::COLUMN_NAME ];
19
  }
 
20
  return $columns;
21
  }
 
22
  public function replace_wpml_column( $columns ) {
23
  if ( $this->column && isset( $columns[ self::COLUMN_NAME ] ) ) {
24
  $columns[ self::COLUMN_NAME ] = $this->column;
25
  }
 
26
  return $columns;
27
  }
28
  }
@@ -34,9 +38,6 @@ class CPAC_WPML {
34
 
35
  function __construct() {
36
 
37
- // load wpml columns in AC columns menu
38
- add_action( 'cac/set_columns', array( $this, 'add_columns_to_settings_menu' ) );
39
-
40
  // display correct flags on the overview screens
41
  add_action( 'cac/loaded', array( $this, 'replace_flags' ) );
42
 
@@ -48,6 +49,17 @@ class CPAC_WPML {
48
 
49
  // set WPML to be a columns screen for translation so that storage models are loaded
50
  add_filter( 'cac/is_cac_screen', array( $this, 'is_cac_screen' ) );
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
 
53
  public function replace_flags( $cac ) {
@@ -65,47 +77,22 @@ class CPAC_WPML {
65
  $post_types = (array) $settings['custom_posts_sync_option'];
66
  $post_types['post'] = 1;
67
  $post_types['page'] = 1;
68
- foreach ( $post_types as $post_type => $value ) {
69
  if ( $value ) {
70
  new CPAC_WPML_COLUMN( $post_type );
71
  }
72
  }
73
  }
74
 
75
- public function add_columns_to_settings_menu( $storage_model ) {
76
- if ( ! class_exists( 'SitePress', false ) ) {
77
- return;
78
- }
79
- if ( 'post' !== $storage_model->type ) {
80
- return;
81
- }
82
-
83
- global $pagenow, $cpac;
84
-
85
- // check if we are on the correct page or when a column is being refreshed by ajax.
86
- if ( ( 'options-general.php' !== $pagenow ) && ( empty( $_POST['action'] ) || 'cpac_column_refresh' !== $_POST['action'] ) ) {
87
- return;
88
- }
89
-
90
- // prevent PHP errors from SitePress
91
- global $sitepress, $posts;
92
- $posts = get_posts( array(
93
- 'post_type' => $storage_model->post_type,
94
- 'posts_per_page' => 1
95
- ));
96
-
97
- add_filter( 'manage_' . $storage_model->post_type . 's_columns', array( $sitepress, 'add_posts_management_column' ) );
98
- }
99
-
100
  public function register_column_labels() {
101
- global $cpac;
102
 
103
  // dont load this unless required by WPML
104
  if ( ! isset( $_GET['page'] ) || 'wpml-string-translation/menu/string-translation.php' !== $_GET['page'] ) {
105
  return;
106
  }
107
 
108
- foreach ( $cpac->storage_models as $storage_model ) {
109
  foreach ( $storage_model->get_stored_columns() as $column_name => $options ) {
110
  icl_register_string( 'Admin Columns', $storage_model->key . '_' . $column_name, stripslashes( $options['label'] ) );
111
  }
@@ -113,20 +100,21 @@ class CPAC_WPML {
113
  }
114
 
115
  public function register_translated_label( $label, $column_name, $column_options, $storage_model ) {
116
-
117
  if ( function_exists( 'icl_t' ) ) {
118
- $name = $storage_model->key . '_' . $column_name;
119
- $label = icl_t( 'Admin Columns', $name, $label );
120
  }
 
121
  return $label;
122
  }
123
 
124
  public function is_cac_screen( $is_columns_screen ) {
125
-
126
  if ( isset( $_GET['page'] ) && 'wpml-string-translation/menu/string-translation.php' == $_GET['page'] ) {
127
  return true;
128
  }
 
129
  return $is_columns_screen;
130
  }
131
  }
 
132
  new CPAC_WPML;
13
  add_filter( "manage_{$post_type}_posts_columns", array( $this, 'store_wpml_column' ), 11 ); // prio just after WPML set's it's column
14
  add_filter( "manage_edit-{$post_type}_columns", array( $this, 'replace_wpml_column' ), 101 ); // prio just after AC overwrite all columns
15
  }
16
+
17
  public function store_wpml_column( $columns ) {
18
  if ( empty( $this->column ) && isset( $columns[ self::COLUMN_NAME ] ) ) {
19
  $this->column = $columns[ self::COLUMN_NAME ];
20
  }
21
+
22
  return $columns;
23
  }
24
+
25
  public function replace_wpml_column( $columns ) {
26
  if ( $this->column && isset( $columns[ self::COLUMN_NAME ] ) ) {
27
  $columns[ self::COLUMN_NAME ] = $this->column;
28
  }
29
+
30
  return $columns;
31
  }
32
  }
38
 
39
  function __construct() {
40
 
 
 
 
41
  // display correct flags on the overview screens
42
  add_action( 'cac/loaded', array( $this, 'replace_flags' ) );
43
 
49
 
50
  // set WPML to be a columns screen for translation so that storage models are loaded
51
  add_filter( 'cac/is_cac_screen', array( $this, 'is_cac_screen' ) );
52
+
53
+ // change label from icl_translations to WPML flags
54
+ add_action( 'cac/column_types', array( $this, 'readable_label' ) );
55
+ }
56
+
57
+ public function readable_label( $column_types ) {
58
+ if ( isset( $column_types['icl_translations'] ) ) {
59
+ $column_types['icl_translations']->properties->name = __( 'WPML Flags', 'codepress-admin-columns' );
60
+ }
61
+
62
+ return $column_types;
63
  }
64
 
65
  public function replace_flags( $cac ) {
77
  $post_types = (array) $settings['custom_posts_sync_option'];
78
  $post_types['post'] = 1;
79
  $post_types['page'] = 1;
80
+ foreach ( $post_types as $post_type => $value ) {
81
  if ( $value ) {
82
  new CPAC_WPML_COLUMN( $post_type );
83
  }
84
  }
85
  }
86
 
87
+ // Create translatable column labels
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  public function register_column_labels() {
 
89
 
90
  // dont load this unless required by WPML
91
  if ( ! isset( $_GET['page'] ) || 'wpml-string-translation/menu/string-translation.php' !== $_GET['page'] ) {
92
  return;
93
  }
94
 
95
+ foreach ( cpac()->get_storage_models() as $storage_model ) {
96
  foreach ( $storage_model->get_stored_columns() as $column_name => $options ) {
97
  icl_register_string( 'Admin Columns', $storage_model->key . '_' . $column_name, stripslashes( $options['label'] ) );
98
  }
100
  }
101
 
102
  public function register_translated_label( $label, $column_name, $column_options, $storage_model ) {
 
103
  if ( function_exists( 'icl_t' ) ) {
104
+ $name = $storage_model->key . '_' . $column_name;
105
+ $label = icl_t( 'Admin Columns', $name, $label );
106
  }
107
+
108
  return $label;
109
  }
110
 
111
  public function is_cac_screen( $is_columns_screen ) {
 
112
  if ( isset( $_GET['page'] ) && 'wpml-string-translation/menu/string-translation.php' == $_GET['page'] ) {
113
  return true;
114
  }
115
+
116
  return $is_columns_screen;
117
  }
118
  }
119
+
120
  new CPAC_WPML;
classes/third_party/yoast_seo.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * Fix for getting the columns loaded by WordPress SEO Yoast
4
- *
5
- * The added columns from WordPress SEO by Yoast weren't available on
6
- * the admin columns settings page. The reason was that class-metabox.php was prevented
7
- * from loading. This fix will also load this class when admin columns is loaded.
8
- *
9
- * @since 1.4.6
10
- */
11
- function cpac_pre_load_wordpress_seo_class_metabox() {
12
- if ( ! defined( 'WPSEO_PATH' ) ) {
13
- return;
14
- }
15
-
16
- if ( ! cac_is_doing_ajax() && ! cac_is_setting_screen() ) {
17
- return;
18
- }
19
-
20
- // Yoast SEO version > 3.0
21
- if ( file_exists( WPSEO_PATH . 'admin/class-meta-columns.php' ) ) {
22
- require_once WPSEO_PATH . 'admin/class-meta-columns.php';
23
- if ( class_exists( 'WPSEO_Meta_Columns', false ) ) {
24
- $metabox = new WPSEO_Meta_Columns;
25
- if ( method_exists( $metabox, 'setup_hooks' ) ) {
26
- $metabox->setup_hooks();
27
- }
28
- }
29
- }
30
-
31
- // Yoast SEO version < 3.0
32
- if ( file_exists( WPSEO_PATH . 'admin/class-meta-box.php' ) ) {
33
- require_once WPSEO_PATH . 'admin/class-meta-box.php';
34
- if ( class_exists( 'WPSEO_Meta_Columns', false ) ) {
35
- new WPSEO_Metabox;
36
- }
37
- }
38
- }
39
-
40
- add_action( 'plugins_loaded', 'cpac_pre_load_wordpress_seo_class_metabox', 0 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/utility.php CHANGED
@@ -25,7 +25,6 @@ function cpac_admin_message( $message = '', $type = 'updated' ) {
25
  * @return string Message.
26
  */
27
  function cpac_admin_notice() {
28
-
29
  echo implode( $GLOBALS['cpac_messages'] );
30
  }
31
 
@@ -39,21 +38,37 @@ function cac_is_doing_ajax() {
39
  return false;
40
  }
41
 
42
- if ( in_array( filter_input( INPUT_POST, 'action' ), array(
43
- 'inline-save', // Quick edit
44
- 'add-tag', // Adding terms
45
- 'inline-save-tax', // Quick edit terms
46
- 'edit-comment', // Quick edit comment
47
- 'replyto-comment' // Inline reply on comment
48
- ) ) ) {
49
- return true;
50
- }
51
 
52
- if ( ( isset( $_POST['plugin_id'] ) && 'cpac' == $_POST['plugin_id'] ) || ( isset( $_GET['plugin_id'] ) && 'cpac' == $_GET['plugin_id'] ) ) {
53
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
 
56
- return false;
57
  }
58
 
59
  /**
25
  * @return string Message.
26
  */
27
  function cpac_admin_notice() {
 
28
  echo implode( $GLOBALS['cpac_messages'] );
29
  }
30
 
38
  return false;
39
  }
40
 
41
+ $is_doing_ajax = cac_wp_is_doing_ajax() || isset( $_REQUEST['storage_model'] );
42
+
43
+ return apply_filters( 'cac/is_doing_ajax', $is_doing_ajax );
44
+ }
 
 
 
 
 
45
 
46
+ /**
47
+ * Is WordPress doing ajax
48
+ *
49
+ * @since 2.5
50
+ */
51
+ function cac_wp_is_doing_ajax() {
52
+ $storage_model = false;
53
+
54
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
55
+
56
+ switch ( filter_input( INPUT_POST, 'action' ) ) {
57
+ case 'inline-save' : // Quick edit
58
+ $storage_model = filter_input( INPUT_POST, 'post_type' );
59
+ break;
60
+ case 'add-tag' : // Adding term
61
+ case 'inline-save-tax' : // Quick edit term
62
+ $storage_model = 'wp-taxonomy_' . filter_input( INPUT_POST, 'taxonomy' );
63
+ break;
64
+ case 'edit-comment' : // Quick edit comment
65
+ case 'replyto-comment' : // Inline reply on comment
66
+ $storage_model = 'wp-comments';
67
+ break;
68
+ }
69
  }
70
 
71
+ return $storage_model;
72
  }
73
 
74
  /**
codepress-admin-columns.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Admin Columns
4
- Version: 2.4.10
5
  Description: Customize columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
6
  Author: AdminColumns.com
7
  Author URI: https://www.admincolumns.com
@@ -32,7 +32,7 @@ if ( ! defined( 'ABSPATH' ) ) {
32
  }
33
 
34
  // Plugin information
35
- define( 'CPAC_VERSION', '2.4.10' ); // Current plugin version
36
  define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // Latest version which requires an upgrade
37
  define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
38
  define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
@@ -50,7 +50,6 @@ if ( ! is_admin() ) {
50
  require_once CPAC_DIR . 'classes/utility.php';
51
  require_once CPAC_DIR . 'classes/third_party.php';
52
  require_once CPAC_DIR . 'includes/arrays.php';
53
- require_once CPAC_DIR . 'api.php';
54
 
55
  /**
56
  * The Admin Columns Class
@@ -59,15 +58,6 @@ require_once CPAC_DIR . 'api.php';
59
  */
60
  class CPAC {
61
 
62
- /**
63
- * Registered storage model class instances
64
- * Array of CPAC_Storage_Model instances, with the storage model keys (e.g. post, page, wp-users) as keys
65
- *
66
- * @since 2.0
67
- * @var array
68
- */
69
- public $storage_models;
70
-
71
  /**
72
  * Admin Columns add-ons class instance
73
  *
@@ -96,18 +86,35 @@ class CPAC {
96
  private $_upgrade;
97
 
98
  /**
99
- * Column settings to import from a column PHP export
 
100
  *
101
- * @since 2.4.7
102
  * @var array
103
  */
104
- public $exported_columns;
105
 
106
  /**
107
  * @since 2.4.9
108
  */
109
  private $current_storage_model;
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  /**
112
  * @since 1.0
113
  */
@@ -121,11 +128,8 @@ class CPAC {
121
  add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
122
  add_filter( 'plugin_action_links', array( $this, 'add_settings_link' ), 1, 2 );
123
 
124
- // Populating storage models
125
- add_action( 'wp_loaded', array( $this, 'set_storage_models' ), 5 );
126
- add_action( 'wp_loaded', array( $this, 'maybe_load_php_export' ) );
127
- add_action( 'admin_init', array( $this, 'set_columns_on_current_screen' ) );
128
- add_action( 'load-edit.php', array( $this, 'set_columns_on_current_screen' ), 1000 );
129
 
130
  // Settings
131
  include_once CPAC_DIR . 'classes/settings.php';
@@ -206,104 +210,58 @@ class CPAC {
206
  }
207
 
208
  /**
209
- * Load the php exported settings
210
  *
211
- * @since 2.3.5
212
  */
213
- public function maybe_load_php_export() {
214
- if ( ! empty( $this->exported_columns ) ) {
215
- foreach ( $this->exported_columns as $model => $columns ) {
216
- if ( $storage_model = $this->get_storage_model( $model ) ) {
217
- $storage_model->set_stored_columns( $columns );
218
- $storage_model->enable_php_export();
219
- }
 
 
 
 
 
 
 
 
 
220
  }
221
- }
222
- }
223
-
224
- /**
225
- * Load the storage models, storing them in the storage_models property of this object
226
- *
227
- * @since 2.0
228
- */
229
- public function set_storage_models() {
230
-
231
- if ( ! $this->is_cac_screen() ) {
232
- return;
233
- }
234
 
235
- $storage_models = array();
236
-
237
- // Load storage model class files and column base class files
238
- require_once CPAC_DIR . 'classes/column.php';
239
- require_once CPAC_DIR . 'classes/column/default.php';
240
- require_once CPAC_DIR . 'classes/column/actions.php';
241
- require_once CPAC_DIR . 'classes/storage_model.php';
242
- require_once CPAC_DIR . 'classes/storage_model/post.php';
243
- require_once CPAC_DIR . 'classes/storage_model/user.php';
244
- require_once CPAC_DIR . 'classes/storage_model/media.php';
245
- require_once CPAC_DIR . 'classes/storage_model/comment.php';
246
- require_once CPAC_DIR . 'classes/storage_model/link.php';
247
-
248
- // Create a storage model per post type
249
- foreach ( $this->get_post_types() as $post_type ) {
250
- $storage_model = new CPAC_Storage_Model_Post( $post_type );
251
  $storage_models[ $storage_model->key ] = $storage_model;
252
- }
253
-
254
- // Create other storage models
255
- $storage_model = new CPAC_Storage_Model_User();
256
- $storage_models[ $storage_model->key ] = $storage_model;
257
 
258
- $storage_model = new CPAC_Storage_Model_Media();
259
- $storage_models[ $storage_model->key ] = $storage_model;
260
-
261
- $storage_model = new CPAC_Storage_Model_Comment();
262
- $storage_models[ $storage_model->key ] = $storage_model;
263
-
264
- if ( apply_filters( 'pre_option_link_manager_enabled', false ) ) { // as of 3.5 link manager is removed
265
- $storage_model = new CPAC_Storage_Model_Link();
266
  $storage_models[ $storage_model->key ] = $storage_model;
267
- }
268
-
269
- /**
270
- * Filter the available storage models
271
- * Used by external plugins to add additional storage models
272
- *
273
- * @since 2.0
274
- *
275
- * @param array $storage_models List of storage model class instances ( [key] => [CPAC_Storage_Model object], where [key] is the storage key, such as "user", "post" or "my_custom_post_type")
276
- * @param object $this CPAC
277
- */
278
- $this->storage_models = apply_filters( 'cac/storage_models', $storage_models, $this );
279
- }
280
-
281
- /**
282
- * Only set columns on current screens
283
- *
284
- * @since 2.4.9
285
- */
286
- public function set_columns_on_current_screen() {
287
 
288
- if ( ! $this->is_cac_screen() ) {
289
- return;
290
- }
291
-
292
- $is_ajax = $this->is_doing_ajax();
293
- $is_settings = $this->is_settings_screen();
294
 
295
- foreach ( $this->storage_models as $storage_model ) {
296
- $current_screen = $storage_model->is_current_screen();
297
 
298
- if ( $is_ajax || $is_settings || $current_screen ) {
299
- $storage_model->set_columns();
300
  }
301
 
302
- // Load headings and values on overviews screen
303
- if ( $is_ajax || $current_screen ) {
304
- $storage_model->init_manage_columns();
305
- }
 
 
 
 
 
 
306
  }
 
 
307
  }
308
 
309
  /**
@@ -316,12 +274,34 @@ class CPAC {
316
  * @return bool|CPAC_Storage_Model Storage Model object (or false, on failure)
317
  */
318
  public function get_storage_model( $key ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
 
320
- if ( isset( $this->storage_models[ $key ] ) ) {
321
- return $this->storage_models[ $key ];
 
322
  }
323
 
324
- return false;
 
 
 
325
  }
326
 
327
  /**
@@ -333,8 +313,8 @@ class CPAC {
333
  * @return CPAC_Storage_Model
334
  */
335
  public function get_current_storage_model() {
336
- if ( ! $this->current_storage_model && $this->storage_models ) {
337
- foreach ( $this->storage_models as $storage_model ) {
338
  if ( $storage_model->is_current_screen() ) {
339
  $this->current_storage_model = $storage_model;
340
  break;
@@ -352,14 +332,12 @@ class CPAC {
352
  *
353
  * @return array List of post type keys (e.g. post, page)
354
  */
355
- public function get_post_types() {
356
-
357
  $post_types = array();
358
 
359
  if ( post_type_exists( 'post' ) ) {
360
  $post_types['post'] = 'post';
361
  }
362
-
363
  if ( post_type_exists( 'page' ) ) {
364
  $post_types['page'] = 'page';
365
  }
@@ -387,9 +365,7 @@ class CPAC {
387
  * @return array List of taxonomies
388
  */
389
  public function get_taxonomies() {
390
-
391
  $taxonomies = get_taxonomies( array( 'public' => true ) );
392
-
393
  if ( isset( $taxonomies['post_format'] ) ) {
394
  unset( $taxonomies['post_format'] );
395
  }
@@ -431,7 +407,6 @@ class CPAC {
431
  * @return string
432
  */
433
  public function admin_class( $classes ) {
434
-
435
  if ( $storage_model = $this->get_current_storage_model() ) {
436
  $classes .= " cp-{$storage_model->key}";
437
  }
@@ -445,7 +420,6 @@ class CPAC {
445
  * @since 1.4.0
446
  */
447
  public function admin_scripts() {
448
-
449
  if ( ! ( $storage_model = $this->get_current_storage_model() ) ) {
450
  return;
451
  }
@@ -483,9 +457,9 @@ class CPAC {
483
  <?php endif; ?>
484
  <?php if ( $edit_link ) : ?>
485
  <script type="text/javascript">
486
- jQuery(document).ready(function () {
487
- jQuery('.tablenav.top .actions:last').append('<a href="<?php echo $edit_link; ?>" class="cpac-edit add-new-h2"><?php _e( 'Edit columns', 'codepress-admin-columns' ); ?></a>');
488
- });
489
  </script>
490
  <?php endif; ?>
491
 
@@ -500,14 +474,23 @@ class CPAC {
500
  do_action( 'cac/admin_head', $storage_model, $this );
501
  }
502
 
 
 
 
 
 
 
 
 
 
 
 
 
503
  /**
504
- * Whether this request is an AJAX request and marked as admin-column-ajax or inline-save request.
505
- *
506
- * @since 2.2
507
- * @return bool Returns true if in an AJAX request, false otherwise
508
  */
509
- public function is_doing_ajax() {
510
- return cac_is_doing_ajax();
511
  }
512
 
513
  /**
@@ -546,7 +529,7 @@ class CPAC {
546
 
547
  /**
548
  * Whether the current screen is a screen in which Admin Columns is used
549
- * Used to check whether storage models should be loaded
550
  *
551
  * @since 2.2
552
  * @return bool Whether the current screen is an Admin Columns screen
@@ -560,7 +543,7 @@ class CPAC {
560
  *
561
  * @param bool $is_cac_screen Whether the current screen is an Admin Columns screen
562
  */
563
- return apply_filters( 'cac/is_cac_screen', $this->is_columns_screen() || $this->is_doing_ajax() || $this->is_settings_screen() );
564
  }
565
 
566
  /**
@@ -570,7 +553,6 @@ class CPAC {
570
  * @return CPAC_Settings Settings class instance
571
  */
572
  public function settings() {
573
-
574
  return $this->_settings;
575
  }
576
 
@@ -581,7 +563,6 @@ class CPAC {
581
  * @return CPAC_Addons Add-ons class instance
582
  */
583
  public function addons() {
584
-
585
  return $this->_addons;
586
  }
587
 
@@ -592,7 +573,6 @@ class CPAC {
592
  * @return CPAC_Upgrade Upgrade class instance
593
  */
594
  public function upgrade() {
595
-
596
  return $this->_upgrade;
597
  }
598
 
@@ -604,7 +584,6 @@ class CPAC {
604
  * @return bool Whether the Advanced Custom Fields plugin is active
605
  */
606
  public function is_plugin_acf_active() {
607
-
608
  return class_exists( 'acf', false );
609
  }
610
 
@@ -616,23 +595,13 @@ class CPAC {
616
  * @return bool Whether the WooCommerce plugin is active
617
  */
618
  public function is_plugin_woocommerce_active() {
619
-
620
  return class_exists( 'WooCommerce', false );
621
  }
622
-
623
  }
624
 
625
- /**
626
- * Admin Columns class (global for backwards compatibility)
627
- *
628
- * @since 1.0
629
- * @deprecated 2.2.7 Use filter cac/loaded instead.
630
- */
631
- global $cpac;
632
 
633
- /**
634
- * Initialize Admin Columns class
635
- *
636
- * @since 1.0
637
- */
638
- $cpac = new CPAC();
1
  <?php
2
  /*
3
  Plugin Name: Admin Columns
4
+ Version: 2.5.2
5
  Description: Customize columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
6
  Author: AdminColumns.com
7
  Author URI: https://www.admincolumns.com
32
  }
33
 
34
  // Plugin information
35
+ define( 'CPAC_VERSION', '2.5.2' ); // Current plugin version
36
  define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // Latest version which requires an upgrade
37
  define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
38
  define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
50
  require_once CPAC_DIR . 'classes/utility.php';
51
  require_once CPAC_DIR . 'classes/third_party.php';
52
  require_once CPAC_DIR . 'includes/arrays.php';
 
53
 
54
  /**
55
  * The Admin Columns Class
58
  */
59
  class CPAC {
60
 
 
 
 
 
 
 
 
 
 
61
  /**
62
  * Admin Columns add-ons class instance
63
  *
86
  private $_upgrade;
87
 
88
  /**
89
+ * Registered storage model class instances
90
+ * Array of CPAC_Storage_Model instances, with the storage model keys (e.g. post, page, wp-users) as keys
91
  *
92
+ * @since 2.0
93
  * @var array
94
  */
95
+ private $storage_models;
96
 
97
  /**
98
  * @since 2.4.9
99
  */
100
  private $current_storage_model;
101
 
102
+ /**
103
+ * @since 2.5
104
+ */
105
+ protected static $_instance = null;
106
+
107
+ /**
108
+ * @since 2.5
109
+ */
110
+ public static function instance() {
111
+ if ( is_null( self::$_instance ) ) {
112
+ self::$_instance = new self();
113
+ }
114
+
115
+ return self::$_instance;
116
+ }
117
+
118
  /**
119
  * @since 1.0
120
  */
128
  add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
129
  add_filter( 'plugin_action_links', array( $this, 'add_settings_link' ), 1, 2 );
130
 
131
+ // Populating columns
132
+ add_action( 'admin_init', array( $this, 'set_columns' ) );
 
 
 
133
 
134
  // Settings
135
  include_once CPAC_DIR . 'classes/settings.php';
210
  }
211
 
212
  /**
213
+ * Get registered storage models
214
  *
215
+ * @since 2.5
216
  */
217
+ public function get_storage_models() {
218
+ if ( empty( $this->storage_models ) ) {
219
+
220
+ $storage_models = array();
221
+
222
+ // Load storage model class files and column base class files
223
+ require_once CPAC_DIR . 'classes/storage_model.php';
224
+ require_once CPAC_DIR . 'classes/storage_model/post.php';
225
+ require_once CPAC_DIR . 'classes/storage_model/user.php';
226
+ require_once CPAC_DIR . 'classes/storage_model/media.php';
227
+ require_once CPAC_DIR . 'classes/storage_model/comment.php';
228
+
229
+ // Create a storage model per post type
230
+ foreach ( $this->get_post_types() as $post_type ) {
231
+ $storage_model = new CPAC_Storage_Model_Post( $post_type );
232
+ $storage_models[ $storage_model->key ] = $storage_model;
233
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
234
 
235
+ // Create other storage models
236
+ $storage_model = new CPAC_Storage_Model_User();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  $storage_models[ $storage_model->key ] = $storage_model;
 
 
 
 
 
238
 
239
+ $storage_model = new CPAC_Storage_Model_Media();
 
 
 
 
 
 
 
240
  $storage_models[ $storage_model->key ] = $storage_model;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
 
242
+ $storage_model = new CPAC_Storage_Model_Comment();
243
+ $storage_models[ $storage_model->key ] = $storage_model;
 
 
 
 
244
 
245
+ if ( apply_filters( 'pre_option_link_manager_enabled', false ) ) { // as of 3.5 link manager is removed
246
+ require_once CPAC_DIR . 'classes/storage_model/link.php';
247
 
248
+ $storage_model = new CPAC_Storage_Model_Link();
249
+ $storage_models[ $storage_model->key ] = $storage_model;
250
  }
251
 
252
+ /**
253
+ * Filter the available storage models
254
+ * Used by external plugins to add additional storage models
255
+ *
256
+ * @since 2.0
257
+ *
258
+ * @param array $storage_models List of storage model class instances ( [key] => [CPAC_Storage_Model object], where [key] is the storage key, such as "user", "post" or "my_custom_post_type")
259
+ * @param object $this CPAC
260
+ */
261
+ $this->storage_models = apply_filters( 'cac/storage_models', $storage_models, $this );
262
  }
263
+
264
+ return $this->storage_models;
265
  }
266
 
267
  /**
274
  * @return bool|CPAC_Storage_Model Storage Model object (or false, on failure)
275
  */
276
  public function get_storage_model( $key ) {
277
+ $models = $this->get_storage_models();
278
+
279
+ return isset( $models[ $key ] ) ? $models[ $key ] : false;
280
+ }
281
+
282
+ /**
283
+ * Only set columns on current screens or on specific ajax calls
284
+ *
285
+ * @since 2.4.9
286
+ */
287
+ public function set_columns() {
288
+
289
+ $storage_model = false;
290
+
291
+ // Listings screen
292
+ if ( $this->is_columns_screen() ) {
293
+ $storage_model = $this->get_current_storage_model();
294
+ }
295
 
296
+ // WP Ajax calls (not AC)
297
+ else if ( $model = cac_wp_is_doing_ajax() ) {
298
+ $storage_model = $this->get_storage_model( $model );
299
  }
300
 
301
+ if ( $storage_model ) {
302
+ $storage_model->init_layout();
303
+ $storage_model->init_manage_columns();
304
+ }
305
  }
306
 
307
  /**
313
  * @return CPAC_Storage_Model
314
  */
315
  public function get_current_storage_model() {
316
+ if ( ! $this->current_storage_model && $this->get_storage_models() ) {
317
+ foreach ( $this->get_storage_models() as $storage_model ) {
318
  if ( $storage_model->is_current_screen() ) {
319
  $this->current_storage_model = $storage_model;
320
  break;
332
  *
333
  * @return array List of post type keys (e.g. post, page)
334
  */
335
+ private function get_post_types() {
 
336
  $post_types = array();
337
 
338
  if ( post_type_exists( 'post' ) ) {
339
  $post_types['post'] = 'post';
340
  }
 
341
  if ( post_type_exists( 'page' ) ) {
342
  $post_types['page'] = 'page';
343
  }
365
  * @return array List of taxonomies
366
  */
367
  public function get_taxonomies() {
 
368
  $taxonomies = get_taxonomies( array( 'public' => true ) );
 
369
  if ( isset( $taxonomies['post_format'] ) ) {
370
  unset( $taxonomies['post_format'] );
371
  }
407
  * @return string
408
  */
409
  public function admin_class( $classes ) {
 
410
  if ( $storage_model = $this->get_current_storage_model() ) {
411
  $classes .= " cp-{$storage_model->key}";
412
  }
420
  * @since 1.4.0
421
  */
422
  public function admin_scripts() {
 
423
  if ( ! ( $storage_model = $this->get_current_storage_model() ) ) {
424
  return;
425
  }
457
  <?php endif; ?>
458
  <?php if ( $edit_link ) : ?>
459
  <script type="text/javascript">
460
+ jQuery( document ).ready( function() {
461
+ jQuery( '.tablenav.top .actions:last' ).append( '<a href="<?php echo $edit_link; ?>" class="cpac-edit add-new-h2"><?php _e( 'Edit columns', 'codepress-admin-columns' ); ?></a>' );
462
+ } );
463
  </script>
464
  <?php endif; ?>
465
 
474
  do_action( 'cac/admin_head', $storage_model, $this );
475
  }
476
 
477
+ public function get_first_storage_model_key() {
478
+ $keys = array_keys( (array) $this->get_storage_models() );
479
+
480
+ return array_shift( $keys );
481
+ }
482
+
483
+ public function get_first_storage_model() {
484
+ $models = array_values( $this->get_storage_models() );
485
+
486
+ return isset( $models[0] ) ? $models[0] : false;
487
+ }
488
+
489
  /**
490
+ * @since 2.5
 
 
 
491
  */
492
+ public function use_delete_confirmation() {
493
+ return apply_filters( 'ac/delete_confirmation', true );
494
  }
495
 
496
  /**
529
 
530
  /**
531
  * Whether the current screen is a screen in which Admin Columns is used
532
+ * Used to quickly check whether storage models should be loaded
533
  *
534
  * @since 2.2
535
  * @return bool Whether the current screen is an Admin Columns screen
543
  *
544
  * @param bool $is_cac_screen Whether the current screen is an Admin Columns screen
545
  */
546
+ return apply_filters( 'cac/is_cac_screen', $this->is_columns_screen() || cac_is_doing_ajax() || $this->is_settings_screen() );
547
  }
548
 
549
  /**
553
  * @return CPAC_Settings Settings class instance
554
  */
555
  public function settings() {
 
556
  return $this->_settings;
557
  }
558
 
563
  * @return CPAC_Addons Add-ons class instance
564
  */
565
  public function addons() {
 
566
  return $this->_addons;
567
  }
568
 
573
  * @return CPAC_Upgrade Upgrade class instance
574
  */
575
  public function upgrade() {
 
576
  return $this->_upgrade;
577
  }
578
 
584
  * @return bool Whether the Advanced Custom Fields plugin is active
585
  */
586
  public function is_plugin_acf_active() {
 
587
  return class_exists( 'acf', false );
588
  }
589
 
595
  * @return bool Whether the WooCommerce plugin is active
596
  */
597
  public function is_plugin_woocommerce_active() {
 
598
  return class_exists( 'WooCommerce', false );
599
  }
 
600
  }
601
 
602
+ function cpac() {
603
+ return CPAC::instance();
604
+ }
 
 
 
 
605
 
606
+ // Global for backwards compatibility.
607
+ $GLOBALS['cpac'] = cpac();
 
 
 
 
languages/codepress-admin-columns.pot CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015 Codepress Admin Columns
2
  # This file is distributed under the same license as the Codepress Admin Columns package.
3
  msgid ""
4
  msgstr ""
@@ -7,7 +7,7 @@ msgstr ""
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
11
  "Last-Translator: Codepress <info@codepress.nl\n"
12
  "Language-Team: Admin Columns <info@admincolumns.com>\n"
13
  "X-Poedit-Basepath: ..\n"
@@ -17,247 +17,259 @@ msgstr ""
17
  "X-Poedit-SearchPathExcluded-0: *.js\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n\n"
19
 
20
- #: ../codepress-admin-columns.php:901
21
  msgid "Edit columns"
22
  msgstr ""
23
 
24
- #: ../classes/addons.php:115
25
- msgid "Plugins"
26
  msgstr ""
27
 
28
- #: ../classes/addons.php:141, ../classes/storage_model.php:1309
29
- msgid "Advanced Custom Fields"
30
  msgstr ""
31
 
32
- #: ../classes/addons.php:142
33
- msgid "Display and edit Advanced Custom Fields fields in the posts overview in seconds!"
34
  msgstr ""
35
 
36
- #: ../classes/addons.php:147, ../classes/storage_model.php:1311, ../classes/column/wc-placeholder.php:13
37
- msgid "WooCommerce"
38
  msgstr ""
39
 
40
- #: ../classes/addons.php:148
41
- msgid "Enhance the products, orders and coupons overviews with new columns and inline editing."
42
  msgstr ""
43
 
44
- #: ../classes/column.php:1305
45
- msgid "Thumbnail"
46
  msgstr ""
47
 
48
- #: ../classes/column.php:1307
49
- msgid "Medium"
50
  msgstr ""
51
 
52
- #: ../classes/column.php:1309
53
- msgid "Large"
54
  msgstr ""
55
 
56
- #: ../classes/column.php:1311
57
- msgid "Full"
58
  msgstr ""
59
 
60
- #: ../classes/column.php:2175
61
- msgid "Exact match"
 
 
 
 
 
 
 
 
62
  msgstr ""
63
 
64
- #: ../classes/column.php:2177
65
- msgid "Lesser than"
66
  msgstr ""
67
 
68
- #: ../classes/column.php:2179
69
- msgid "Greater than"
70
  msgstr ""
71
 
72
- #: ../classes/column.php:2181
73
- msgid "Between"
74
  msgstr ""
75
 
76
- #: ../classes/column.php:2235
77
  msgid "Date Format"
78
  msgstr ""
79
 
80
- #: ../classes/column.php:2237
81
  msgid "This will determine how the date will be displayed."
82
  msgstr ""
83
 
84
- #: ../classes/column.php:2249
85
  msgid "Example:"
86
  msgstr ""
87
 
88
- #: ../classes/column.php:2253
89
  msgid "Leave empty for WordPress date format, change your <a href='%s'>default date format here</a>."
90
  msgstr ""
91
 
92
- #: ../classes/column.php:2255
93
  msgid "Documentation on date and time formatting."
94
  msgstr ""
95
 
96
- #: ../classes/column.php:2283
97
  msgid "Excerpt length"
98
  msgstr ""
99
 
100
- #: ../classes/column.php:2285
101
  msgid "Number of words"
102
  msgstr ""
103
 
104
- #: ../classes/column.php:2321
105
- msgid "Preview size"
106
  msgstr ""
107
 
108
- #: ../classes/column.php:2355, ../classes/storage_model.php:1305
109
- msgid "Custom"
 
 
 
 
110
  msgstr ""
111
 
112
- #: ../classes/column.php:2361, ../classes/column.php:2719
113
  msgid "width"
114
  msgstr ""
115
 
116
- #: ../classes/column.php:2367
117
  msgid "height"
118
  msgstr ""
119
 
120
- #: ../classes/column.php:2391
121
  msgid "Before"
122
  msgstr ""
123
 
124
- #: ../classes/column.php:2391
125
  msgid "This text will appear before the custom field value."
126
  msgstr ""
127
 
128
- #: ../classes/column.php:2393
129
  msgid "After"
130
  msgstr ""
131
 
132
- #: ../classes/column.php:2393
133
  msgid "This text will appear after the custom field value."
134
  msgstr ""
135
 
136
- #: ../classes/column.php:2411
137
  msgid "Display Name"
138
  msgstr ""
139
 
140
- #: ../classes/column.php:2413
141
  msgid "First Name"
142
  msgstr ""
143
 
144
- #: ../classes/column.php:2415
145
  msgid "Last Name"
146
  msgstr ""
147
 
148
- #: ../classes/column.php:2417, ../classes/column/user/nickname.php:37
149
  msgid "Nickname"
150
  msgstr ""
151
 
152
- #: ../classes/column.php:2419
153
  msgid "User Login"
154
  msgstr ""
155
 
156
- #: ../classes/column.php:2421
157
  msgid "User Email"
158
  msgstr ""
159
 
160
- #: ../classes/column.php:2423, ../classes/column/user/ID.php:37
161
  msgid "User ID"
162
  msgstr ""
163
 
164
- #: ../classes/column.php:2425
165
  msgid "First and Last Name"
166
  msgstr ""
167
 
168
- #: ../classes/column.php:2431
169
  msgid "Display format"
170
  msgstr ""
171
 
172
- #: ../classes/column.php:2431
173
  msgid "This is the format of the author name."
174
  msgstr ""
175
 
176
- #: ../classes/column.php:2763
177
  msgid "Edit"
178
  msgstr ""
179
 
180
- #: ../classes/column.php:2767, ../classes/column.php:2951
181
  msgid "Clone"
182
  msgstr ""
183
 
184
- #: ../classes/column.php:2771
185
  msgid "Remove"
186
  msgstr ""
187
 
188
- #: ../classes/column.php:2807, ../classes/column.php:2807, ../classes/column/custom-field.php:408, ../classes/column/comment/type.php:25
189
  msgid "Type"
190
  msgstr ""
191
 
192
- #: ../classes/column.php:2807
193
  msgid "Choose a column type."
194
  msgstr ""
195
 
196
- #: ../classes/column.php:2807
197
  msgid "Name"
198
  msgstr ""
199
 
200
- #: ../classes/column.php:2827
201
  msgid "Label"
202
  msgstr ""
203
 
204
- #: ../classes/column.php:2827
205
  msgid "This is the name which will appear as the column header."
206
  msgstr ""
207
 
208
- #: ../classes/column.php:2841, ../classes/column/media/width.php:37
209
  msgid "Width"
210
  msgstr ""
211
 
212
- #: ../classes/column.php:2845
213
  msgid "default"
214
  msgstr ""
215
 
216
- #: ../classes/column.php:2847
217
  msgid "auto"
218
  msgstr ""
219
 
220
- #: ../classes/column.php:2995
221
  msgid "Property To Display"
222
  msgstr ""
223
 
224
- #: ../classes/column.php:3007
225
  msgid "Post property to display for related post(s)."
226
  msgstr ""
227
 
228
- #: ../classes/column.php:3031, ../classes/column/post/author-name.php:189
229
  msgid "Link To"
230
  msgstr ""
231
 
232
- #: ../classes/column.php:3041
233
  msgid "Edit Post Author"
234
  msgstr ""
235
 
236
- #: ../classes/column.php:3043
237
  msgid "View Public Post Author Page"
238
  msgstr ""
239
 
240
- #: ../classes/column.php:3047
241
  msgid "Page the posts should link to."
242
  msgstr ""
243
 
244
- #: ../classes/column.php:3067
245
  msgid "The %s column is only available in Admin Columns Pro - Business or Developer."
246
  msgstr ""
247
 
248
- #: ../classes/column.php:3073
249
  msgid "If you have a business or developer licence please download & install your %s add-on from the <a href='%s'>add-ons tab</a>."
250
  msgstr ""
251
 
252
- #: ../classes/column.php:3079
253
  msgid "Admin Columns Pro offers full %s integration, allowing you to easily display and edit %s fields from within your overview."
254
  msgstr ""
255
 
256
- #: ../classes/column.php:3091
257
  msgid "Find out more"
258
  msgstr ""
259
 
260
- #: ../classes/review_notice.php:109, ../classes/settings.php:339, ../classes/settings.php:1197, ../classes/upgrade.php:269
261
  msgid "Admin Columns"
262
  msgstr ""
263
 
@@ -309,447 +321,463 @@ msgstr ""
309
  msgid "find answers to some frequently asked questions"
310
  msgstr ""
311
 
312
- #: ../classes/settings.php:225
313
  msgid "Add-on successfully activated."
314
  msgstr ""
315
 
316
- #: ../classes/settings.php:231
317
  msgid "Add-on successfully deactivated."
318
  msgstr ""
319
 
320
- #: ../classes/settings.php:339
321
  msgid "Admin Columns Settings"
322
  msgstr ""
323
 
324
- #: ../classes/settings.php:455
325
  msgid "%s column is already present and can not be duplicated."
326
  msgstr ""
327
 
328
- #: ../classes/settings.php:567
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  msgid "Default settings succesfully restored."
330
  msgstr ""
331
 
332
- #: ../classes/settings.php:601
333
  msgid "Overview"
334
  msgstr ""
335
 
336
- #: ../classes/settings.php:607
337
  msgid "This plugin is for adding and removing additional columns to the administration screens for post(types), pages, media library, comments, links and users. Change the column's label and reorder them."
338
  msgstr ""
339
 
340
- #: ../classes/settings.php:613
341
  msgid "Basics"
342
  msgstr ""
343
 
344
- #: ../classes/settings.php:617
345
  msgid "Change order"
346
  msgstr ""
347
 
348
- #: ../classes/settings.php:619
349
  msgid "By dragging the columns you can change the order which they will appear in."
350
  msgstr ""
351
 
352
- #: ../classes/settings.php:621
353
  msgid "Change label"
354
  msgstr ""
355
 
356
- #: ../classes/settings.php:623
357
  msgid "By clicking on the triangle you will see the column options. Here you can change each label of the columns heading."
358
  msgstr ""
359
 
360
- #: ../classes/settings.php:625
361
  msgid "Change column width"
362
  msgstr ""
363
 
364
- #: ../classes/settings.php:627
365
  msgid "By clicking on the triangle you will see the column options. By using the draggable slider you can set the width of the columns in percentages."
366
  msgstr ""
367
 
368
- #: ../classes/settings.php:635, ../classes/storage_model.php:1303, ../classes/column/custom-field.php:23, ../classes/column/custom-field.php:391
369
  msgid "Custom Field"
370
  msgstr ""
371
 
372
- #: ../classes/settings.php:639
373
  msgid "'Custom Field' column"
374
  msgstr ""
375
 
376
- #: ../classes/settings.php:641
377
  msgid "The custom field colum uses the custom fields from posts and users. There are 10 types which you can set."
378
  msgstr ""
379
 
380
- #: ../classes/settings.php:645, ../classes/storage_model.php:1301, ../classes/column/custom-field.php:95
381
  msgid "Default"
382
  msgstr ""
383
 
384
- #: ../classes/settings.php:645
385
  msgid "Value: Can be either a string or array. Arrays will be flattened and values are seperated by a ',' comma."
386
  msgstr ""
387
 
388
- #: ../classes/settings.php:647, ../classes/column/custom-field.php:101, ../classes/column/link/image.php:37
389
- msgid "Image"
390
  msgstr ""
391
 
392
- #: ../classes/settings.php:647
393
- msgid "Value: should contain an image URL or Attachment IDs ( seperated by a ',' comma )."
394
  msgstr ""
395
 
396
- #: ../classes/settings.php:649, ../classes/column/post/excerpt.php:37
397
- msgid "Excerpt"
398
  msgstr ""
399
 
400
- #: ../classes/settings.php:649
401
- msgid "Value: This will show the first 20 words of the Post content."
402
  msgstr ""
403
 
404
- #: ../classes/settings.php:651, ../classes/column/custom-field.php:103
405
- msgid "Multiple Values"
406
  msgstr ""
407
 
408
- #: ../classes/settings.php:651
409
- msgid "Value: should be an array. This will flatten any ( multi dimensional ) array."
410
  msgstr ""
411
 
412
- #: ../classes/settings.php:653, ../classes/column/custom-field.php:104
413
- msgid "Numeric"
414
  msgstr ""
415
 
416
- #: ../classes/settings.php:653
417
- msgid "Value: Integers only.<br/>If you have the 'sorting addon' this will be used for sorting, so you can sort your posts on numeric (custom field) values."
418
  msgstr ""
419
 
420
- #: ../classes/settings.php:655, ../classes/column/custom-field.php:99, ../classes/column/comment/date.php:37
421
- msgid "Date"
422
  msgstr ""
423
 
424
- #: ../classes/settings.php:655
425
- msgid "Value: Can be unix time stamp or a date format as described in the <a href='%s'>Codex</a>. You can change the outputted date format at the <a href='%s'>general settings</a> page."
426
  msgstr ""
427
 
428
- #: ../classes/settings.php:657
429
- msgid "Post Titles"
430
  msgstr ""
431
 
432
- #: ../classes/settings.php:657
433
- msgid "Value: can be one or more Post ID's (seperated by ',')."
434
  msgstr ""
435
 
436
- #: ../classes/settings.php:659
437
- msgid "Usernames"
438
  msgstr ""
439
 
440
- #: ../classes/settings.php:659
441
- msgid "Value: can be one or more User ID's (seperated by ',')."
442
  msgstr ""
443
 
444
- #: ../classes/settings.php:661
445
- msgid "Checkmark"
446
  msgstr ""
447
 
448
- #: ../classes/settings.php:661
449
- msgid "Value: should be a 1 (one) or 0 (zero)."
450
  msgstr ""
451
 
452
- #: ../classes/settings.php:663, ../classes/column/custom-field.php:97
453
- msgid "Color"
454
  msgstr ""
455
 
456
- #: ../classes/settings.php:663
457
- msgid "Value: hex value color, such as #808080."
458
  msgstr ""
459
 
460
- #: ../classes/settings.php:665, ../classes/column/custom-field.php:98
461
- msgid "Counter"
462
  msgstr ""
463
 
464
- #: ../classes/settings.php:665
465
- msgid "Value: Can be either a string or array. This will display a count of the number of times the meta key is used by the item."
 
 
 
 
 
 
 
 
 
 
 
 
466
  msgstr ""
467
 
468
- #: ../classes/settings.php:843
 
 
 
 
469
  msgid "Welcome to Admin Columns"
470
  msgstr ""
471
 
472
- #: ../classes/settings.php:849
473
  msgid "Thank you for updating to the latest version!"
474
  msgstr ""
475
 
476
- #: ../classes/settings.php:851
477
  msgid "Admin Columns is more polished and enjoyable than ever before. We hope you like it."
478
  msgstr ""
479
 
480
- #: ../classes/settings.php:861
481
  msgid "What’s New"
482
  msgstr ""
483
 
484
- #: ../classes/settings.php:863
485
  msgid "Changelog"
486
  msgstr ""
487
 
488
- #: ../classes/settings.php:873
489
  msgid "Important"
490
  msgstr ""
491
 
492
- #: ../classes/settings.php:877
493
  msgid "Database Changes"
494
  msgstr ""
495
 
496
- #: ../classes/settings.php:879
497
  msgid "The database has been changed between versions 1 and 2. But we made sure you can still roll back to version 1x without any issues."
498
  msgstr ""
499
 
500
- #: ../classes/settings.php:885
501
  msgid "Make sure you backup your database and then click"
502
  msgstr ""
503
 
504
- #: ../classes/settings.php:885, ../classes/upgrade.php:285
505
  msgid "Upgrade Database"
506
  msgstr ""
507
 
508
- #: ../classes/settings.php:891
509
  msgid "Potential Issues"
510
  msgstr ""
511
 
512
- #: ../classes/settings.php:893
513
  msgid "Do to the sizable refactoring the code, surounding Addons and action/filters, your website may not operate correctly. It is important that you read the full"
514
  msgstr ""
515
 
516
- #: ../classes/settings.php:893
517
  msgid "Migrating from v1 to v2"
518
  msgstr ""
519
 
520
- #: ../classes/settings.php:893
521
  msgid "guide to view the full list of changes."
522
  msgstr ""
523
 
524
- #: ../classes/settings.php:893
525
  msgid "When you have found a bug please <a href='%s'>report them to us</a> so we can fix it in the next release."
526
  msgstr ""
527
 
528
- #: ../classes/settings.php:899
529
  msgid "Important!"
530
  msgstr ""
531
 
532
- #: ../classes/settings.php:899
533
  msgid "If you updated the Admin Columns plugin without prior knowledge of such changes, Please roll back to the latest"
534
  msgstr ""
535
 
536
- #: ../classes/settings.php:899
537
  msgid "version 1"
538
  msgstr ""
539
 
540
- #: ../classes/settings.php:899
541
  msgid "of this plugin."
542
  msgstr ""
543
 
544
- #: ../classes/settings.php:911
545
  msgid "Changelog for"
546
  msgstr ""
547
 
548
- #: ../classes/settings.php:941, ../classes/upgrade.php:125
549
  msgid "Learn more"
550
  msgstr ""
551
 
552
- #: ../classes/settings.php:961
553
  msgid "Start using Admin Columns"
554
  msgstr ""
555
 
556
- #: ../classes/settings.php:999
557
  msgid "General Settings"
558
  msgstr ""
559
 
560
- #: ../classes/settings.php:1001
561
  msgid "Customize your Admin Columns settings."
562
  msgstr ""
563
 
564
- #: ../classes/settings.php:1023
565
  msgid "Show \"Edit Columns\" button on admin screens. Default is <code>on</code>."
566
  msgstr ""
567
 
568
- #: ../classes/settings.php:1117
569
  msgid "Restore Settings"
570
  msgstr ""
571
 
572
- #: ../classes/settings.php:1119
573
  msgid "This will delete all column settings and restore the default settings."
574
  msgstr ""
575
 
576
- #: ../classes/settings.php:1131
577
  msgid "Restore default settings"
578
  msgstr ""
579
 
580
- #: ../classes/settings.php:1131
581
  msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. 'OK' to delete, 'Cancel' to stop"
582
  msgstr ""
583
 
584
- #: ../classes/settings.php:1163
585
- msgid "Posttypes"
586
- msgstr ""
587
-
588
- #: ../classes/settings.php:1165
589
- msgid "Others"
590
- msgstr ""
591
-
592
- #: ../classes/settings.php:1167
593
- msgid "Taxonomies"
594
- msgstr ""
595
-
596
- #: ../classes/settings.php:1199
597
  msgid "Settings"
598
  msgstr ""
599
 
600
- #: ../classes/settings.php:1201
601
  msgid "Add-ons"
602
  msgstr ""
603
 
604
- #: ../classes/settings.php:1337
605
- msgid "The columns for %s are set up via PHP and can therefore not be edited in the admin panel."
606
- msgstr ""
607
-
608
- #: ../classes/settings.php:1357
609
  msgid "Store settings"
610
  msgstr ""
611
 
612
- #: ../classes/settings.php:1373
613
  msgid "Warning! The %s columns data will be deleted. This cannot be undone. 'OK' to delete, 'Cancel' to stop"
614
  msgstr ""
615
 
616
- #: ../classes/settings.php:1375
617
- msgid "Restore"
618
- msgstr ""
619
-
620
- #: ../classes/settings.php:1375
621
- msgid "columns"
622
  msgstr ""
623
 
624
- #: ../classes/settings.php:1413
625
  msgid "Get Admin Columns Pro"
626
  msgstr ""
627
 
628
- #: ../classes/settings.php:1421
629
  msgid "Add Sorting"
630
  msgstr ""
631
 
632
- #: ../classes/settings.php:1423
633
  msgid "Add Filtering"
634
  msgstr ""
635
 
636
- #: ../classes/settings.php:1425
637
  msgid "Add Import/Export"
638
  msgstr ""
639
 
640
- #: ../classes/settings.php:1427
641
  msgid "Add Direct Editing"
642
  msgstr ""
643
 
644
- #: ../classes/settings.php:1433
645
  msgid "Check out <a href='%s'>Admin Columns Pro</a> for more details!"
646
  msgstr ""
647
 
648
- #: ../classes/settings.php:1449
649
  msgid "Are you happy with Admin Columns?"
650
  msgstr ""
651
 
652
- #: ../classes/settings.php:1465
653
  msgid "What's wrong? Need help? Let us know!"
654
  msgstr ""
655
 
656
- #: ../classes/settings.php:1467
657
  msgid "Check out our extensive documentation, or you can open a support topic on WordPress.org!"
658
  msgstr ""
659
 
660
- #: ../classes/settings.php:1483
661
  msgid "Docs"
662
  msgstr ""
663
 
664
- #: ../classes/settings.php:1493
665
  msgid "Forums"
666
  msgstr ""
667
 
668
- #: ../classes/settings.php:1511
669
  msgid "Woohoo! We're glad to hear that!"
670
  msgstr ""
671
 
672
- #: ../classes/settings.php:1513
673
  msgid "We would really love it if you could show your appreciation by giving us a rating on WordPress.org or tweet about Admin Columns!"
674
  msgstr ""
675
 
676
- #: ../classes/settings.php:1521
677
  msgid "Rate"
678
  msgstr ""
679
 
680
- #: ../classes/settings.php:1543
681
  msgid "Tweet"
682
  msgstr ""
683
 
684
- #: ../classes/settings.php:1563
685
  msgid "Buy Pro"
686
  msgstr ""
687
 
688
- #: ../classes/settings.php:1587
689
  msgid "Support"
690
  msgstr ""
691
 
692
- #: ../classes/settings.php:1593
693
  msgid "Check the <strong>Help</strong> section in the top-right screen."
694
  msgstr ""
695
 
696
- #: ../classes/settings.php:1599
697
  msgid "For full documentation, bug reports, feature suggestions and other tips <a href='%s'>visit the Admin Columns website</a>"
698
  msgstr ""
699
 
700
- #: ../classes/settings.php:1657
 
 
 
 
 
 
 
 
701
  msgid "Drag and drop to reorder"
702
  msgstr ""
703
 
704
- #: ../classes/settings.php:1663
705
  msgid "Add Column"
706
  msgstr ""
707
 
708
- #: ../classes/settings.php:1825
709
  msgid "Active"
710
  msgstr ""
711
 
712
- #: ../classes/settings.php:1827
713
  msgid "Deactivate"
714
  msgstr ""
715
 
716
- #: ../classes/settings.php:1841
717
  msgid "Installed"
718
  msgstr ""
719
 
720
- #: ../classes/settings.php:1843
721
  msgid "Activate"
722
  msgstr ""
723
 
724
- #: ../classes/settings.php:1871
725
  msgid "Download & Install"
726
  msgstr ""
727
 
728
- #: ../classes/settings.php:1881
729
  msgid "Get this add-on"
730
  msgstr ""
731
 
732
- #: ../classes/storage_model.php:521
733
- msgid "settings succesfully restored."
734
  msgstr ""
735
 
736
- #: ../classes/storage_model.php:553
737
- msgid "No columns settings available."
738
  msgstr ""
739
 
740
- #: ../classes/storage_model.php:597
741
- msgid "You are trying to store the same settings for %s."
742
- msgstr ""
743
-
744
- #: ../classes/storage_model.php:607
745
- msgid "Settings for %s updated successfully."
746
  msgstr ""
747
 
748
- #: ../classes/storage_model.php:1307
749
- msgid "Columns by Plugins"
750
  msgstr ""
751
 
752
- #: ../classes/storage_model.php:1755
753
  msgid "View"
754
  msgstr ""
755
 
@@ -813,55 +841,67 @@ msgstr ""
813
  msgid "Advanced Custom Field"
814
  msgstr ""
815
 
816
- #: ../classes/column/actions.php:57, ../classes/column/link/actions.php:37
817
  msgid "Actions"
818
  msgstr ""
819
 
820
- #: ../classes/column/actions.php:191
821
  msgid "Use icons?"
822
  msgstr ""
823
 
824
- #: ../classes/column/actions.php:191
825
  msgid "Use icons instead of text for displaying the actions."
826
  msgstr ""
827
 
828
- #: ../classes/column/custom-field.php:96
829
  msgid "Checkmark (true/false)"
830
  msgstr ""
831
 
832
- #: ../classes/column/custom-field.php:102
833
- msgid "Media Library"
834
  msgstr ""
835
 
836
- #: ../classes/column/custom-field.php:105
837
  msgid "Post Title (Post ID's)"
838
  msgstr ""
839
 
840
- #: ../classes/column/custom-field.php:106
841
  msgid "Username (User ID's)"
842
  msgstr ""
843
 
844
- #: ../classes/column/custom-field.php:107
845
  msgid "Term Name (Term ID's)"
846
  msgstr ""
847
 
848
- #: ../classes/column/custom-field.php:391
 
 
 
 
 
 
 
 
 
 
 
 
849
  msgid "Select your custom field."
850
  msgstr ""
851
 
852
- #: ../classes/column/custom-field.php:401
853
  msgid "No custom fields available."
854
  msgstr ""
855
 
856
- #: ../classes/column/custom-field.php:401
857
  msgid "Please create a %s item first."
858
  msgstr ""
859
 
860
- #: ../classes/column/custom-field.php:408
861
  msgid "Field Type"
862
  msgstr ""
863
 
864
- #: ../classes/column/custom-field.php:408
865
  msgid "This will determine how the value will be displayed."
866
  msgstr ""
867
 
@@ -873,14 +913,22 @@ msgstr ""
873
  msgid "Used by Menu"
874
  msgstr ""
875
 
876
- #: ../classes/column/used-by-menu.php:265
877
  msgid "Link to menu"
878
  msgstr ""
879
 
880
- #: ../classes/column/used-by-menu.php:265
881
  msgid "This will make the title link to the menu."
882
  msgstr ""
883
 
 
 
 
 
 
 
 
 
884
  #: ../classes/column/comment/ID.php:37, ../classes/column/link/ID.php:37, ../classes/column/media/ID.php:37, ../classes/column/post/ID.php:37
885
  msgid "ID"
886
  msgstr ""
@@ -889,7 +937,7 @@ msgstr ""
889
  msgid "Agent"
890
  msgstr ""
891
 
892
- #: ../classes/column/comment/approved.php:37, ../classes/column/post/comment-count.php:69
893
  msgid "Approved"
894
  msgstr ""
895
 
@@ -933,15 +981,19 @@ msgstr ""
933
  msgid "In Reply To"
934
  msgstr ""
935
 
 
 
 
 
936
  #: ../classes/column/comment/user.php:21
937
  msgid "User"
938
  msgstr ""
939
 
940
- #: ../classes/column/comment/word-count.php:37, ../classes/column/post/word-count.php:37
941
  msgid "Word count"
942
  msgstr ""
943
 
944
- #: ../classes/column/link/description.php:37, ../classes/column/media/description.php:37, ../classes/column/user/description.php:37
945
  msgid "Description"
946
  msgstr ""
947
 
@@ -985,7 +1037,7 @@ msgstr ""
985
  msgid "Caption"
986
  msgstr ""
987
 
988
- #: ../classes/column/media/dimensions.php:37
989
  msgid "Dimensions"
990
  msgstr ""
991
 
@@ -1037,27 +1089,27 @@ msgstr ""
1037
  msgid "File size"
1038
  msgstr ""
1039
 
1040
- #: ../classes/column/media/full-path.php:37, ../classes/column/media/full-path.php:183
1041
  msgid "Full path"
1042
  msgstr ""
1043
 
1044
- #: ../classes/column/media/full-path.php:165
1045
  msgid "Path scope"
1046
  msgstr ""
1047
 
1048
- #: ../classes/column/media/full-path.php:167
1049
  msgid "Part of the file path to display"
1050
  msgstr ""
1051
 
1052
- #: ../classes/column/media/full-path.php:193
1053
  msgid "Relative to domain"
1054
  msgstr ""
1055
 
1056
- #: ../classes/column/media/full-path.php:203
1057
  msgid "Relative to main uploads folder "
1058
  msgstr ""
1059
 
1060
- #: ../classes/column/media/height.php:37
1061
  msgid "Height"
1062
  msgstr ""
1063
 
@@ -1065,7 +1117,31 @@ msgstr ""
1065
  msgid "Mime type"
1066
  msgstr ""
1067
 
1068
- #: ../classes/column/post/attachment-count.php:37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1069
  msgid "No. of Attachments"
1070
  msgstr ""
1071
 
@@ -1073,15 +1149,15 @@ msgstr ""
1073
  msgid "Attachments"
1074
  msgstr ""
1075
 
1076
- #: ../classes/column/post/author-name.php:39
1077
  msgid "Display Author As"
1078
  msgstr ""
1079
 
1080
- #: ../classes/column/post/author-name.php:199
1081
  msgid "View Public Author Page"
1082
  msgstr ""
1083
 
1084
- #: ../classes/column/post/author-name.php:203
1085
  msgid "Page the author name should link to."
1086
  msgstr ""
1087
 
@@ -1089,59 +1165,59 @@ msgstr ""
1089
  msgid "Before More Tag"
1090
  msgstr ""
1091
 
1092
- #: ../classes/column/post/comment-count.php:39
1093
  msgid "Comment count"
1094
  msgstr ""
1095
 
1096
- #: ../classes/column/post/comment-count.php:67
1097
  msgid "Total"
1098
  msgstr ""
1099
 
1100
- #: ../classes/column/post/comment-count.php:71
1101
  msgid "Pending"
1102
  msgstr ""
1103
 
1104
- #: ../classes/column/post/comment-count.php:73
1105
  msgid "Spam"
1106
  msgstr ""
1107
 
1108
- #: ../classes/column/post/comment-count.php:75
1109
  msgid "Trash"
1110
  msgstr ""
1111
 
1112
- #: ../classes/column/post/comment-count.php:197, ../classes/column/post/comment-status.php:39
1113
  msgid "Comment status"
1114
  msgstr ""
1115
 
1116
- #: ../classes/column/post/comment-count.php:197
1117
  msgid "Select which comment status you like to display."
1118
  msgstr ""
1119
 
1120
- #: ../classes/column/post/depth.php:37
1121
  msgid "Depth"
1122
  msgstr ""
1123
 
1124
- #: ../classes/column/post/estimated-reading-time.php:37
1125
  msgid "Estimated Reading Time"
1126
  msgstr ""
1127
 
1128
- #: ../classes/column/post/estimated-reading-time.php:131
1129
  msgid "second"
1130
  msgid_plural "seconds"
1131
  msgstr[0] ""
1132
  msgstr[1] ""
1133
 
1134
- #: ../classes/column/post/estimated-reading-time.php:137
1135
  msgid "minute"
1136
  msgid_plural "minutes"
1137
  msgstr[0] ""
1138
  msgstr[1] ""
1139
 
1140
- #: ../classes/column/post/estimated-reading-time.php:213
1141
  msgid "Words per minute"
1142
  msgstr ""
1143
 
1144
- #: ../classes/column/post/estimated-reading-time.php:215
1145
  msgid "Estimated reading time in words per minute"
1146
  msgstr ""
1147
 
@@ -1161,15 +1237,15 @@ msgstr ""
1161
  msgid "Last modified"
1162
  msgstr ""
1163
 
1164
- #: ../classes/column/post/order.php:37
1165
  msgid "Order"
1166
  msgstr ""
1167
 
1168
- #: ../classes/column/post/page-template.php:37
1169
  msgid "Page Template"
1170
  msgstr ""
1171
 
1172
- #: ../classes/column/post/parent.php:37
1173
  msgid "Parent"
1174
  msgstr ""
1175
 
@@ -1189,15 +1265,15 @@ msgstr ""
1189
  msgid "This will make the permalink clickable."
1190
  msgstr ""
1191
 
1192
- #: ../classes/column/post/ping-status.php:37
1193
- msgid "Ping status"
1194
  msgstr ""
1195
 
1196
- #: ../classes/column/post/roles.php:37
1197
  msgid "Roles"
1198
  msgstr ""
1199
 
1200
- #: ../classes/column/post/shortcodes.php:37
1201
  msgid "Shortcodes"
1202
  msgstr ""
1203
 
@@ -1205,46 +1281,10 @@ msgstr ""
1205
  msgid "Slug"
1206
  msgstr ""
1207
 
1208
- #: ../classes/column/post/status.php:41
1209
- msgid "Status"
1210
- msgstr ""
1211
-
1212
- #: ../classes/column/post/sticky.php:37
1213
  msgid "Sticky"
1214
  msgstr ""
1215
 
1216
  #: ../classes/column/post/title-raw.php:37
1217
  msgid "Title without actions"
1218
  msgstr ""
1219
-
1220
- #: ../classes/column/user/display-name.php:37
1221
- msgid "Display name"
1222
- msgstr ""
1223
-
1224
- #: ../classes/column/user/first-name.php:37
1225
- msgid "First name"
1226
- msgstr ""
1227
-
1228
- #: ../classes/column/user/last-name.php:37
1229
- msgid "Last name"
1230
- msgstr ""
1231
-
1232
- #: ../classes/column/user/post-count.php:37
1233
- msgid "Post Count"
1234
- msgstr ""
1235
-
1236
- #: ../classes/column/user/post-count.php:177
1237
- msgid "Post Type"
1238
- msgstr ""
1239
-
1240
- #: ../classes/column/user/registered.php:37
1241
- msgid "Registered"
1242
- msgstr ""
1243
-
1244
- #: ../classes/column/user/rich-editing.php:37
1245
- msgid "Visual Editor"
1246
- msgstr ""
1247
-
1248
- #: ../classes/column/user/url.php:37
1249
- msgid "Url"
1250
- msgstr ""
1
+ # Copyright (C) 2016 Codepress Admin Columns
2
  # This file is distributed under the same license as the Codepress Admin Columns package.
3
  msgid ""
4
  msgstr ""
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
+ "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
11
  "Last-Translator: Codepress <info@codepress.nl\n"
12
  "Language-Team: Admin Columns <info@admincolumns.com>\n"
13
  "X-Poedit-Basepath: ..\n"
17
  "X-Poedit-SearchPathExcluded-0: *.js\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n\n"
19
 
20
+ #: ../codepress-admin-columns.php:921
21
  msgid "Edit columns"
22
  msgstr ""
23
 
24
+ #: ../classes/addons.php:53, ../classes/addons.php:269
25
+ msgid "Advanced Custom Fields"
26
  msgstr ""
27
 
28
+ #: ../classes/addons.php:57, ../classes/addons.php:275, ../classes/column/wc-placeholder.php:12
29
+ msgid "WooCommerce"
30
  msgstr ""
31
 
32
+ #: ../classes/addons.php:75
33
+ msgid "%s and %s"
34
  msgstr ""
35
 
36
+ #: ../classes/addons.php:81
37
+ msgid "Did you know Admin Columns Pro has an integration addon for %s? With the proper Admin Columns Pro license, you can download them from %s!"
38
  msgstr ""
39
 
40
+ #: ../classes/addons.php:83
41
+ msgid "the addons page"
42
  msgstr ""
43
 
44
+ #: ../classes/addons.php:170
45
+ msgid "Addon does not exist."
46
  msgstr ""
47
 
48
+ #: ../classes/addons.php:176
49
+ msgid "You need Admin Columns Pro."
50
  msgstr ""
51
 
52
+ #: ../classes/addons.php:243
53
+ msgid "Plugins"
54
  msgstr ""
55
 
56
+ #: ../classes/addons.php:270
57
+ msgid "Display and edit Advanced Custom Fields fields in the posts overview in seconds!"
58
  msgstr ""
59
 
60
+ #: ../classes/addons.php:276
61
+ msgid "Enhance the products, orders and coupons overviews with new columns and inline editing."
62
+ msgstr ""
63
+
64
+ #: ../classes/column.php:345, ../classes/column.php:2531
65
+ msgid "Custom"
66
+ msgstr ""
67
+
68
+ #: ../classes/column.php:1433
69
+ msgid "Thumbnail"
70
  msgstr ""
71
 
72
+ #: ../classes/column.php:1435
73
+ msgid "Medium"
74
  msgstr ""
75
 
76
+ #: ../classes/column.php:1437
77
+ msgid "Large"
78
  msgstr ""
79
 
80
+ #: ../classes/column.php:1439
81
+ msgid "Full"
82
  msgstr ""
83
 
84
+ #: ../classes/column.php:2373
85
  msgid "Date Format"
86
  msgstr ""
87
 
88
+ #: ../classes/column.php:2375
89
  msgid "This will determine how the date will be displayed."
90
  msgstr ""
91
 
92
+ #: ../classes/column.php:2385
93
  msgid "Example:"
94
  msgstr ""
95
 
96
+ #: ../classes/column.php:2391
97
  msgid "Leave empty for WordPress date format, change your <a href='%s'>default date format here</a>."
98
  msgstr ""
99
 
100
+ #: ../classes/column.php:2393
101
  msgid "Documentation on date and time formatting."
102
  msgstr ""
103
 
104
+ #: ../classes/column.php:2421
105
  msgid "Excerpt length"
106
  msgstr ""
107
 
108
+ #: ../classes/column.php:2423
109
  msgid "Number of words"
110
  msgstr ""
111
 
112
+ #: ../classes/column.php:2457
113
+ msgid "Link label"
114
  msgstr ""
115
 
116
+ #: ../classes/column.php:2459
117
+ msgid "Leave blank to display the url"
118
+ msgstr ""
119
+
120
+ #: ../classes/column.php:2495
121
+ msgid "Preview size"
122
  msgstr ""
123
 
124
+ #: ../classes/column.php:2539, ../classes/column.php:2873
125
  msgid "width"
126
  msgstr ""
127
 
128
+ #: ../classes/column.php:2547
129
  msgid "height"
130
  msgstr ""
131
 
132
+ #: ../classes/column.php:2571
133
  msgid "Before"
134
  msgstr ""
135
 
136
+ #: ../classes/column.php:2571
137
  msgid "This text will appear before the custom field value."
138
  msgstr ""
139
 
140
+ #: ../classes/column.php:2573
141
  msgid "After"
142
  msgstr ""
143
 
144
+ #: ../classes/column.php:2573
145
  msgid "This text will appear after the custom field value."
146
  msgstr ""
147
 
148
+ #: ../classes/column.php:2591
149
  msgid "Display Name"
150
  msgstr ""
151
 
152
+ #: ../classes/column.php:2593
153
  msgid "First Name"
154
  msgstr ""
155
 
156
+ #: ../classes/column.php:2595
157
  msgid "Last Name"
158
  msgstr ""
159
 
160
+ #: ../classes/column.php:2597, ../classes/column/user/nickname.php:37
161
  msgid "Nickname"
162
  msgstr ""
163
 
164
+ #: ../classes/column.php:2599
165
  msgid "User Login"
166
  msgstr ""
167
 
168
+ #: ../classes/column.php:2601
169
  msgid "User Email"
170
  msgstr ""
171
 
172
+ #: ../classes/column.php:2603, ../classes/column/user/ID.php:35
173
  msgid "User ID"
174
  msgstr ""
175
 
176
+ #: ../classes/column.php:2605
177
  msgid "First and Last Name"
178
  msgstr ""
179
 
180
+ #: ../classes/column.php:2611
181
  msgid "Display format"
182
  msgstr ""
183
 
184
+ #: ../classes/column.php:2611
185
  msgid "This is the format of the author name."
186
  msgstr ""
187
 
188
+ #: ../classes/column.php:2917
189
  msgid "Edit"
190
  msgstr ""
191
 
192
+ #: ../classes/column.php:2921, ../classes/column.php:3127
193
  msgid "Clone"
194
  msgstr ""
195
 
196
+ #: ../classes/column.php:2925
197
  msgid "Remove"
198
  msgstr ""
199
 
200
+ #: ../classes/column.php:2961, ../classes/column.php:2961, ../classes/column/custom-field.php:466, ../classes/column/comment/type.php:27
201
  msgid "Type"
202
  msgstr ""
203
 
204
+ #: ../classes/column.php:2961
205
  msgid "Choose a column type."
206
  msgstr ""
207
 
208
+ #: ../classes/column.php:2961
209
  msgid "Name"
210
  msgstr ""
211
 
212
+ #: ../classes/column.php:2983
213
  msgid "Label"
214
  msgstr ""
215
 
216
+ #: ../classes/column.php:2983
217
  msgid "This is the name which will appear as the column header."
218
  msgstr ""
219
 
220
+ #: ../classes/column.php:2997, ../classes/column/media/width.php:25
221
  msgid "Width"
222
  msgstr ""
223
 
224
+ #: ../classes/column.php:3001
225
  msgid "default"
226
  msgstr ""
227
 
228
+ #: ../classes/column.php:3003
229
  msgid "auto"
230
  msgstr ""
231
 
232
+ #: ../classes/column.php:3171
233
  msgid "Property To Display"
234
  msgstr ""
235
 
236
+ #: ../classes/column.php:3183
237
  msgid "Post property to display for related post(s)."
238
  msgstr ""
239
 
240
+ #: ../classes/column.php:3207, ../classes/column/post/author-name.php:179
241
  msgid "Link To"
242
  msgstr ""
243
 
244
+ #: ../classes/column.php:3217
245
  msgid "Edit Post Author"
246
  msgstr ""
247
 
248
+ #: ../classes/column.php:3219
249
  msgid "View Public Post Author Page"
250
  msgstr ""
251
 
252
+ #: ../classes/column.php:3223
253
  msgid "Page the posts should link to."
254
  msgstr ""
255
 
256
+ #: ../classes/column.php:3243
257
  msgid "The %s column is only available in Admin Columns Pro - Business or Developer."
258
  msgstr ""
259
 
260
+ #: ../classes/column.php:3251
261
  msgid "If you have a business or developer licence please download & install your %s add-on from the <a href='%s'>add-ons tab</a>."
262
  msgstr ""
263
 
264
+ #: ../classes/column.php:3259
265
  msgid "Admin Columns Pro offers full %s integration, allowing you to easily display and edit %s fields from within your overview."
266
  msgstr ""
267
 
268
+ #: ../classes/column.php:3271
269
  msgid "Find out more"
270
  msgstr ""
271
 
272
+ #: ../classes/review_notice.php:109, ../classes/settings.php:371, ../classes/settings.php:1425, ../classes/upgrade.php:269
273
  msgid "Admin Columns"
274
  msgstr ""
275
 
321
  msgid "find answers to some frequently asked questions"
322
  msgstr ""
323
 
324
+ #: ../classes/settings.php:235
325
  msgid "Add-on successfully activated."
326
  msgstr ""
327
 
328
+ #: ../classes/settings.php:241
329
  msgid "Add-on successfully deactivated."
330
  msgstr ""
331
 
332
+ #: ../classes/settings.php:371
333
  msgid "Admin Columns Settings"
334
  msgstr ""
335
 
336
+ #: ../classes/settings.php:499
337
  msgid "%s column is already present and can not be duplicated."
338
  msgstr ""
339
 
340
+ #: ../classes/settings.php:501
341
+ msgid "Invalid response."
342
+ msgstr ""
343
+
344
+ #: ../classes/settings.php:581
345
+ msgid "Settings for %s updated successfully."
346
+ msgstr ""
347
+
348
+ #: ../classes/settings.php:583
349
+ msgid "View %s screen"
350
+ msgstr ""
351
+
352
+ #: ../classes/settings.php:647
353
+ msgid "Settings for %s restored successfully."
354
+ msgstr ""
355
+
356
+ #: ../classes/settings.php:695
357
  msgid "Default settings succesfully restored."
358
  msgstr ""
359
 
360
+ #: ../classes/settings.php:731
361
  msgid "Overview"
362
  msgstr ""
363
 
364
+ #: ../classes/settings.php:735
365
  msgid "This plugin is for adding and removing additional columns to the administration screens for post(types), pages, media library, comments, links and users. Change the column's label and reorder them."
366
  msgstr ""
367
 
368
+ #: ../classes/settings.php:741
369
  msgid "Basics"
370
  msgstr ""
371
 
372
+ #: ../classes/settings.php:745
373
  msgid "Change order"
374
  msgstr ""
375
 
376
+ #: ../classes/settings.php:747
377
  msgid "By dragging the columns you can change the order which they will appear in."
378
  msgstr ""
379
 
380
+ #: ../classes/settings.php:749
381
  msgid "Change label"
382
  msgstr ""
383
 
384
+ #: ../classes/settings.php:751
385
  msgid "By clicking on the triangle you will see the column options. Here you can change each label of the columns heading."
386
  msgstr ""
387
 
388
+ #: ../classes/settings.php:753
389
  msgid "Change column width"
390
  msgstr ""
391
 
392
+ #: ../classes/settings.php:755
393
  msgid "By clicking on the triangle you will see the column options. By using the draggable slider you can set the width of the columns in percentages."
394
  msgstr ""
395
 
396
+ #: ../classes/settings.php:763, ../classes/column/custom-field.php:24, ../classes/column/custom-field.php:26, ../classes/column/custom-field.php:447, ../classes/column/custom-field.php:451
397
  msgid "Custom Field"
398
  msgstr ""
399
 
400
+ #: ../classes/settings.php:765
401
  msgid "'Custom Field' column"
402
  msgstr ""
403
 
404
+ #: ../classes/settings.php:767
405
  msgid "The custom field colum uses the custom fields from posts and users. There are 10 types which you can set."
406
  msgstr ""
407
 
408
+ #: ../classes/settings.php:771, ../classes/storage_model.php:1715, ../classes/column/custom-field.php:97, ../classes/column/default.php:22
409
  msgid "Default"
410
  msgstr ""
411
 
412
+ #: ../classes/settings.php:771
413
  msgid "Value: Can be either a string or array. Arrays will be flattened and values are seperated by a ',' comma."
414
  msgstr ""
415
 
416
+ #: ../classes/settings.php:773
417
+ msgid "Checkmark"
418
  msgstr ""
419
 
420
+ #: ../classes/settings.php:773
421
+ msgid "Value: should be a 1 (one) or 0 (zero)."
422
  msgstr ""
423
 
424
+ #: ../classes/settings.php:775, ../classes/column/custom-field.php:99
425
+ msgid "Color"
426
  msgstr ""
427
 
428
+ #: ../classes/settings.php:775
429
+ msgid "Value: hex value color, such as #808080."
430
  msgstr ""
431
 
432
+ #: ../classes/settings.php:777, ../classes/column/custom-field.php:100
433
+ msgid "Counter"
434
  msgstr ""
435
 
436
+ #: ../classes/settings.php:777
437
+ msgid "Value: Can be either a string or array. This will display a count of the number of times the meta key is used by the item."
438
  msgstr ""
439
 
440
+ #: ../classes/settings.php:779, ../classes/column/custom-field.php:101, ../classes/column/comment/date.php:37
441
+ msgid "Date"
442
  msgstr ""
443
 
444
+ #: ../classes/settings.php:779
445
+ msgid "Value: Can be unix time stamp or a date format as described in the <a href='%s'>Codex</a>. You can change the outputted date format at the <a href='%s'>general settings</a> page."
446
  msgstr ""
447
 
448
+ #: ../classes/settings.php:781, ../classes/column/post/excerpt.php:37
449
+ msgid "Excerpt"
450
  msgstr ""
451
 
452
+ #: ../classes/settings.php:781
453
+ msgid "Value: This will show the first 20 words of the Post content."
454
  msgstr ""
455
 
456
+ #: ../classes/settings.php:783, ../classes/column/custom-field.php:103, ../classes/column/link/image.php:37
457
+ msgid "Image"
458
  msgstr ""
459
 
460
+ #: ../classes/settings.php:783
461
+ msgid "Value: should contain an image URL or Attachment IDs ( seperated by a ',' comma )."
462
  msgstr ""
463
 
464
+ #: ../classes/settings.php:785, ../classes/column/custom-field.php:104
465
+ msgid "Media Library"
466
  msgstr ""
467
 
468
+ #: ../classes/settings.php:785
469
+ msgid "Value: should contain Attachment IDs ( seperated by a ',' comma )."
470
  msgstr ""
471
 
472
+ #: ../classes/settings.php:787, ../classes/column/custom-field.php:106
473
+ msgid "Multiple Values"
474
  msgstr ""
475
 
476
+ #: ../classes/settings.php:787
477
+ msgid "Value: should be an array. This will flatten any ( multi dimensional ) array."
478
  msgstr ""
479
 
480
+ #: ../classes/settings.php:789, ../classes/column/custom-field.php:107
481
+ msgid "Numeric"
482
  msgstr ""
483
 
484
+ #: ../classes/settings.php:789
485
+ msgid "Value: Integers only.<br/>If you have the 'sorting addon' this will be used for sorting, so you can sort your posts on numeric (custom field) values."
486
  msgstr ""
487
 
488
+ #: ../classes/settings.php:791
489
+ msgid "Post Titles"
490
  msgstr ""
491
 
492
+ #: ../classes/settings.php:791
493
+ msgid "Value: can be one or more Post ID's (seperated by ',')."
494
+ msgstr ""
495
+
496
+ #: ../classes/settings.php:793
497
+ msgid "Usernames"
498
+ msgstr ""
499
+
500
+ #: ../classes/settings.php:793
501
+ msgid "Value: can be one or more User ID's (seperated by ',')."
502
+ msgstr ""
503
+
504
+ #: ../classes/settings.php:795
505
+ msgid "Term Name"
506
  msgstr ""
507
 
508
+ #: ../classes/settings.php:795
509
+ msgid "Value: should be an array with term_id and taxonomy."
510
+ msgstr ""
511
+
512
+ #: ../classes/settings.php:957
513
  msgid "Welcome to Admin Columns"
514
  msgstr ""
515
 
516
+ #: ../classes/settings.php:963
517
  msgid "Thank you for updating to the latest version!"
518
  msgstr ""
519
 
520
+ #: ../classes/settings.php:965
521
  msgid "Admin Columns is more polished and enjoyable than ever before. We hope you like it."
522
  msgstr ""
523
 
524
+ #: ../classes/settings.php:979
525
  msgid "What’s New"
526
  msgstr ""
527
 
528
+ #: ../classes/settings.php:985
529
  msgid "Changelog"
530
  msgstr ""
531
 
532
+ #: ../classes/settings.php:995
533
  msgid "Important"
534
  msgstr ""
535
 
536
+ #: ../classes/settings.php:999
537
  msgid "Database Changes"
538
  msgstr ""
539
 
540
+ #: ../classes/settings.php:1001
541
  msgid "The database has been changed between versions 1 and 2. But we made sure you can still roll back to version 1x without any issues."
542
  msgstr ""
543
 
544
+ #: ../classes/settings.php:1007
545
  msgid "Make sure you backup your database and then click"
546
  msgstr ""
547
 
548
+ #: ../classes/settings.php:1009, ../classes/upgrade.php:285
549
  msgid "Upgrade Database"
550
  msgstr ""
551
 
552
+ #: ../classes/settings.php:1017
553
  msgid "Potential Issues"
554
  msgstr ""
555
 
556
+ #: ../classes/settings.php:1019
557
  msgid "Do to the sizable refactoring the code, surounding Addons and action/filters, your website may not operate correctly. It is important that you read the full"
558
  msgstr ""
559
 
560
+ #: ../classes/settings.php:1021
561
  msgid "Migrating from v1 to v2"
562
  msgstr ""
563
 
564
+ #: ../classes/settings.php:1021
565
  msgid "guide to view the full list of changes."
566
  msgstr ""
567
 
568
+ #: ../classes/settings.php:1021
569
  msgid "When you have found a bug please <a href='%s'>report them to us</a> so we can fix it in the next release."
570
  msgstr ""
571
 
572
+ #: ../classes/settings.php:1031
573
  msgid "Important!"
574
  msgstr ""
575
 
576
+ #: ../classes/settings.php:1031
577
  msgid "If you updated the Admin Columns plugin without prior knowledge of such changes, Please roll back to the latest"
578
  msgstr ""
579
 
580
+ #: ../classes/settings.php:1033
581
  msgid "version 1"
582
  msgstr ""
583
 
584
+ #: ../classes/settings.php:1033
585
  msgid "of this plugin."
586
  msgstr ""
587
 
588
+ #: ../classes/settings.php:1047
589
  msgid "Changelog for"
590
  msgstr ""
591
 
592
+ #: ../classes/settings.php:1081, ../classes/upgrade.php:125
593
  msgid "Learn more"
594
  msgstr ""
595
 
596
+ #: ../classes/settings.php:1103
597
  msgid "Start using Admin Columns"
598
  msgstr ""
599
 
600
+ #: ../classes/settings.php:1141
601
  msgid "General Settings"
602
  msgstr ""
603
 
604
+ #: ../classes/settings.php:1145
605
  msgid "Customize your Admin Columns settings."
606
  msgstr ""
607
 
608
+ #: ../classes/settings.php:1167
609
  msgid "Show \"Edit Columns\" button on admin screens. Default is <code>on</code>."
610
  msgstr ""
611
 
612
+ #: ../classes/settings.php:1261
613
  msgid "Restore Settings"
614
  msgstr ""
615
 
616
+ #: ../classes/settings.php:1263
617
  msgid "This will delete all column settings and restore the default settings."
618
  msgstr ""
619
 
620
+ #: ../classes/settings.php:1275
621
  msgid "Restore default settings"
622
  msgstr ""
623
 
624
+ #: ../classes/settings.php:1275
625
  msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. 'OK' to delete, 'Cancel' to stop"
626
  msgstr ""
627
 
628
+ #: ../classes/settings.php:1427
 
 
 
 
 
 
 
 
 
 
 
 
629
  msgid "Settings"
630
  msgstr ""
631
 
632
+ #: ../classes/settings.php:1429
633
  msgid "Add-ons"
634
  msgstr ""
635
 
636
+ #: ../classes/settings.php:1597
 
 
 
 
637
  msgid "Store settings"
638
  msgstr ""
639
 
640
+ #: ../classes/settings.php:1631
641
  msgid "Warning! The %s columns data will be deleted. This cannot be undone. 'OK' to delete, 'Cancel' to stop"
642
  msgstr ""
643
 
644
+ #: ../classes/settings.php:1633
645
+ msgid "Restore columns"
 
 
 
 
646
  msgstr ""
647
 
648
+ #: ../classes/settings.php:1675
649
  msgid "Get Admin Columns Pro"
650
  msgstr ""
651
 
652
+ #: ../classes/settings.php:1687
653
  msgid "Add Sorting"
654
  msgstr ""
655
 
656
+ #: ../classes/settings.php:1693
657
  msgid "Add Filtering"
658
  msgstr ""
659
 
660
+ #: ../classes/settings.php:1699
661
  msgid "Add Import/Export"
662
  msgstr ""
663
 
664
+ #: ../classes/settings.php:1705
665
  msgid "Add Direct Editing"
666
  msgstr ""
667
 
668
+ #: ../classes/settings.php:1713
669
  msgid "Check out <a href='%s'>Admin Columns Pro</a> for more details!"
670
  msgstr ""
671
 
672
+ #: ../classes/settings.php:1729
673
  msgid "Are you happy with Admin Columns?"
674
  msgstr ""
675
 
676
+ #: ../classes/settings.php:1747
677
  msgid "What's wrong? Need help? Let us know!"
678
  msgstr ""
679
 
680
+ #: ../classes/settings.php:1751
681
  msgid "Check out our extensive documentation, or you can open a support topic on WordPress.org!"
682
  msgstr ""
683
 
684
+ #: ../classes/settings.php:1767
685
  msgid "Docs"
686
  msgstr ""
687
 
688
+ #: ../classes/settings.php:1779
689
  msgid "Forums"
690
  msgstr ""
691
 
692
+ #: ../classes/settings.php:1797
693
  msgid "Woohoo! We're glad to hear that!"
694
  msgstr ""
695
 
696
+ #: ../classes/settings.php:1801
697
  msgid "We would really love it if you could show your appreciation by giving us a rating on WordPress.org or tweet about Admin Columns!"
698
  msgstr ""
699
 
700
+ #: ../classes/settings.php:1809
701
  msgid "Rate"
702
  msgstr ""
703
 
704
+ #: ../classes/settings.php:1831
705
  msgid "Tweet"
706
  msgstr ""
707
 
708
+ #: ../classes/settings.php:1851
709
  msgid "Buy Pro"
710
  msgstr ""
711
 
712
+ #: ../classes/settings.php:1875
713
  msgid "Support"
714
  msgstr ""
715
 
716
+ #: ../classes/settings.php:1883
717
  msgid "Check the <strong>Help</strong> section in the top-right screen."
718
  msgstr ""
719
 
720
+ #: ../classes/settings.php:1889
721
  msgid "For full documentation, bug reports, feature suggestions and other tips <a href='%s'>visit the Admin Columns website</a>"
722
  msgstr ""
723
 
724
+ #: ../classes/settings.php:1913
725
+ msgid "Please visit the %s screen once to load all available columns"
726
+ msgstr ""
727
+
728
+ #: ../classes/settings.php:1931
729
+ msgid "The columns for %s are set up via PHP and can therefore not be edited"
730
+ msgstr ""
731
+
732
+ #: ../classes/settings.php:1989
733
  msgid "Drag and drop to reorder"
734
  msgstr ""
735
 
736
+ #: ../classes/settings.php:1995
737
  msgid "Add Column"
738
  msgstr ""
739
 
740
+ #: ../classes/settings.php:2163
741
  msgid "Active"
742
  msgstr ""
743
 
744
+ #: ../classes/settings.php:2165
745
  msgid "Deactivate"
746
  msgstr ""
747
 
748
+ #: ../classes/settings.php:2179
749
  msgid "Installed"
750
  msgstr ""
751
 
752
+ #: ../classes/settings.php:2181
753
  msgid "Activate"
754
  msgstr ""
755
 
756
+ #: ../classes/settings.php:2209
757
  msgid "Download & Install"
758
  msgstr ""
759
 
760
+ #: ../classes/settings.php:2219
761
  msgid "Get this add-on"
762
  msgstr ""
763
 
764
+ #: ../classes/storage_model.php:423
765
+ msgid "Columns by Plugins"
766
  msgstr ""
767
 
768
+ #: ../classes/storage_model.php:737
769
+ msgid "Other"
770
  msgstr ""
771
 
772
+ #: ../classes/storage_model.php:1411
773
+ msgid "No columns settings available."
 
 
 
 
774
  msgstr ""
775
 
776
+ #: ../classes/storage_model.php:1453
777
+ msgid "You are trying to store the same settings for %s."
778
  msgstr ""
779
 
780
+ #: ../classes/storage_model.php:2117
781
  msgid "View"
782
  msgstr ""
783
 
841
  msgid "Advanced Custom Field"
842
  msgstr ""
843
 
844
+ #: ../classes/column/actions.php:59, ../classes/column/link/actions.php:37
845
  msgid "Actions"
846
  msgstr ""
847
 
848
+ #: ../classes/column/actions.php:195
849
  msgid "Use icons?"
850
  msgstr ""
851
 
852
+ #: ../classes/column/actions.php:195
853
  msgid "Use icons instead of text for displaying the actions."
854
  msgstr ""
855
 
856
+ #: ../classes/column/custom-field.php:98
857
  msgid "Checkmark (true/false)"
858
  msgstr ""
859
 
860
+ #: ../classes/column/custom-field.php:105, ../classes/column/user/url.php:35
861
+ msgid "Url"
862
  msgstr ""
863
 
864
+ #: ../classes/column/custom-field.php:108
865
  msgid "Post Title (Post ID's)"
866
  msgstr ""
867
 
868
+ #: ../classes/column/custom-field.php:109
869
  msgid "Username (User ID's)"
870
  msgstr ""
871
 
872
+ #: ../classes/column/custom-field.php:110
873
  msgid "Term Name (Term ID's)"
874
  msgstr ""
875
 
876
+ #: ../classes/column/custom-field.php:427
877
+ msgid "Hidden Custom Fields"
878
+ msgstr ""
879
+
880
+ #: ../classes/column/custom-field.php:427
881
+ msgid "Custom Fields"
882
+ msgstr ""
883
+
884
+ #: ../classes/column/custom-field.php:447
885
+ msgid "Enter your custom field key."
886
+ msgstr ""
887
+
888
+ #: ../classes/column/custom-field.php:451
889
  msgid "Select your custom field."
890
  msgstr ""
891
 
892
+ #: ../classes/column/custom-field.php:458
893
  msgid "No custom fields available."
894
  msgstr ""
895
 
896
+ #: ../classes/column/custom-field.php:458
897
  msgid "Please create a %s item first."
898
  msgstr ""
899
 
900
+ #: ../classes/column/custom-field.php:466
901
  msgid "Field Type"
902
  msgstr ""
903
 
904
+ #: ../classes/column/custom-field.php:466
905
  msgid "This will determine how the value will be displayed."
906
  msgstr ""
907
 
913
  msgid "Used by Menu"
914
  msgstr ""
915
 
916
+ #: ../classes/column/used-by-menu.php:259
917
  msgid "Link to menu"
918
  msgstr ""
919
 
920
+ #: ../classes/column/used-by-menu.php:259
921
  msgid "This will make the title link to the menu."
922
  msgstr ""
923
 
924
+ #: ../classes/storage_model/post.php:35, ../classes/column/user/post-count.php:175
925
+ msgid "Post Type"
926
+ msgstr ""
927
+
928
+ #: ../classes/third_party/wpml.php:117
929
+ msgid "WPML Flags"
930
+ msgstr ""
931
+
932
  #: ../classes/column/comment/ID.php:37, ../classes/column/link/ID.php:37, ../classes/column/media/ID.php:37, ../classes/column/post/ID.php:37
933
  msgid "ID"
934
  msgstr ""
937
  msgid "Agent"
938
  msgstr ""
939
 
940
+ #: ../classes/column/comment/approved.php:39, ../classes/column/post/comment-count.php:61
941
  msgid "Approved"
942
  msgstr ""
943
 
981
  msgid "In Reply To"
982
  msgstr ""
983
 
984
+ #: ../classes/column/comment/status.php:39, ../classes/column/post/status.php:41
985
+ msgid "Status"
986
+ msgstr ""
987
+
988
  #: ../classes/column/comment/user.php:21
989
  msgid "User"
990
  msgstr ""
991
 
992
+ #: ../classes/column/comment/word-count.php:37, ../classes/column/post/word-count.php:33
993
  msgid "Word count"
994
  msgstr ""
995
 
996
+ #: ../classes/column/link/description.php:37, ../classes/column/media/description.php:39, ../classes/column/user/description.php:35
997
  msgid "Description"
998
  msgstr ""
999
 
1037
  msgid "Caption"
1038
  msgstr ""
1039
 
1040
+ #: ../classes/column/media/dimensions.php:39
1041
  msgid "Dimensions"
1042
  msgstr ""
1043
 
1089
  msgid "File size"
1090
  msgstr ""
1091
 
1092
+ #: ../classes/column/media/full-path.php:39, ../classes/column/media/full-path.php:179
1093
  msgid "Full path"
1094
  msgstr ""
1095
 
1096
+ #: ../classes/column/media/full-path.php:161
1097
  msgid "Path scope"
1098
  msgstr ""
1099
 
1100
+ #: ../classes/column/media/full-path.php:163
1101
  msgid "Part of the file path to display"
1102
  msgstr ""
1103
 
1104
+ #: ../classes/column/media/full-path.php:189
1105
  msgid "Relative to domain"
1106
  msgstr ""
1107
 
1108
+ #: ../classes/column/media/full-path.php:199
1109
  msgid "Relative to main uploads folder "
1110
  msgstr ""
1111
 
1112
+ #: ../classes/column/media/height.php:27
1113
  msgid "Height"
1114
  msgstr ""
1115
 
1117
  msgid "Mime type"
1118
  msgstr ""
1119
 
1120
+ #: ../classes/column/user/display-name.php:33
1121
+ msgid "Display name"
1122
+ msgstr ""
1123
+
1124
+ #: ../classes/column/user/first-name.php:35
1125
+ msgid "First name"
1126
+ msgstr ""
1127
+
1128
+ #: ../classes/column/user/last-name.php:35
1129
+ msgid "Last name"
1130
+ msgstr ""
1131
+
1132
+ #: ../classes/column/user/post-count.php:37
1133
+ msgid "Post Count"
1134
+ msgstr ""
1135
+
1136
+ #: ../classes/column/user/registered.php:37
1137
+ msgid "Registered"
1138
+ msgstr ""
1139
+
1140
+ #: ../classes/column/user/rich-editing.php:25
1141
+ msgid "Visual Editor"
1142
+ msgstr ""
1143
+
1144
+ #: ../classes/column/post/attachment-count.php:27
1145
  msgid "No. of Attachments"
1146
  msgstr ""
1147
 
1149
  msgid "Attachments"
1150
  msgstr ""
1151
 
1152
+ #: ../classes/column/post/author-name.php:37
1153
  msgid "Display Author As"
1154
  msgstr ""
1155
 
1156
+ #: ../classes/column/post/author-name.php:189
1157
  msgid "View Public Author Page"
1158
  msgstr ""
1159
 
1160
+ #: ../classes/column/post/author-name.php:193
1161
  msgid "Page the author name should link to."
1162
  msgstr ""
1163
 
1165
  msgid "Before More Tag"
1166
  msgstr ""
1167
 
1168
+ #: ../classes/column/post/comment-count.php:35
1169
  msgid "Comment count"
1170
  msgstr ""
1171
 
1172
+ #: ../classes/column/post/comment-count.php:59
1173
  msgid "Total"
1174
  msgstr ""
1175
 
1176
+ #: ../classes/column/post/comment-count.php:63
1177
  msgid "Pending"
1178
  msgstr ""
1179
 
1180
+ #: ../classes/column/post/comment-count.php:65
1181
  msgid "Spam"
1182
  msgstr ""
1183
 
1184
+ #: ../classes/column/post/comment-count.php:67
1185
  msgid "Trash"
1186
  msgstr ""
1187
 
1188
+ #: ../classes/column/post/comment-count.php:181, ../classes/column/post/comment-status.php:39
1189
  msgid "Comment status"
1190
  msgstr ""
1191
 
1192
+ #: ../classes/column/post/comment-count.php:181
1193
  msgid "Select which comment status you like to display."
1194
  msgstr ""
1195
 
1196
+ #: ../classes/column/post/depth.php:33
1197
  msgid "Depth"
1198
  msgstr ""
1199
 
1200
+ #: ../classes/column/post/estimated-reading-time.php:35
1201
  msgid "Estimated Reading Time"
1202
  msgstr ""
1203
 
1204
+ #: ../classes/column/post/estimated-reading-time.php:127
1205
  msgid "second"
1206
  msgid_plural "seconds"
1207
  msgstr[0] ""
1208
  msgstr[1] ""
1209
 
1210
+ #: ../classes/column/post/estimated-reading-time.php:133
1211
  msgid "minute"
1212
  msgid_plural "minutes"
1213
  msgstr[0] ""
1214
  msgstr[1] ""
1215
 
1216
+ #: ../classes/column/post/estimated-reading-time.php:197
1217
  msgid "Words per minute"
1218
  msgstr ""
1219
 
1220
+ #: ../classes/column/post/estimated-reading-time.php:199
1221
  msgid "Estimated reading time in words per minute"
1222
  msgstr ""
1223
 
1237
  msgid "Last modified"
1238
  msgstr ""
1239
 
1240
+ #: ../classes/column/post/order.php:33
1241
  msgid "Order"
1242
  msgstr ""
1243
 
1244
+ #: ../classes/column/post/page-template.php:35
1245
  msgid "Page Template"
1246
  msgstr ""
1247
 
1248
+ #: ../classes/column/post/parent.php:35
1249
  msgid "Parent"
1250
  msgstr ""
1251
 
1265
  msgid "This will make the permalink clickable."
1266
  msgstr ""
1267
 
1268
+ #: ../classes/column/post/ping-status.php:35
1269
+ msgid "Ping Status"
1270
  msgstr ""
1271
 
1272
+ #: ../classes/column/post/roles.php:39
1273
  msgid "Roles"
1274
  msgstr ""
1275
 
1276
+ #: ../classes/column/post/shortcodes.php:39
1277
  msgid "Shortcodes"
1278
  msgstr ""
1279
 
1281
  msgid "Slug"
1282
  msgstr ""
1283
 
1284
+ #: ../classes/column/post/sticky.php:35
 
 
 
 
1285
  msgid "Sticky"
1286
  msgstr ""
1287
 
1288
  #: ../classes/column/post/title-raw.php:37
1289
  msgid "Title without actions"
1290
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, posts, media, users, pages, posttypes, manage columns, wp-admin
5
  Requires at least: 3.5
6
  Tested up to: 4.4.2
7
- Stable tag: 2.4.10
8
 
9
  Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
10
 
@@ -210,9 +210,59 @@ You can find a list of the available actions and filters (and examples on how to
210
 
211
  == Changelog ==
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  = 2.4.10 =
214
  * [Fixed] Data:image sources for images are supported in labels
215
  * [Fixed] Cloned columns no longer has the wrong options when stored
 
216
  * [Fixed] Created deprecated function for is_columns_screen()
217
  * [Fixed] The method get_current_storage_model returns the first occurrence instead of running the entire array of storage modals
218
  * [Fixed] The storage_model object should have the init_manage_columns method to properly load the columns heading and values
4
  Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, posts, media, users, pages, posttypes, manage columns, wp-admin
5
  Requires at least: 3.5
6
  Tested up to: 4.4.2
7
+ Stable tag: 2.5.2
8
 
9
  Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
10
 
210
 
211
  == Changelog ==
212
 
213
+ = 2.5.2 =
214
+ * [Fixed] Fixes an issue where some of the WordPress default columns did not display correctly
215
+
216
+ = 2.5.1 =
217
+ * [Fixed] Column settings are displayed correctly now
218
+
219
+ = 2.5 =
220
+ * [Updated] The main menu has been replaced with a single dropdown menu
221
+ * [Updated] Support for 3rd party columns from other themes or plugins has been greatly improved
222
+ * [Added] Added a new column: Comment status
223
+ * [Added] The width of default columns are now displayed
224
+ * [Improved] Improved JS loading
225
+ * [Improved] Replaced FamFam icons with dashicons
226
+ * [Improved] Column groups now uses full text strings
227
+ * [Fixed] Media actions columns no longer throws an error when the list table is not found
228
+ * [Fixed] Height and width columns for media will be appended with 'px'
229
+ * [Fixed] Most zero values will now be displayed as a dash
230
+ * [Fixed] Estimate time reading column will no longer display leading zero's on seconds
231
+ * [Fixed] Shortcodes column now display each shortcode name used once, with a counter
232
+ * [Fixed] Columns with an imagesize selection setting will have the a default option selected
233
+ * [Removed] Removed loading columns through 'load-edit.php' filter
234
+ * [Added] Column settings are now stored without the need to refresh the page (through ajax)
235
+ * [Added] You can disable the columns delete confirmation through this filter 'ac/delete_confirmation'
236
+ * [Improved] The width of default columns (e.g. date and author) are now displayed
237
+ * [Improved] bbPress columns are loaded correctly
238
+ * [Updated] All languages files have been updated from Transifex (https://www.transifex.com/codepress/admin-columns)
239
+ *
240
+ * [Developer notes]
241
+ * [Refactor] CPAC now is a singleton class
242
+ * [Refactor] Storage model has been refactored but should stay backwards compatible when extending
243
+ * [Refactor] CPAC_Column $storage_model variable has become private. Use CAPC_Column::get_storage_model() method.
244
+ * [Refactor] Storagemodel can now be extended to have column layouts/sets
245
+ * [Refactor:added] CPAC_Column::is_default() method added
246
+ * [Refactor:added] CPAC_Column::is_registered() method added
247
+ * [Refactor:added] CPAC_Column::get_empty_char() method added
248
+ * [Refactor:added] CPAC_Column_Storagemodel::get_column_types() method added
249
+ * [Refactor:added] CPAC_Column_Storagemodel::get_default_colummn_types() method added
250
+ * [Refactor:added] CPAC_Column_Storagemodel::get_column_type() method added
251
+ * [Refactor:added] CPAC_Column_Storagemodel::create_column() method added
252
+ * [Refactor:added] CPAC_Column_Storagemodel::flush_columns() method added
253
+ * [Refactor:added] CPAC_Column_Storagemodel::get_restore_link() method added
254
+ * [Refactor:changed] CPAC_Column_Storagemodel::get_columns()
255
+ * [Refactor:removed] CPAC_Column_Storagemodel::get_default_registered_columns() method removed
256
+ * [Refactor:removed] CPAC_Column_Storagemodel::get_custom_registered_columns() method removed
257
+ * [Refactor:removed] CPAC_Column_Storagemodel::set_stored_columns() method removed
258
+ * [Refactor:removed] CPAC_Column_Storagemodel::get_grouped_column_types() method removed
259
+ * [Refactor:removed] CPAC_Column_Storagemodel::set_columns() method removed
260
+ * [Refactor:removed] CPAC_Column_Storagemodel::set_stored_columns() method removed
261
+
262
  = 2.4.10 =
263
  * [Fixed] Data:image sources for images are supported in labels
264
  * [Fixed] Cloned columns no longer has the wrong options when stored
265
+ * [Added] Added an extra update button to the bottom of the settings page
266
  * [Fixed] Created deprecated function for is_columns_screen()
267
  * [Fixed] The method get_current_storage_model returns the first occurrence instead of running the entire array of storage modals
268
  * [Fixed] The storage_model object should have the init_manage_columns method to properly load the columns heading and values