Admin Columns - Version 2.2.5

Version Description

  • [Fixed] Error with actions icons.
  • [Added] New Column! Used-by-menu column; will display in which menu a post/page/taxonomy is being used. With support for column sorting in posts.
  • [Fixed] Only ajax calls from cpac will trigger the loading of storage_models now.
Download this release

Release Info

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

Code changes from version 2.2.4 to 2.2.5

Files changed (105) hide show
  1. README.md +0 -0
  2. assets/images/addon_sortable_1.png +0 -0
  3. assets/images/arrows.png +0 -0
  4. assets/images/checkbox.png +0 -0
  5. assets/images/checkmark.png +0 -0
  6. assets/images/checkmark_single.png +0 -0
  7. assets/images/comment_edit.png +0 -0
  8. assets/images/cross.png +0 -0
  9. assets/images/facebook.png +0 -0
  10. assets/images/icon.png +0 -0
  11. assets/images/import_export.png +0 -0
  12. assets/images/information.png +0 -0
  13. assets/images/loading.gif +0 -0
  14. assets/images/no.png +0 -0
  15. assets/images/settings.png +0 -0
  16. assets/images/sort.png +0 -0
  17. assets/images/square.png +0 -0
  18. assets/images/trash.png +0 -0
  19. assets/images/twitter.png +0 -0
  20. assets/js/admin-columns.js +1 -1
  21. assets/js/admin-settings.js +2 -1
  22. assets/js/admin-settings.min.js +1 -1
  23. classes/column.php +4 -7
  24. classes/column/acf-placeholder.php +1 -1
  25. classes/column/comment/ID.php +1 -1
  26. classes/column/comment/actions.php +1 -1
  27. classes/column/comment/agent.php +1 -1
  28. classes/column/comment/approved.php +1 -1
  29. classes/column/comment/author-avatar.php +1 -1
  30. classes/column/comment/author-email.php +1 -1
  31. classes/column/comment/author-ip.php +1 -1
  32. classes/column/comment/author-url.php +1 -1
  33. classes/column/comment/author.php +1 -1
  34. classes/column/comment/date-gmt.php +1 -1
  35. classes/column/comment/date.php +1 -1
  36. classes/column/comment/excerpt.php +1 -1
  37. classes/column/comment/reply-to.php +1 -1
  38. classes/column/comment/word-count.php +1 -1
  39. classes/column/custom-field.php +1 -1
  40. classes/column/default.php +4 -4
  41. classes/column/link/ID.php +1 -1
  42. classes/column/link/actions.php +2 -2
  43. classes/column/link/description.php +1 -1
  44. classes/column/link/image.php +1 -1
  45. classes/column/link/length.php +1 -1
  46. classes/column/link/notes.php +1 -1
  47. classes/column/link/owner.php +1 -1
  48. classes/column/link/rss.php +1 -1
  49. classes/column/link/target.php +1 -1
  50. classes/column/media/ID.php +1 -1
  51. classes/column/media/actions.php +1 -1
  52. classes/column/media/alternate-text.php +1 -1
  53. classes/column/media/available-sizes.php +1 -1
  54. classes/column/media/caption.php +1 -1
  55. classes/column/media/description.php +1 -1
  56. classes/column/media/dimensions.php +1 -1
  57. classes/column/media/exif-data.php +1 -1
  58. classes/column/media/file-name.php +1 -1
  59. classes/column/media/file-size.php +1 -1
  60. classes/column/media/full-path.php +1 -1
  61. classes/column/media/height.php +1 -1
  62. classes/column/media/mime-type.php +1 -1
  63. classes/column/media/width.php +1 -1
  64. classes/column/post/ID.php +1 -1
  65. classes/column/post/actions.php +83 -7
  66. classes/column/post/attachment-count.php +1 -1
  67. classes/column/post/attachment.php +1 -1
  68. classes/column/post/author-name.php +1 -1
  69. classes/column/post/before-moretag.php +1 -1
  70. classes/column/post/comment-count.php +1 -1
  71. classes/column/post/comment-status.php +1 -2
  72. classes/column/post/excerpt.php +1 -1
  73. classes/column/post/featured-image.php +1 -1
  74. classes/column/post/formats.php +7 -4
  75. classes/column/post/modified.php +1 -1
  76. classes/column/post/order.php +1 -1
  77. classes/column/post/page-template.php +1 -1
  78. classes/column/post/parent.php +1 -1
  79. classes/column/post/permalink.php +1 -2
  80. classes/column/post/ping-status.php +1 -1
  81. classes/column/post/roles.php +1 -1
  82. classes/column/post/slug.php +1 -1
  83. classes/column/post/status.php +1 -1
  84. classes/column/post/sticky.php +1 -1
  85. classes/column/post/title-raw.php +39 -0
  86. classes/column/post/word-count.php +1 -1
  87. classes/column/taxonomy.php +2 -2
  88. classes/column/used-by-menu.php +146 -0
  89. classes/column/user/ID.php +1 -1
  90. classes/column/user/actions.php +1 -1
  91. classes/column/user/comment-count.php +1 -1
  92. classes/column/user/description.php +1 -1
  93. classes/column/user/first-name.php +1 -1
  94. classes/column/user/last-name.php +1 -1
  95. classes/column/user/nickname.php +1 -1
  96. classes/column/user/post-count.php +1 -1
  97. classes/column/user/registered.php +1 -1
  98. classes/column/user/url.php +1 -1
  99. classes/settings.php +4 -1
  100. classes/storage_model.php +21 -9
  101. classes/storage_model/post.php +1 -0
  102. codepress-admin-columns.php +19 -23
  103. external/floatthead/jquery.floatThead.js +757 -0
  104. languages/cpac-fr_FR.po +91 -102
  105. readme.txt +6 -1
README.md ADDED
File without changes
assets/images/addon_sortable_1.png CHANGED
File without changes
assets/images/arrows.png CHANGED
File without changes
assets/images/checkbox.png CHANGED
File without changes
assets/images/checkmark.png CHANGED
File without changes
assets/images/checkmark_single.png CHANGED
File without changes
assets/images/comment_edit.png CHANGED
File without changes
assets/images/cross.png CHANGED
File without changes
assets/images/facebook.png CHANGED
File without changes
assets/images/icon.png CHANGED
File without changes
assets/images/import_export.png CHANGED
File without changes
assets/images/information.png CHANGED
File without changes
assets/images/loading.gif CHANGED
File without changes
assets/images/no.png CHANGED
File without changes
assets/images/settings.png CHANGED
File without changes
assets/images/sort.png CHANGED
File without changes
assets/images/square.png CHANGED
File without changes
assets/images/trash.png CHANGED
File without changes
assets/images/twitter.png CHANGED
File without changes
assets/js/admin-columns.js CHANGED
@@ -1,6 +1,6 @@
1
  jQuery( document ).ready( function( $ ) {
2
  cpac_tooltips();
3
-
4
  if ( typeof CPAC.storage_model !== 'undefined' && CPAC.storage_model.is_table_header_fixed ) {
5
  cpac_floatingheader();
6
  }
1
  jQuery( document ).ready( function( $ ) {
2
  cpac_tooltips();
3
+
4
  if ( typeof CPAC.storage_model !== 'undefined' && CPAC.storage_model.is_table_header_fixed ) {
5
  cpac_floatingheader();
6
  }
assets/js/admin-settings.js CHANGED
@@ -111,11 +111,12 @@ jQuery.fn.cpac_column_refresh = function() {
111
 
112
  // Fetch new form HTML
113
  jQuery.post( ajaxurl, {
 
114
  action: 'cpac_column_refresh',
115
  column: jQuery( this ).find( 'input.column-name' ).val(),
116
  formdata: jQuery( this ).parents( 'form' ).serialize()
117
  }, function( data ) {
118
- console.log(data);
119
  // Replace current form by new form
120
  var newel = jQuery( '<div>' + data + '</div>' ).children();
121
  el.replaceWith( newel );
111
 
112
  // Fetch new form HTML
113
  jQuery.post( ajaxurl, {
114
+ plugin_id: 'cpac',
115
  action: 'cpac_column_refresh',
116
  column: jQuery( this ).find( 'input.column-name' ).val(),
117
  formdata: jQuery( this ).parents( 'form' ).serialize()
118
  }, function( data ) {
119
+
120
  // Replace current form by new form
121
  var newel = jQuery( '<div>' + data + '</div>' ).children();
122
  el.replaceWith( newel );
assets/js/admin-settings.min.js CHANGED
@@ -1,4 +1,4 @@
1
  /*
2
  * Fires when the dom is ready
3
  *
4
- */function cpac_importexport(){jQuery("#php-export-results textarea").on("focus, mouseup",function(){jQuery(this).select()}).select().focus()}function cpac_addons(){}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_add_column(){jQuery("#cpac .add_column").click(function(e){var t=jQuery(this).closest(".columns-container"),n=jQuery(".for-cloning-only .cpac-column",t).first().clone(),r=t.attr("data-type");if(n.length>0){n.cpac_update_clone_id(r);jQuery(".cpac-columns form",t).append(n);n.column_bind_toggle();n.column_bind_remove();n.column_bind_events();n.addClass("opened").find(".column-form").slideDown(150,function(){jQuery("html, body").animate({scrollTop:n.offset().top-58},300)});cpac_sortable();jQuery(document).trigger("column_add",n)}e.preventDefault()})}function cpac_sidebar_feedback(){jQuery(function(e){var t=e(".sidebox#direct-feedback");t.find("#feedback-choice a.no").click(function(e){e.preventDefault();t.find("#feedback-choice").slideUp();t.find("#feedback-support").slideDown()});t.find("#feedback-choice a.yes").click(function(e){e.preventDefault();t.find("#feedback-choice").slideUp();t.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 t=jQuery("#contextual-help-wrap");t.parent().show();jQuery('a[href="#tab-panel-cpac-'+jQuery(this).attr("data-help")+'"]',t).trigger("click");t.slideDown("fast",function(){t.focus()})})}function cpac_pointer(){jQuery(".cpac-pointer").each(function(){var e=jQuery(this),t=e.attr("rel"),n=e.attr("data-pos"),r={at:"left top",my:"right top",edge:"right",offset:"0 0"};"right"==n&&(r={at:"right middle",my:"left middle",edge:"left"});e.pointer({content:jQuery("#"+t).html(),position:r,pointerWidth:250,close:function(){e.removeClass("open")},pointerClass:"wp-pointer wp-pointer-"+r.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,t){var n=jQuery(this).attr("href");if(n){var r=n.replace("#cpac-box-","");jQuery(".cpac-menu a").removeClass("current");jQuery(".columns-container").hide();jQuery(this).addClass("current");var i=jQuery('.columns-container[data-type="'+r+'"]').show(),s=i.find(".cpac-columns");jQuery(document).trigger("cac_menu_change",s)}e.preventDefault()});e.find("a.current").trigger("click")}jQuery(document).ready(function(){if(jQuery("#cpac").length===0)return!1;cpac_pointer();cpac_submit_form();cpac_clear_input_defaults();cpac_sortable();cpac_menu();cpac_help();cpac_add_column();cpac_addons();cpac_importexport();cpac_sidebar_feedback();jQuery(".cpac-column").each(function(e,t){jQuery(t).column_bind_toggle();jQuery(t).column_bind_remove();jQuery(t).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(t){t.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.cpac_column_refresh=function(){var e=jQuery(this);e.addClass("loading");e.find(".column-form").prepend('<span class="spinner" />');jQuery.post(ajaxurl,{action:"cpac_column_refresh",column:jQuery(this).find("input.column-name").val(),formdata:jQuery(this).parents("form").serialize()},function(t){console.log(t);var n=jQuery("<div>"+t+"</div>").children();e.replaceWith(n);e=n;e.column_bind_toggle();e.column_bind_remove();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),t=e.closest(".columns-container "),n=t.attr("data-type"),r=e.find(".column_type select option:selected").val();e.find(".column_type select").change(function(){var i=jQuery("optgroup",this).children(":selected"),s=i.val(),o=i.text(),u=jQuery(this).next(".msg").hide(),a=t.find('.for-cloning-only .cpac-column[data-type="'+s+'"]');if(a.length)if(a.find(".is-disabled").length){u.html(a.find(".is-disabled").html()).show();jQuery(this).find("option").removeAttr("selected");jQuery(this).find('option[value="'+r+'"]').attr("selected","selected")}else{if(typeof a.attr("data-clone")=="undefined"&&jQuery(".cpac-columns",t).find('[data-type="'+s+'"]').length){u.html(cpac_i18n.clone.replace("%s","<strong>"+o+"</strong>")).show();jQuery(this).find("option").removeAttr("selected");jQuery(this).find('option[value="'+r+'"]').attr("selected","selected");return}var f=a.clone();f.addClass("opened").find(".column-form").show();f.find(".column-meta").replaceWith(e.find(".column-meta"));f.find(".column-form").replaceWith(e.find(".column-form"));f.cpac_update_clone_id(n);e.replaceWith(f);f.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.find(".input-width-range").each(function(){var e=jQuery(this).closest("td").find(".input-width"),t=jQuery(this).closest("td").find(".width-decription"),n=jQuery(e)[0].defaultValue,r=t.attr("title");jQuery(this).slider({range:"min",min:0,max:100,value:n,slide:function(n,i){var s=i.value>0?i.value+"%":r;jQuery(e).val(i.value);jQuery(t).text(s)}})});e.find(".column_image_size label.custom-size").click(function(){var e=jQuery(this).closest(".input");if(jQuery(this).hasClass("image-size-custom")){jQuery(".custom-size-w",e).removeClass("hidden");jQuery(".custom-size-h",e).removeClass("hidden")}else{jQuery(".custom-size-w",e).addClass("hidden");jQuery(".custom-size-h",e).addClass("hidden")}});e.find(".column-form .label label").hover(function(){jQuery(this).find("p.description").show()},function(){jQuery(this).find("p.description").hide()});e.find(".column_type select").val()=="column-meta"&&e.find(".column_field_type 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.cpac_update_clone_id=function(e){var t=jQuery(this),n=t.attr("data-type"),r=jQuery('.columns-container[data-type="'+e+'"]').find(".cpac-columns"),i=jQuery(r).find('*[data-type="'+n+'"]').not(t),s=jQuery.map(i,function(e,t){return jQuery(e).attr("data-clone")?parseInt(jQuery(e).attr("data-clone"),10):0});s.sort();var o=Math.max.apply(null,s)+1;for(var u=0;u<=o;u++)if(-1===jQuery.inArray(u,s))break;if(0===u)return;t.attr("data-clone",u);t.find("input.clone").val(u);t.find("input.column-name").val(n+"-"+u);var a=t.find("input, select, label");jQuery(a).each(function(e,t){var r=n+"-"+u;jQuery(t).attr("name")&&jQuery(t).attr("name",jQuery(t).attr("name").replace(n,r));jQuery(t).attr("for")&&jQuery(t).attr("for",jQuery(t).attr("for").replace(n,r));jQuery(t).attr("id")&&jQuery(t).attr("id",jQuery(t).attr("id").replace(n,r))})};jQuery(document).bind("column_init column_change column_add",function(e,t){jQuery(t).cpac_bind_column_addon_events();jQuery(t).cpac_bind_container_addon_events()});jQuery.fn.cpac_bind_column_addon_events=function(){var e=jQuery(this),t=e.find("[data-toggle-id] label");t.click(function(){var t=jQuery(this).closest("td.input").data("toggle-id"),n=e.find('[data-indicator-id="'+t+'"]').removeClass("on"),r=jQuery("input",this).val();"on"==r&&n.addClass("on")})};jQuery.fn.cpac_bind_container_addon_events=function(){var e=jQuery(this),t=e.find("[data-indicator-id]");t.unbind("click").click(function(){var t=jQuery(this).data("indicator-id"),n=e.find('[data-toggle-id="'+t+'"] input');if(jQuery(this).hasClass("on")){jQuery(this).removeClass("on").addClass("off");n.filter("[value=off]").prop("checked",!0)}else{jQuery(this).removeClass("off").addClass("on");n.filter("[value=on]").prop("checked",!0)}})};
1
  /*
2
  * Fires when the dom is ready
3
  *
4
+ */function cpac_importexport(){jQuery("#php-export-results textarea").on("focus, mouseup",function(){jQuery(this).select()}).select().focus()}function cpac_addons(){}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_add_column(){jQuery("#cpac .add_column").click(function(e){var t=jQuery(this).closest(".columns-container"),n=jQuery(".for-cloning-only .cpac-column",t).first().clone(),r=t.attr("data-type");if(n.length>0){n.cpac_update_clone_id(r);jQuery(".cpac-columns form",t).append(n);n.column_bind_toggle();n.column_bind_remove();n.column_bind_events();n.addClass("opened").find(".column-form").slideDown(150,function(){jQuery("html, body").animate({scrollTop:n.offset().top-58},300)});cpac_sortable();jQuery(document).trigger("column_add",n)}e.preventDefault()})}function cpac_sidebar_feedback(){jQuery(function(e){var t=e(".sidebox#direct-feedback");t.find("#feedback-choice a.no").click(function(e){e.preventDefault();t.find("#feedback-choice").slideUp();t.find("#feedback-support").slideDown()});t.find("#feedback-choice a.yes").click(function(e){e.preventDefault();t.find("#feedback-choice").slideUp();t.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 t=jQuery("#contextual-help-wrap");t.parent().show();jQuery('a[href="#tab-panel-cpac-'+jQuery(this).attr("data-help")+'"]',t).trigger("click");t.slideDown("fast",function(){t.focus()})})}function cpac_pointer(){jQuery(".cpac-pointer").each(function(){var e=jQuery(this),t=e.attr("rel"),n=e.attr("data-pos"),r={at:"left top",my:"right top",edge:"right",offset:"0 0"};"right"==n&&(r={at:"right middle",my:"left middle",edge:"left"});e.pointer({content:jQuery("#"+t).html(),position:r,pointerWidth:250,close:function(){e.removeClass("open")},pointerClass:"wp-pointer wp-pointer-"+r.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,t){var n=jQuery(this).attr("href");if(n){var r=n.replace("#cpac-box-","");jQuery(".cpac-menu a").removeClass("current");jQuery(".columns-container").hide();jQuery(this).addClass("current");var i=jQuery('.columns-container[data-type="'+r+'"]').show(),s=i.find(".cpac-columns");jQuery(document).trigger("cac_menu_change",s)}e.preventDefault()});e.find("a.current").trigger("click")}jQuery(document).ready(function(){if(jQuery("#cpac").length===0)return!1;cpac_pointer();cpac_submit_form();cpac_clear_input_defaults();cpac_sortable();cpac_menu();cpac_help();cpac_add_column();cpac_addons();cpac_importexport();cpac_sidebar_feedback();jQuery(".cpac-column").each(function(e,t){jQuery(t).column_bind_toggle();jQuery(t).column_bind_remove();jQuery(t).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(t){t.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.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(t){var n=jQuery("<div>"+t+"</div>").children();e.replaceWith(n);e=n;e.column_bind_toggle();e.column_bind_remove();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),t=e.closest(".columns-container "),n=t.attr("data-type"),r=e.find(".column_type select option:selected").val();e.find(".column_type select").change(function(){var i=jQuery("optgroup",this).children(":selected"),s=i.val(),o=i.text(),u=jQuery(this).next(".msg").hide(),a=t.find('.for-cloning-only .cpac-column[data-type="'+s+'"]');if(a.length)if(a.find(".is-disabled").length){u.html(a.find(".is-disabled").html()).show();jQuery(this).find("option").removeAttr("selected");jQuery(this).find('option[value="'+r+'"]').attr("selected","selected")}else{if(typeof a.attr("data-clone")=="undefined"&&jQuery(".cpac-columns",t).find('[data-type="'+s+'"]').length){u.html(cpac_i18n.clone.replace("%s","<strong>"+o+"</strong>")).show();jQuery(this).find("option").removeAttr("selected");jQuery(this).find('option[value="'+r+'"]').attr("selected","selected");return}var f=a.clone();f.addClass("opened").find(".column-form").show();f.find(".column-meta").replaceWith(e.find(".column-meta"));f.find(".column-form").replaceWith(e.find(".column-form"));f.cpac_update_clone_id(n);e.replaceWith(f);f.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.find(".input-width-range").each(function(){var e=jQuery(this).closest("td").find(".input-width"),t=jQuery(this).closest("td").find(".width-decription"),n=jQuery(e)[0].defaultValue,r=t.attr("title");jQuery(this).slider({range:"min",min:0,max:100,value:n,slide:function(n,i){var s=i.value>0?i.value+"%":r;jQuery(e).val(i.value);jQuery(t).text(s)}})});e.find(".column_image_size label.custom-size").click(function(){var e=jQuery(this).closest(".input");if(jQuery(this).hasClass("image-size-custom")){jQuery(".custom-size-w",e).removeClass("hidden");jQuery(".custom-size-h",e).removeClass("hidden")}else{jQuery(".custom-size-w",e).addClass("hidden");jQuery(".custom-size-h",e).addClass("hidden")}});e.find(".column-form .label label").hover(function(){jQuery(this).find("p.description").show()},function(){jQuery(this).find("p.description").hide()});e.find(".column_type select").val()=="column-meta"&&e.find(".column_field_type 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.cpac_update_clone_id=function(e){var t=jQuery(this),n=t.attr("data-type"),r=jQuery('.columns-container[data-type="'+e+'"]').find(".cpac-columns"),i=jQuery(r).find('*[data-type="'+n+'"]').not(t),s=jQuery.map(i,function(e,t){return jQuery(e).attr("data-clone")?parseInt(jQuery(e).attr("data-clone"),10):0});s.sort();var o=Math.max.apply(null,s)+1;for(var u=0;u<=o;u++)if(-1===jQuery.inArray(u,s))break;if(0===u)return;t.attr("data-clone",u);t.find("input.clone").val(u);t.find("input.column-name").val(n+"-"+u);var a=t.find("input, select, label");jQuery(a).each(function(e,t){var r=n+"-"+u;jQuery(t).attr("name")&&jQuery(t).attr("name",jQuery(t).attr("name").replace(n,r));jQuery(t).attr("for")&&jQuery(t).attr("for",jQuery(t).attr("for").replace(n,r));jQuery(t).attr("id")&&jQuery(t).attr("id",jQuery(t).attr("id").replace(n,r))})};jQuery(document).bind("column_init column_change column_add",function(e,t){jQuery(t).cpac_bind_column_addon_events();jQuery(t).cpac_bind_container_addon_events()});jQuery.fn.cpac_bind_column_addon_events=function(){var e=jQuery(this),t=e.find("[data-toggle-id] label");t.click(function(){var t=jQuery(this).closest("td.input").data("toggle-id"),n=e.find('[data-indicator-id="'+t+'"]').removeClass("on"),r=jQuery("input",this).val();"on"==r&&n.addClass("on")})};jQuery.fn.cpac_bind_container_addon_events=function(){var e=jQuery(this),t=e.find("[data-indicator-id]");t.unbind("click").click(function(){var t=jQuery(this).data("indicator-id"),n=e.find('[data-toggle-id="'+t+'"] input');if(jQuery(this).hasClass("on")){jQuery(this).removeClass("on").addClass("off");n.filter("[value=off]").prop("checked",!0)}else{jQuery(this).removeClass("off").addClass("on");n.filter("[value=on]").prop("checked",!0)}})};
classes/column.php CHANGED
@@ -165,9 +165,7 @@ class CPAC_Column {
165
  }
166
 
167
  // Check whether the column should be available
168
- if ( ! isset( $this->properties['is_registered'] ) ) {
169
- $this->properties['is_registered'] = $this->apply_conditional();
170
- }
171
 
172
  /**
173
  * Filter the properties of a column type, such as type and is_cloneable
@@ -665,7 +663,7 @@ class CPAC_Column {
665
  * @param array $pieces
666
  * @return string Imploded array
667
  */
668
- protected function recursive_implode( $glue, $pieces ) {
669
  foreach( $pieces as $r_pieces ) {
670
  if ( is_array( $r_pieces ) ) {
671
  $retVal[] = $this->recursive_implode( $glue, $r_pieces );
@@ -912,7 +910,6 @@ class CPAC_Column {
912
  $column_list = '';
913
 
914
  $groups = $this->storage_model->get_column_type_groups();
915
-
916
  foreach ( $groups as $group => $label ) {
917
  $column_list .= $this->get_column_list( $this->storage_model->column_types[ $group ], $label );
918
  }
@@ -1038,8 +1035,8 @@ class CPAC_Column {
1038
 
1039
  </tbody>
1040
  </table>
1041
- </div><!--.column-form-->
1042
- </div><!--.cpac-column-->
1043
  <?php
1044
  }
1045
  }
165
  }
166
 
167
  // Check whether the column should be available
168
+ $this->properties['is_registered'] = $this->apply_conditional();
 
 
169
 
170
  /**
171
  * Filter the properties of a column type, such as type and is_cloneable
663
  * @param array $pieces
664
  * @return string Imploded array
665
  */
666
+ public function recursive_implode( $glue, $pieces ) {
667
  foreach( $pieces as $r_pieces ) {
668
  if ( is_array( $r_pieces ) ) {
669
  $retVal[] = $this->recursive_implode( $glue, $r_pieces );
910
  $column_list = '';
911
 
912
  $groups = $this->storage_model->get_column_type_groups();
 
913
  foreach ( $groups as $group => $label ) {
914
  $column_list .= $this->get_column_list( $this->storage_model->column_types[ $group ], $label );
915
  }
1035
 
1036
  </tbody>
1037
  </table>
1038
+ </div>
1039
+ </div>
1040
  <?php
1041
  }
1042
  }
classes/column/acf-placeholder.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_ACF_Placeholder extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_ID extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/actions.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Actions extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/agent.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Agent extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/approved.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Approved extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/author-avatar.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author_Avatar extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/author-email.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author_Email extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/author-ip.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author_Ip extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/author-url.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author_Url extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/author.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/date-gmt.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Date_Gmt extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/date.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Date extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/excerpt.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Excerpt extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/reply-to.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Reply_To extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/comment/word-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Word_Count extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/custom-field.php CHANGED
@@ -9,7 +9,7 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
9
 
10
  /**
11
  * @see CPAC_Column::init()
12
- * @since 2.3
13
  */
14
  function init() {
15
 
9
 
10
  /**
11
  * @see CPAC_Column::init()
12
+ * @since 2.2.1
13
  */
14
  function init() {
15
 
classes/column/default.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
  /**
3
- * @since 2.3
4
  */
5
  class CPAC_Column_Default extends CPAC_Column {
6
 
7
  /**
8
  * @see CPAC_Column::init()
9
- * @since 2.3
10
  */
11
  public function init() {
12
 
@@ -18,12 +18,12 @@ class CPAC_Column_Default extends CPAC_Column {
18
  }
19
 
20
  /**
21
- * @since 2.3
22
  * @see CPAC_Column::get_value()
23
  */
24
  public function get_value( $post_id ) {
25
 
26
- if ( $this->properties->column ) {
27
  echo $this->storage_model->get_original_column_value( $this->properties->handle, $post_id );
28
  }
29
 
1
  <?php
2
  /**
3
+ * @since 2.2.1
4
  */
5
  class CPAC_Column_Default extends CPAC_Column {
6
 
7
  /**
8
  * @see CPAC_Column::init()
9
+ * @since 2.2.1
10
  */
11
  public function init() {
12
 
18
  }
19
 
20
  /**
21
+ * @since 2.2.1
22
  * @see CPAC_Column::get_value()
23
  */
24
  public function get_value( $post_id ) {
25
 
26
+ if ( ! empty( $this->properties->handle ) ) {
27
  echo $this->storage_model->get_original_column_value( $this->properties->handle, $post_id );
28
  }
29
 
classes/column/link/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_ID extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/link/actions.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Actions extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
@@ -50,4 +50,4 @@ class CPAC_Column_Link_Actions extends CPAC_Column {
50
 
51
  return implode( ' | ', $actions );
52
  }
53
- }
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
50
 
51
  return implode( ' | ', $actions );
52
  }
53
+ }
classes/column/link/description.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Description extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/link/image.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Image extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/link/length.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Length extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/link/notes.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Notes extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/link/owner.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Owner extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/link/rss.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Rss extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/link/target.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Target extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_ID extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/actions.php CHANGED
@@ -9,7 +9,7 @@ class CPAC_Column_Media_Actions extends CPAC_Column {
9
 
10
  /**
11
  * @see CPAC_Column::init()
12
- * @since 2.3
13
  */
14
  public function init() {
15
 
9
 
10
  /**
11
  * @see CPAC_Column::init()
12
+ * @since 2.2.1
13
  */
14
  public function init() {
15
 
classes/column/media/alternate-text.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Alternate_Text extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/available-sizes.php CHANGED
@@ -9,7 +9,7 @@ class CPAC_Column_Media_Available_Sizes extends CPAC_Column {
9
 
10
  /**
11
  * @see CPAC_Column::init()
12
- * @since 2.3
13
  */
14
  public function init() {
15
 
9
 
10
  /**
11
  * @see CPAC_Column::init()
12
+ * @since 2.2.1
13
  */
14
  public function init() {
15
 
classes/column/media/caption.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Caption extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/description.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Description extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/dimensions.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Dimensions extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/exif-data.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Exif_Data extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/file-name.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_File_Name extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/file-size.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_File_Size extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/full-path.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/height.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Height extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/mime-type.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Mime_Type extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/media/width.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Width extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_ID extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/actions.php CHANGED
@@ -8,15 +8,18 @@ class CPAC_Column_Post_Actions extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
15
  parent::init();
16
 
17
  // Properties
18
- $this->properties['type'] = 'column-actions';
19
- $this->properties['label'] = __( 'Actions', 'cpac' );
 
 
 
20
  }
21
 
22
  /**
@@ -24,7 +27,6 @@ class CPAC_Column_Post_Actions 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
 
@@ -33,7 +35,6 @@ class CPAC_Column_Post_Actions extends CPAC_Column {
33
  * @since 2.0
34
  */
35
  function get_raw_value( $post_id ) {
36
-
37
  return $this->get_column_value_actions( $post_id );
38
  }
39
 
@@ -48,17 +49,28 @@ class CPAC_Column_Post_Actions extends CPAC_Column {
48
  * @return string Actions
49
  */
50
  private function get_column_value_actions( $post_id ) {
51
-
52
  $actions = array();
53
 
54
  $post = get_post($post_id);
55
  $title = _draft_or_post_title();
56
  $post_type_object = get_post_type_object( $post->post_type );
57
  $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
 
 
 
 
 
 
 
 
 
58
 
59
  if ( $can_edit_post && 'trash' != $post->post_status ) {
60
  $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
61
- $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
 
 
 
62
  }
63
  if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
64
  if ( 'trash' == $post->post_status )
@@ -77,6 +89,70 @@ class CPAC_Column_Post_Actions extends CPAC_Column {
77
  }
78
  }
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  return implode(' | ', $actions);
81
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  }
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-actions';
19
+ $this->properties['label'] = __( 'Actions', 'cpac' );
20
+
21
+ // Options
22
+ $this->options['use_icons'] = false;
23
  }
24
 
25
  /**
27
  * @since 2.0
28
  */
29
  function get_value( $post_id ) {
 
30
  return $this->get_raw_value( $post_id );
31
  }
32
 
35
  * @since 2.0
36
  */
37
  function get_raw_value( $post_id ) {
 
38
  return $this->get_column_value_actions( $post_id );
39
  }
40
 
49
  * @return string Actions
50
  */
51
  private function get_column_value_actions( $post_id ) {
 
52
  $actions = array();
53
 
54
  $post = get_post($post_id);
55
  $title = _draft_or_post_title();
56
  $post_type_object = get_post_type_object( $post->post_type );
57
  $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
58
+ $quickedit_enabled = false;
59
+
60
+ $stored_columns = $this->storage_model->get_stored_columns();
61
+
62
+ foreach ( $stored_columns as $column ) {
63
+ if ( $column['type'] == 'title' ) {
64
+ $quickedit_enabled = true;
65
+ }
66
+ }
67
 
68
  if ( $can_edit_post && 'trash' != $post->post_status ) {
69
  $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
70
+
71
+ if ( $quickedit_enabled ) {
72
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
73
+ }
74
  }
75
  if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
76
  if ( 'trash' == $post->post_status )
89
  }
90
  }
91
 
92
+ // Use icons instead of links
93
+ /*
94
+ @todo: debug first
95
+ if ( ! empty( $this->options->use_icons ) ) {
96
+ $icons = array(
97
+ 'edit' => 'edit',
98
+ 'trash' => 'trash',
99
+ 'delete' => 'trash',
100
+ 'untrash' => 'undo',
101
+ 'view' => 'visibility',
102
+ 'inline hide-if-no-js' => 'welcome-write-blog'
103
+ );
104
+
105
+ foreach ( $actions as $action => $link ) {
106
+ if ( isset( $icons[ $action ] ) ) {
107
+ if ( strpos( $link, 'class=' ) === false ) {
108
+ $link = str_replace( '<a ', '<a class="" ', $link );
109
+ }
110
+
111
+ $link = preg_replace( '/class=["\'](.*?)["\']/', 'class="$1 cpac-tip button cpac-button-action dashicons hide-content dashicons-' . $icons[ $action ] . '"', $link, 1 );
112
+ $link = preg_replace_callback( '/>(.*?)<\/a>/', function( $matches ) {
113
+ return ' data-tip="' . esc_attr( $matches[1] ) . '">' . $matches[1] . '</a>';
114
+ }, $link );
115
+
116
+ $actions[ $action ] = $link;
117
+ }
118
+ }
119
+
120
+ return implode( '', $actions );
121
+ }
122
+ */
123
+
124
  return implode(' | ', $actions);
125
  }
126
+
127
+ /**
128
+ * @see CPAC_Column::display_settings()
129
+ * @since 2.2.4
130
+ */
131
+ public function display_settings() {
132
+
133
+ parent::display_settings();
134
+
135
+ //$this->display_field_use_icons();
136
+ }
137
+
138
+ /**
139
+ * @since 2.2.4
140
+ */
141
+ public function display_field_use_icons() {
142
+ ?>
143
+ <tr class="column_editing">
144
+ <?php $this->label_view( __( 'Use icons?', 'cpac' ), __( 'Use icons instead of text for displaying the actions.', 'cpac' ), 'use_icons' ); ?>
145
+ <td class="input">
146
+ <label for="<?php $this->attr_id( 'use_icons' ); ?>-yes">
147
+ <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' ); ?> />
148
+ <?php _e( 'Yes'); ?>
149
+ </label>
150
+ <label for="<?php $this->attr_id( 'use_icons' ); ?>-no">
151
+ <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, '' ); ?> />
152
+ <?php _e( 'No'); ?>
153
+ </label>
154
+ </td>
155
+ </tr>
156
+ <?php
157
+ }
158
  }
classes/column/post/attachment-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Attachment_Count extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/attachment.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Attachment extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/author-name.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Author_Name extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/before-moretag.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Before_Moretag extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/comment-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/comment-status.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Comment_Status extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
@@ -51,7 +51,6 @@ class CPAC_Column_Post_Comment_Status extends CPAC_Column {
51
  * @since 2.0.3
52
  */
53
  function get_raw_value( $post_id ) {
54
-
55
  return get_post_field( 'comment_status', $post_id, 'raw' );
56
  }
57
  }
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
51
  * @since 2.0.3
52
  */
53
  function get_raw_value( $post_id ) {
 
54
  return get_post_field( 'comment_status', $post_id, 'raw' );
55
  }
56
  }
classes/column/post/excerpt.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Excerpt extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/featured-image.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Featured_Image extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/formats.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
@@ -25,8 +25,9 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
25
  */
26
  function apply_conditional() {
27
 
28
- if ( post_type_supports( $this->storage_model->key, 'post-formats' ) )
29
  return true;
 
30
 
31
  return false;
32
  }
@@ -37,8 +38,9 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
37
  */
38
  function get_value( $post_id ) {
39
 
40
- if ( ! $format = $this->get_raw_value( $post_id ) )
41
  return false;
 
42
 
43
  return esc_html( get_post_format_string( $format ) );
44
  }
@@ -49,8 +51,9 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
49
  */
50
  function get_raw_value( $post_id ) {
51
 
52
- if ( ! $format = get_post_format( $post_id ) )
53
  return false;
 
54
 
55
  return $format;
56
  }
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
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
  }
38
  */
39
  function get_value( $post_id ) {
40
 
41
+ if ( ! ( $format = $this->get_raw_value( $post_id ) ) ) {
42
  return false;
43
+ }
44
 
45
  return esc_html( get_post_format_string( $format ) );
46
  }
51
  */
52
  function get_raw_value( $post_id ) {
53
 
54
+ if ( ! ( $format = get_post_format( $post_id ) ) ) {
55
  return false;
56
+ }
57
 
58
  return $format;
59
  }
classes/column/post/modified.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Modified extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/order.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Order extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/page-template.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Page_Template extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/parent.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Parent extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/permalink.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Permalink extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
@@ -79,5 +79,4 @@ class CPAC_Column_Post_Permalink extends CPAC_Column {
79
  </tr>
80
  <?php
81
  }
82
-
83
  }
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
79
  </tr>
80
  <?php
81
  }
 
82
  }
classes/column/post/ping-status.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Ping_Status extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/roles.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Roles extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/slug.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Slug extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/status.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Status extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/sticky.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Sticky extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/post/title-raw.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CPAC_Column_Post_Title_Raw
4
+ *
5
+ * @since 2.2.4
6
+ */
7
+ class CPAC_Column_Post_Title_Raw extends CPAC_Column {
8
+
9
+ /**
10
+ * @see CPAC_Column::init()
11
+ * @since 2.2.4
12
+ */
13
+ public function init() {
14
+
15
+ parent::init();
16
+
17
+ // Properties
18
+ $this->properties['type'] = 'column-title_raw';
19
+ $this->properties['label'] = __( 'Title without actions', 'cpac' );
20
+ }
21
+
22
+ /**
23
+ * @see CPAC_Column::get_value()
24
+ * @since 2.2.4
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.2.4
34
+ */
35
+ function get_raw_value( $post_id ) {
36
+
37
+ return get_post_field( 'post_title', $post_id );
38
+ }
39
+ }
classes/column/post/word-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Word_Count extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/taxonomy.php CHANGED
@@ -8,12 +8,12 @@ class CPAC_Column_Taxonomy extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
15
  parent::init();
16
-
17
  // Properties
18
  $this->properties['type'] = 'column-taxonomy';
19
  $this->properties['label'] = __( 'Taxonomy', 'cpac' );
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-taxonomy';
19
  $this->properties['label'] = __( 'Taxonomy', 'cpac' );
classes/column/used-by-menu.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CPAC_Column_Post_Modified
4
+ *
5
+ * @since 2.0
6
+ */
7
+ class CPAC_Column_Used_By_Menu 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-used_by_menu';
19
+ $this->properties['label'] = __( 'Used by Menu', 'cpac' );
20
+
21
+ // Options
22
+ $this->options['link_to_menu'] = false;
23
+ }
24
+
25
+ /**
26
+ * @see CPAC_Column::apply_conditional()
27
+ * @since 2.0
28
+ */
29
+ function apply_conditional() {
30
+ if ( ! $this->get_meta_type() ) {
31
+ return false;
32
+ }
33
+ return true;
34
+ }
35
+
36
+ /**
37
+ * @see CPAC_Column::get_value()
38
+ * @since 2.0
39
+ */
40
+ function get_value( $object_id ) {
41
+
42
+ $menus = array();
43
+ if ( $menu_ids = $this->get_raw_value( $object_id ) ) {
44
+ foreach ( $menu_ids as $menu_id ) {
45
+ $term = get_term_by( 'id', $menu_id, 'nav_menu' );
46
+
47
+ $title = $term->name;
48
+ if ( 'on' == $this->options->link_to_menu ) {
49
+ $title = '<a href="' . esc_url( add_query_arg( array( 'menu' => $menu_id ), admin_url('nav-menus.php') ) ) . '">' . $term->name . '</a>';
50
+ }
51
+
52
+ $menus[] = $title;
53
+ }
54
+ }
55
+
56
+ return implode( ', ', $menus );
57
+ }
58
+
59
+ /**
60
+ * Get object metatype of the storage model
61
+ *
62
+ * @since 2.0.6
63
+ */
64
+ function get_meta_type() {
65
+ $object_type = false;
66
+ if ( isset( $this->storage_model->taxonomy ) ) {
67
+ $object_type = $this->storage_model->taxonomy;
68
+ }
69
+ elseif ( isset( $this->storage_model->post_type ) ) {
70
+ $object_type = $this->storage_model->post_type;
71
+ }
72
+ return $object_type;
73
+ }
74
+
75
+ /**
76
+ * @see CPAC_Column::get_raw_value()
77
+ * @since 2.0.3
78
+ */
79
+ function get_raw_value( $object_id ) {
80
+
81
+ $object_type = $this->get_meta_type();
82
+
83
+
84
+ $menu_item_ids = get_posts( array(
85
+ 'post_type' => 'nav_menu_item',
86
+ 'numberposts' => -1,
87
+ 'post_status' => 'publish',
88
+ 'fields' => 'ids',
89
+ 'meta_query' => array(
90
+ array(
91
+ 'key' => '_menu_item_object_id',
92
+ 'value' => $object_id
93
+ ),
94
+ array(
95
+ 'key' => '_menu_item_object',
96
+ 'value' => $object_type
97
+ ),
98
+ )
99
+ ) );
100
+
101
+ if ( ! $menu_item_ids ) {
102
+ return false;
103
+ }
104
+
105
+ $menu_ids = wp_get_object_terms( $menu_item_ids, 'nav_menu', array( 'fields' => 'ids') );
106
+ if ( ! $menu_ids || is_wp_error( $menu_ids ) ) {
107
+ return false;
108
+ }
109
+
110
+ return $menu_ids;
111
+ }
112
+
113
+ /**
114
+ * @see CPAC_Column::display_settings()
115
+ * @since 2.2.1
116
+ */
117
+ public function display_settings() {
118
+
119
+ $this->display_field_link_to_menu();
120
+ }
121
+
122
+ /**
123
+ * Display the settings field for selecting whether the column value should link to the corresponding post
124
+ *
125
+ * @since 2.2.1
126
+ */
127
+ public function display_field_link_to_menu() {
128
+
129
+ $field_key = 'link_to_menu';
130
+ ?>
131
+ <tr class="column_<?php echo $field_key; ?>">
132
+ <?php $this->label_view( __( 'Link to menu', 'cpac' ), __( 'This will make the title link to the menu.', 'cpac' ), $field_key ); ?>
133
+ <td class="input">
134
+ <label for="<?php $this->attr_id( $field_key ); ?>-on">
135
+ <input type="radio" value="on" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-on"<?php checked( $this->options->link_to_menu, 'on' ); ?> />
136
+ <?php _e( 'Yes'); ?>
137
+ </label>
138
+ <label for="<?php $this->attr_id( $field_key ); ?>-off">
139
+ <input type="radio" value="off" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-off"<?php checked( in_array( $this->options->link_to_menu, array( '', 'off' ) ) ); ?> />
140
+ <?php _e( 'No'); ?>
141
+ </label>
142
+ </td>
143
+ </tr>
144
+ <?php
145
+ }
146
+ }
classes/column/user/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_ID extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/user/actions.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Actions extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/user/comment-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Comment_Count extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/user/description.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Description extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/user/first-name.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_First_Name extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/user/last-name.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Last_Name extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/user/nickname.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Nickname extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/user/post-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/user/registered.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Registered extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/column/user/url.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Url extends CPAC_Column {
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
- * @since 2.3
12
  */
13
  public function init() {
14
 
8
 
9
  /**
10
  * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
  */
13
  public function init() {
14
 
classes/settings.php CHANGED
@@ -876,9 +876,12 @@ class CPAC_Settings {
876
  case 'settings' :
877
  $this->display_settings();
878
  break;
879
- case 'addons':
880
  $this->tab_addons();
881
  break;
 
 
 
882
  default:
883
  echo apply_filters( 'cac/settings/tab_contents/tab=' . $current_tab, apply_filters( 'cac/settings/tab_contents', '', $current_tab ) );
884
  break;
876
  case 'settings' :
877
  $this->display_settings();
878
  break;
879
+ case 'addons' :
880
  $this->tab_addons();
881
  break;
882
+ case 'help' :
883
+ //$this->tab_addons();
884
+ break;
885
  default:
886
  echo apply_filters( 'cac/settings/tab_contents/tab=' . $current_tab, apply_filters( 'cac/settings/tab_contents', '', $current_tab ) );
887
  break;
classes/storage_model.php CHANGED
@@ -97,7 +97,7 @@ abstract class CPAC_Storage_Model {
97
  $this->set_columns_filepath();
98
 
99
  // Populate columns variable.
100
- // This is used for manage_value. By storing these columns we greatly improve performance.
101
  add_action( 'admin_init', array( $this, 'set_columns' ) );
102
  }
103
 
@@ -222,10 +222,11 @@ abstract class CPAC_Storage_Model {
222
  */
223
  function store( $columns = '' ) {
224
 
225
- if ( ! empty( $_POST[ $this->key ] ) )
226
  $columns = array_filter( $_POST[ $this->key ] );
 
227
 
228
- if( ! $columns ) {
229
  cpac_admin_message( __( 'No columns settings available.', 'cpac' ), 'error' );
230
  return false;
231
  }
@@ -270,7 +271,8 @@ abstract class CPAC_Storage_Model {
270
  $columns = array(
271
  'CPAC_Column_Custom_Field' => CPAC_DIR . 'classes/column/custom-field.php',
272
  'CPAC_Column_ACF_Placeholder' => CPAC_DIR . 'classes/column/acf-placeholder.php',
273
- 'CPAC_Column_Taxonomy' => CPAC_DIR . 'classes/column/taxonomy.php'
 
274
  );
275
 
276
  // Directory to iterate
@@ -452,7 +454,6 @@ abstract class CPAC_Storage_Model {
452
  }
453
 
454
  public function get_database_columns() {
455
-
456
  return get_option( "cpac_options_{$this->key}" );
457
  }
458
 
@@ -726,11 +727,17 @@ abstract class CPAC_Storage_Model {
726
  }
727
 
728
  /**
 
 
729
  * @since 2.0.5
730
  * @return boolean
731
  */
732
  function is_doing_ajax() {
733
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
 
 
 
 
734
  return true;
735
  }
736
 
@@ -741,9 +748,11 @@ abstract class CPAC_Storage_Model {
741
  * @since 2.0.5
742
  * @return boolean
743
  */
 
744
  function is_doing_quick_edit() {
745
  return $this->is_doing_ajax() && isset( $_REQUEST['action'] ) && 'inline-save' == $_REQUEST['action'];
746
  }
 
747
 
748
  /**
749
  * @since 2.0.3
@@ -755,23 +764,26 @@ abstract class CPAC_Storage_Model {
755
 
756
  global $pagenow;
757
 
758
- if ( $this->page . '.php' != $pagenow )
759
  return false;
 
760
 
761
  // posttypes
762
  if ( 'post' == $this->type ) {
763
  $post_type = isset( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : $this->type;
764
 
765
- if ( $this->key != $post_type )
766
  return false;
 
767
  }
768
 
769
  // taxonomy
770
  if ( 'taxonomy' == $this->type ) {
771
  $taxonomy = isset( $_GET['taxonomy'] ) ? $_GET['taxonomy'] : '';
772
 
773
- if ( $this->taxonomy != $taxonomy )
774
  return false;
 
775
  }
776
 
777
  return true;
97
  $this->set_columns_filepath();
98
 
99
  // Populate columns variable.
100
+ // This is used for manage_value.
101
  add_action( 'admin_init', array( $this, 'set_columns' ) );
102
  }
103
 
222
  */
223
  function store( $columns = '' ) {
224
 
225
+ if ( ! empty( $_POST[ $this->key ] ) ) {
226
  $columns = array_filter( $_POST[ $this->key ] );
227
+ }
228
 
229
+ if ( ! $columns ) {
230
  cpac_admin_message( __( 'No columns settings available.', 'cpac' ), 'error' );
231
  return false;
232
  }
271
  $columns = array(
272
  'CPAC_Column_Custom_Field' => CPAC_DIR . 'classes/column/custom-field.php',
273
  'CPAC_Column_ACF_Placeholder' => CPAC_DIR . 'classes/column/acf-placeholder.php',
274
+ 'CPAC_Column_Taxonomy' => CPAC_DIR . 'classes/column/taxonomy.php',
275
+ 'CPAC_Column_Used_By_Menu' => CPAC_DIR . 'classes/column/used-by-menu.php'
276
  );
277
 
278
  // Directory to iterate
454
  }
455
 
456
  public function get_database_columns() {
 
457
  return get_option( "cpac_options_{$this->key}" );
458
  }
459
 
727
  }
728
 
729
  /**
730
+ * Whether this request is an AJAX request and marked as admin-column-ajax request.
731
+ *
732
  * @since 2.0.5
733
  * @return boolean
734
  */
735
  function is_doing_ajax() {
736
+ if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
737
+ return false;
738
+ }
739
+
740
+ if ( ( isset( $_POST['plugin_id'] ) && 'cpac' == $_POST['plugin_id'] ) || ( isset( $_GET['plugin_id'] ) && 'cpac' == $_GET['plugin_id'] ) ) {
741
  return true;
742
  }
743
 
748
  * @since 2.0.5
749
  * @return boolean
750
  */
751
+ /*
752
  function is_doing_quick_edit() {
753
  return $this->is_doing_ajax() && isset( $_REQUEST['action'] ) && 'inline-save' == $_REQUEST['action'];
754
  }
755
+ */
756
 
757
  /**
758
  * @since 2.0.3
764
 
765
  global $pagenow;
766
 
767
+ if ( $this->page . '.php' != $pagenow ) {
768
  return false;
769
+ }
770
 
771
  // posttypes
772
  if ( 'post' == $this->type ) {
773
  $post_type = isset( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : $this->type;
774
 
775
+ if ( $this->key != $post_type ) {
776
  return false;
777
+ }
778
  }
779
 
780
  // taxonomy
781
  if ( 'taxonomy' == $this->type ) {
782
  $taxonomy = isset( $_GET['taxonomy'] ) ? $_GET['taxonomy'] : '';
783
 
784
+ if ( $this->taxonomy != $taxonomy ) {
785
  return false;
786
+ }
787
  }
788
 
789
  return true;
classes/storage_model/post.php CHANGED
@@ -30,6 +30,7 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
30
  // values
31
  add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'manage_value' ), 100, 2 );
32
 
 
33
  add_action( 'load-edit.php', array( $this, 'set_columns' ), 1000 );
34
 
35
  parent::__construct();
30
  // values
31
  add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'manage_value' ), 100, 2 );
32
 
33
+ // @todo: description
34
  add_action( 'load-edit.php', array( $this, 'set_columns' ), 1000 );
35
 
36
  parent::__construct();
codepress-admin-columns.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
 
4
  Plugin Name: Codepress Admin Columns
5
- Version: 2.2.4
6
  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.
7
  Author: Codepress
8
  Author URI: http://www.codepresshq.com
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
33
  }
34
 
35
  // Plugin information
36
- define( 'CPAC_VERSION', '2.2.4' ); // current plugin version
37
  define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // this is the latest version which requires an upgrade
38
  define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
39
  define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
@@ -148,25 +148,22 @@ class CPAC {
148
  }
149
 
150
  /**
151
- * Whether this request is an AJAX request
152
  *
153
  * @since 2.2
154
  * @return bool Returns true if in an AJAX request, false otherwise
155
  */
156
  function is_doing_ajax() {
157
 
158
- $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
 
 
159
 
160
- /**
161
- * Filter whether the current request should be marked as an AJAX request
162
- * Useful for custom AJAX calls
163
- *
164
- * @since 2.2
165
- * @param bool $doing_ajax Whether the current request is an AJAX request
166
- */
167
- $doing_ajax = apply_filters( 'cac/is_doing_ajax', $doing_ajax );
168
 
169
- return $doing_ajax;
170
  }
171
 
172
  /**
@@ -218,6 +215,7 @@ class CPAC {
218
  * @return bool Whether the current screen is an Admin Columns screen
219
  */
220
  function is_cac_screen() {
 
221
  /**
222
  * Filter whether the current screen is a screen in which Admin Columns is active
223
  *
@@ -235,20 +233,22 @@ class CPAC {
235
  add_action( 'admin_head', array( $this, 'global_head_scripts') );
236
 
237
  wp_register_script( 'cpac-admin-columns', CPAC_URL . 'assets/js/admin-columns.js', array( 'jquery', 'jquery-qtip2' ), CPAC_VERSION );
 
238
 
239
  if ( $this->is_columns_screen() ) {
240
  add_filter( 'admin_body_class', array( $this, 'admin_class' ) );
241
  add_action( 'admin_head', array( $this, 'admin_scripts') );
242
 
243
  wp_enqueue_script( 'cpac-admin-columns' );
 
244
 
245
  $data = array();
246
 
247
- if ( $storage_model = $this->get_current_storage_model() ) {
248
  $data['storage_model'] = array(
249
  'is_table_header_fixed' => $storage_model->is_table_header_fixed()
250
  );
251
- }
252
 
253
  wp_localize_script( 'cpac-admin-columns', 'CPAC', $data );
254
 
@@ -273,8 +273,9 @@ class CPAC {
273
  */
274
  public function set_storage_models() {
275
 
276
- if ( ! $this->is_cac_screen() )
277
  return;
 
278
 
279
  $storage_models = array();
280
 
@@ -407,13 +408,8 @@ class CPAC {
407
  * @return string
408
  */
409
  function admin_class( $classes ) {
410
-
411
- if ( $this->storage_models ) {
412
- foreach ( $this->storage_models as $storage_model ) {
413
- if ( $storage_model->is_columns_screen() ) {
414
- $classes .= " cp-{$storage_model->key}";
415
- }
416
- }
417
  }
418
 
419
  return $classes;
2
  /*
3
 
4
  Plugin Name: Codepress Admin Columns
5
+ Version: 2.2.5
6
  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.
7
  Author: Codepress
8
  Author URI: http://www.codepresshq.com
33
  }
34
 
35
  // Plugin information
36
+ define( 'CPAC_VERSION', '2.2.5' ); // current plugin version
37
  define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // this is the latest version which requires an upgrade
38
  define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
39
  define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
148
  }
149
 
150
  /**
151
+ * Whether this request is an AJAX request and marked as admin-column-ajax request.
152
  *
153
  * @since 2.2
154
  * @return bool Returns true if in an AJAX request, false otherwise
155
  */
156
  function is_doing_ajax() {
157
 
158
+ if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
159
+ return false;
160
+ }
161
 
162
+ if ( ( isset( $_POST['plugin_id'] ) && 'cpac' == $_POST['plugin_id'] ) || ( isset( $_GET['plugin_id'] ) && 'cpac' == $_GET['plugin_id'] ) ) {
163
+ return true;
164
+ }
 
 
 
 
 
165
 
166
+ return false;
167
  }
168
 
169
  /**
215
  * @return bool Whether the current screen is an Admin Columns screen
216
  */
217
  function is_cac_screen() {
218
+
219
  /**
220
  * Filter whether the current screen is a screen in which Admin Columns is active
221
  *
233
  add_action( 'admin_head', array( $this, 'global_head_scripts') );
234
 
235
  wp_register_script( 'cpac-admin-columns', CPAC_URL . 'assets/js/admin-columns.js', array( 'jquery', 'jquery-qtip2' ), CPAC_VERSION );
236
+ wp_register_script( 'jquery-floatthead', CPAC_URL . 'external/floatThead/jquery.floatThead.js', array( 'jquery' ), CPAC_VERSION );
237
 
238
  if ( $this->is_columns_screen() ) {
239
  add_filter( 'admin_body_class', array( $this, 'admin_class' ) );
240
  add_action( 'admin_head', array( $this, 'admin_scripts') );
241
 
242
  wp_enqueue_script( 'cpac-admin-columns' );
243
+ wp_enqueue_script( 'jquery-floatthead' );
244
 
245
  $data = array();
246
 
247
+ /*if ( $storage_model = $this->get_current_storage_model() ) {
248
  $data['storage_model'] = array(
249
  'is_table_header_fixed' => $storage_model->is_table_header_fixed()
250
  );
251
+ }*/
252
 
253
  wp_localize_script( 'cpac-admin-columns', 'CPAC', $data );
254
 
273
  */
274
  public function set_storage_models() {
275
 
276
+ if ( ! $this->is_cac_screen() ) {
277
  return;
278
+ }
279
 
280
  $storage_models = array();
281
 
408
  * @return string
409
  */
410
  function admin_class( $classes ) {
411
+ if ( $storage_model = $this->get_current_storage_model() ) {
412
+ $classes .= " cp-{$storage_model->key}";
 
 
 
 
 
413
  }
414
 
415
  return $classes;
external/floatthead/jquery.floatThead.js ADDED
@@ -0,0 +1,757 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @preserve jQuery.floatThead 1.2.8 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2014 Misha Koryak
2
+ // @license MIT
3
+
4
+ /* @author Misha Koryak
5
+ * @projectDescription lock a table header in place while scrolling - without breaking styles or events bound to the header
6
+ *
7
+ * Dependencies:
8
+ * jquery 1.9.0 + [required] OR jquery 1.7.0 + jquery UI core
9
+ *
10
+ * http://mkoryak.github.io/floatThead/
11
+ *
12
+ * Tested on FF13+, Chrome 21+, IE8, IE9, IE10, IE11
13
+ *
14
+ */
15
+ (function( $ ) {
16
+ /**
17
+ * provides a default config object. You can modify this after including this script if you want to change the init defaults
18
+ * @type {Object}
19
+ */
20
+ $.floatThead = $.floatThead || {};
21
+ $.floatThead.defaults = {
22
+ cellTag: 'th:visible', //thead cells are this
23
+ zIndex: 1001, //zindex of the floating thead (actually a container div)
24
+ debounceResizeMs: 10,
25
+ useAbsolutePositioning: true, //if set to NULL - defaults: has scrollContainer=true, doesn't have scrollContainer=false
26
+ scrollingTop: 0, //String or function($table) - offset from top of window where the header should not pass above
27
+ scrollingBottom: 0, //String or function($table) - offset from the bottom of the table where the header should stop scrolling
28
+ scrollContainer: function($table){
29
+ return $([]); //if the table has horizontal scroll bars then this is the container that has overflow:auto and causes those scroll bars
30
+ },
31
+ getSizingRow: function($table, $cols, $fthCells){ // this is only called when using IE,
32
+ // override it if the first row of the table is going to contain colgroups (any cell spans greater then one col)
33
+ // it should return a jquery object containing a wrapped set of table cells comprising a row that contains no col spans and is visible
34
+ return $table.find('tbody tr:visible:first>*');
35
+ },
36
+ floatTableClass: 'floatThead-table',
37
+ floatWrapperClass: 'floatThead-wrapper',
38
+ floatContainerClass: 'floatThead-container',
39
+ copyTableClass: true, //copy 'class' attribute from table into the floated table so that the styles match.
40
+ debug: false //print possible issues (that don't prevent script loading) to console, if console exists.
41
+ };
42
+
43
+ var util = window._;
44
+
45
+ //browser stuff
46
+ var ieVersion = function(){for(var a=3,b=document.createElement("b"),c=b.all||[];a = 1+a,b.innerHTML="<!--[if gt IE "+ a +"]><i><![endif]-->",c[0];);return 4<a?a:document.documentMode}();
47
+ var isChrome = null;
48
+ var isChromeCheck = function(){
49
+ if(ieVersion){
50
+ return false;
51
+ }
52
+ var $table = $("<table><colgroup><col></colgroup><tbody><tr><td style='width:10px'></td></tbody></table>");
53
+ $('body').append($table);
54
+ var width = $table.find('col').width();
55
+ $table.remove();
56
+ return width == 0;
57
+ };
58
+
59
+ var $window = $(window);
60
+ var floatTheadCreated = 0;
61
+
62
+
63
+ /**
64
+ * @param debounceMs
65
+ * @param cb
66
+ */
67
+
68
+ function windowResize(debounceMs, eventName, cb){
69
+ if(ieVersion == 8){ //ie8 is crap: https://github.com/mkoryak/floatThead/issues/65
70
+ var winWidth = $window.width();
71
+ var debouncedCb = util.debounce(function(){
72
+ var winWidthNew = $window.width();
73
+ if(winWidth != winWidthNew){
74
+ winWidth = winWidthNew;
75
+ cb();
76
+ }
77
+ }, debounceMs);
78
+ $window.on(eventName, debouncedCb);
79
+ } else {
80
+ $window.on(eventName, util.debounce(cb, debounceMs));
81
+ }
82
+ }
83
+
84
+
85
+ function debug(str){
86
+ window.console && window.console && window.console.log && window.console.log(str);
87
+ }
88
+
89
+ /**
90
+ * try to calculate the scrollbar width for your browser/os
91
+ * @return {Number}
92
+ */
93
+ function scrollbarWidth() {
94
+ var $div = $( //borrowed from anti-scroll
95
+ '<div style="width:50px;height:50px;overflow-y:scroll;'
96
+ + 'position:absolute;top:-200px;left:-200px;"><div style="height:100px;width:100%">'
97
+ + '</div>'
98
+ );
99
+ $('body').append($div);
100
+ var w1 = $div.innerWidth();
101
+ var w2 = $('div', $div).innerWidth();
102
+ $div.remove();
103
+ return w1 - w2;
104
+ }
105
+ /**
106
+ * Check if a given table has been datatableized (http://datatables.net)
107
+ * @param $table
108
+ * @return {Boolean}
109
+ */
110
+ function isDatatable($table){
111
+ if($table.dataTableSettings){
112
+ for(var i = 0; i < $table.dataTableSettings.length; i++){
113
+ var table = $table.dataTableSettings[i].nTable;
114
+ if($table[0] == table){
115
+ return true;
116
+ }
117
+ }
118
+ }
119
+ return false;
120
+ }
121
+ $.fn.floatThead = function(map){
122
+ map = map || {};
123
+ if(!util){ //may have been included after the script? lets try to grab it again.
124
+ util = window._ || $.floatThead._;
125
+ if(!util){
126
+ throw new Error("jquery.floatThead-slim.js requires underscore. You should use the non-lite version since you do not have underscore.");
127
+ }
128
+ }
129
+
130
+ if(ieVersion < 8){
131
+ return this; //no more crappy browser support.
132
+ }
133
+
134
+ if(isChrome == null){ //make sure this is done only once no matter how many times you call the plugin fn
135
+ isChrome = isChromeCheck(); //need to call this after dom ready, and now it is.
136
+ if(isChrome){
137
+ //because chrome cant read <col> width, these elements are used for sizing the table. Need to create new elements because they must be unstyled by user's css.
138
+ document.createElement('fthtr'); //tr
139
+ document.createElement('fthtd'); //td
140
+ document.createElement('fthfoot'); //tfoot
141
+ }
142
+ }
143
+ if(util.isString(map)){
144
+ var command = map;
145
+ var ret = this;
146
+ this.filter('table').each(function(){
147
+ var obj = $(this).data('floatThead-attached');
148
+ if(obj && util.isFunction(obj[command])){
149
+ var r = obj[command]();
150
+ if(typeof r !== 'undefined'){
151
+ ret = r;
152
+ }
153
+ }
154
+ });
155
+ return ret;
156
+ }
157
+ var opts = $.extend({}, $.floatThead.defaults || {}, map);
158
+
159
+ $.each(map, function(key, val){
160
+ if((!(key in $.floatThead.defaults)) && opts.debug){
161
+ debug("jQuery.floatThead: used ["+key+"] key to init plugin, but that param is not an option for the plugin. Valid options are: "+ (util.keys($.floatThead.defaults)).join(', '));
162
+ }
163
+ });
164
+
165
+ this.filter(':not(.'+opts.floatTableClass+')').each(function(){
166
+ var floatTheadId = floatTheadCreated;
167
+ var $table = $(this);
168
+ if($table.data('floatThead-attached')){
169
+ return true; //continue the each loop
170
+ }
171
+ if(!$table.is('table')){
172
+ throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');
173
+ }
174
+ var $header = $table.find('thead:first');
175
+ var $tbody = $table.find('tbody:first');
176
+ if($header.length == 0){
177
+ throw new Error('jQuery.floatThead must be run on a table that contains a <thead> element');
178
+ }
179
+ var headerFloated = false;
180
+ var scrollingTop, scrollingBottom;
181
+ var scrollbarOffset = {vertical: 0, horizontal: 0};
182
+ var scWidth = scrollbarWidth();
183
+ var lastColumnCount = 0; //used by columnNum()
184
+ var $scrollContainer = opts.scrollContainer($table) || $([]); //guard against returned nulls
185
+
186
+ var useAbsolutePositioning = opts.useAbsolutePositioning;
187
+ if(useAbsolutePositioning == null){ //defaults: locked=true, !locked=false
188
+ useAbsolutePositioning = opts.scrollContainer($table).length;
189
+ }
190
+ var $caption = $table.find("caption");
191
+ var haveCaption = $caption.length == 1;
192
+ if(haveCaption){
193
+ var captionAlignTop = ($caption.css("caption-side") || $caption.attr("align") || "top") === "top";
194
+ }
195
+
196
+ var $fthGrp = $('<fthfoot style="display:table-footer-group;"/>');
197
+
198
+ var locked = $scrollContainer.length > 0;
199
+ var wrappedContainer = false; //used with absolute positioning enabled. did we need to wrap the scrollContainer/table with a relative div?
200
+ var $wrapper = $([]); //used when absolute positioning enabled - wraps the table and the float container
201
+ var absoluteToFixedOnScroll = ieVersion <= 9 && !locked && useAbsolutePositioning; //on ie using absolute positioning doesnt look good with window scrolling, so we change positon to fixed on scroll, and then change it back to absolute when done.
202
+ var $floatTable = $("<table/>");
203
+ var $floatColGroup = $("<colgroup/>");
204
+ var $tableColGroup = $table.find('colgroup:first');
205
+ var existingColGroup = true;
206
+ if($tableColGroup.length == 0){
207
+ $tableColGroup = $("<colgroup/>");
208
+ existingColGroup = false;
209
+ }
210
+ var $fthRow = $('<fthrow style="display:table-row;height:0;"/>'); //created unstyled elements
211
+ var $floatContainer = $('<div style="overflow: hidden;"></div>');
212
+ var $newHeader = $("<thead/>");
213
+ var $sizerRow = $('<tr class="size-row"/>');
214
+ var $sizerCells = $([]);
215
+ var $tableCells = $([]); //used for sizing - either $sizerCells or $tableColGroup cols. $tableColGroup cols are only created in chrome for borderCollapse:collapse because of a chrome bug.
216
+ var $headerCells = $([]);
217
+ var $fthCells = $([]); //created elements
218
+
219
+ $newHeader.append($sizerRow);
220
+ $table.prepend($tableColGroup);
221
+ if(isChrome){
222
+ $fthGrp.append($fthRow);
223
+ $table.append($fthGrp);
224
+ }
225
+
226
+ $floatTable.append($floatColGroup);
227
+ $floatContainer.append($floatTable);
228
+ if(opts.copyTableClass){
229
+ $floatTable.attr('class', $table.attr('class'));
230
+ }
231
+ $floatTable.attr({ //copy over some deprecated table attributes that people still like to use. Good thing poeple dont use colgroups...
232
+ 'cellpadding': $table.attr('cellpadding'),
233
+ 'cellspacing': $table.attr('cellspacing'),
234
+ 'border': $table.attr('border')
235
+ });
236
+
237
+ $floatTable.addClass(opts.floatTableClass).css('margin', 0); //must have no margins or you wont be able to click on things under floating table
238
+
239
+ if(useAbsolutePositioning){
240
+ var makeRelative = function($container, alwaysWrap){
241
+ var positionCss = $container.css('position');
242
+ var relativeToScrollContainer = (positionCss == "relative" || positionCss == "absolute");
243
+ if(!relativeToScrollContainer || alwaysWrap){
244
+ var css = {"paddingLeft": $container.css('paddingLeft'), "paddingRight": $container.css('paddingRight')};
245
+ $floatContainer.css(css);
246
+ $container = $container.wrap("<div class='"+opts.floatWrapperClass+"' style='position: relative; clear:both;'></div>").parent();
247
+ wrappedContainer = true;
248
+ }
249
+ return $container;
250
+ };
251
+ if(locked){
252
+ $wrapper = makeRelative($scrollContainer, true);
253
+ $wrapper.append($floatContainer);
254
+ } else {
255
+ $wrapper = makeRelative($table);
256
+ $table.after($floatContainer);
257
+ }
258
+ } else {
259
+ $table.after($floatContainer);
260
+ }
261
+
262
+
263
+ $floatContainer.css({
264
+ position: useAbsolutePositioning ? 'absolute' : 'fixed',
265
+ marginTop: 0,
266
+ top: useAbsolutePositioning ? 0 : 'auto',
267
+ zIndex: opts.zIndex
268
+ });
269
+ $floatContainer.addClass(opts.floatContainerClass);
270
+ updateScrollingOffsets();
271
+
272
+ var layoutFixed = {'table-layout': 'fixed'};
273
+ var layoutAuto = {'table-layout': $table.css('tableLayout') || 'auto'};
274
+ var originalTableWidth = $table[0].style.width || ""; //setting this to auto is bad: #70
275
+
276
+ function eventName(name){
277
+ return name+'.fth-'+floatTheadId+'.floatTHead'
278
+ }
279
+
280
+ function setHeaderHeight(){
281
+ var headerHeight = 0;
282
+ $header.find("tr:visible").each(function(){
283
+ headerHeight += $(this).outerHeight(true);
284
+ });
285
+ $sizerRow.outerHeight(headerHeight);
286
+ $sizerCells.outerHeight(headerHeight);
287
+ }
288
+
289
+
290
+ function setFloatWidth(){
291
+ var tableWidth = $table.outerWidth();
292
+ var width = $scrollContainer.width() || tableWidth;
293
+ $floatContainer.width(width - scrollbarOffset.vertical);
294
+ if(locked){
295
+ var percent = 100 * tableWidth / (width - scrollbarOffset.vertical);
296
+ $floatTable.css('width', percent+'%');
297
+ } else {
298
+ $floatTable.outerWidth(tableWidth);
299
+ }
300
+ }
301
+
302
+ function updateScrollingOffsets(){
303
+ scrollingTop = (util.isFunction(opts.scrollingTop) ? opts.scrollingTop($table) : opts.scrollingTop) || 0;
304
+ scrollingBottom = (util.isFunction(opts.scrollingBottom) ? opts.scrollingBottom($table) : opts.scrollingBottom) || 0;
305
+ }
306
+
307
+ /**
308
+ * get the number of columns and also rebuild resizer rows if the count is different then the last count
309
+ */
310
+ function columnNum(){
311
+ var count, $headerColumns;
312
+ if(existingColGroup){
313
+ count = $tableColGroup.find('col').length;
314
+ } else {
315
+ $headerColumns = $header.find('tr:first>'+opts.cellTag);
316
+ count = 0;
317
+ $headerColumns.each(function(){
318
+ count += parseInt(($(this).attr('colspan') || 1), 10);
319
+ });
320
+ }
321
+ if(count != lastColumnCount){
322
+ lastColumnCount = count;
323
+ var cells = [], cols = [], psuedo = [];
324
+ for(var x = 0; x < count; x++){
325
+ cells.push('<th class="floatThead-col"/>');
326
+ cols.push('<col/>');
327
+ psuedo.push("<fthtd style='display:table-cell;height:0;width:auto;'/>");
328
+ }
329
+
330
+ cols = cols.join('');
331
+ cells = cells.join('');
332
+
333
+ if(isChrome){
334
+ psuedo = psuedo.join('');
335
+ $fthRow.html(psuedo);
336
+ $fthCells = $fthRow.find('fthtd');
337
+ }
338
+
339
+ $sizerRow.html(cells);
340
+ $sizerCells = $sizerRow.find("th");
341
+ if(!existingColGroup){
342
+ $tableColGroup.html(cols);
343
+ }
344
+ $tableCells = $tableColGroup.find('col');
345
+ $floatColGroup.html(cols);
346
+ $headerCells = $floatColGroup.find("col");
347
+
348
+ }
349
+ return count;
350
+ }
351
+
352
+ function refloat(){ //make the thing float
353
+ if(!headerFloated){
354
+ headerFloated = true;
355
+ if(useAbsolutePositioning){ //#53, #56
356
+ var tableWidth = $table.width();
357
+ var wrapperWidth = $wrapper.width();
358
+ if(tableWidth > wrapperWidth){
359
+ $table.css('minWidth', tableWidth);
360
+ }
361
+ }
362
+ $table.css(layoutFixed);
363
+ $floatTable.css(layoutFixed);
364
+ $floatTable.append($header); //append because colgroup must go first in chrome
365
+ $tbody.before($newHeader);
366
+ setHeaderHeight();
367
+ }
368
+ }
369
+ function unfloat(){ //put the header back into the table
370
+ if(headerFloated){
371
+ headerFloated = false;
372
+ if(useAbsolutePositioning){ //#53, #56
373
+ $table.width(originalTableWidth);
374
+ }
375
+ $newHeader.detach();
376
+ $table.prepend($header);
377
+ $table.css(layoutAuto);
378
+ $floatTable.css(layoutAuto);
379
+ }
380
+ }
381
+ function changePositioning(isAbsolute){
382
+ if(useAbsolutePositioning != isAbsolute){
383
+ useAbsolutePositioning = isAbsolute;
384
+ $floatContainer.css({
385
+ position: useAbsolutePositioning ? 'absolute' : 'fixed'
386
+ });
387
+ }
388
+ }
389
+ function getSizingRow($table, $cols, $fthCells, ieVersion){
390
+ if(isChrome){
391
+ return $fthCells;
392
+ } else if(ieVersion) {
393
+ return opts.getSizingRow($table, $cols, $fthCells);
394
+ } else {
395
+ return $cols;
396
+ }
397
+ }
398
+
399
+ /**
400
+ * returns a function that updates the floating header's cell widths.
401
+ * @return {Function}
402
+ */
403
+ function reflow(){
404
+ var i;
405
+ var numCols = columnNum(); //if the tables columns change dynamically since last time (datatables) we need to rebuild the sizer rows and get new count
406
+ return function(){
407
+ var $rowCells = getSizingRow($table, $tableCells, $fthCells, ieVersion);
408
+ if($rowCells.length == numCols && numCols > 0){
409
+ if(!existingColGroup){
410
+ for(i=0; i < numCols; i++){
411
+ $tableCells.eq(i).css('width', '');
412
+ }
413
+ }
414
+ unfloat();
415
+ for(i=0; i < numCols; i++){
416
+ var _rowcell = $rowCells.get(i);
417
+ var rowWidth = _rowcell.offsetWidth;
418
+ $headerCells.eq(i).width(rowWidth);
419
+ $tableCells.eq(i).width(rowWidth);
420
+ }
421
+ refloat();
422
+ } else {
423
+ $floatTable.append($header);
424
+ $table.css(layoutAuto);
425
+ $floatTable.css(layoutAuto);
426
+ setHeaderHeight();
427
+ }
428
+ };
429
+ }
430
+
431
+ /**
432
+ * first performs initial calculations that we expect to not change when the table, window, or scrolling container are scrolled.
433
+ * returns a function that calculates the floating container's top and left coords. takes into account if we are using page scrolling or inner scrolling
434
+ * @return {Function}
435
+ */
436
+ function calculateFloatContainerPosFn(){
437
+ var scrollingContainerTop = $scrollContainer.scrollTop();
438
+
439
+ //this floatEnd calc was moved out of the returned function because we assume the table height doesnt change (otherwise we must reinit by calling calculateFloatContainerPosFn)
440
+ var floatEnd;
441
+ var tableContainerGap = 0;
442
+ var captionHeight = haveCaption ? $caption.outerHeight(true) : 0;
443
+ var captionScrollOffset = captionAlignTop ? captionHeight : -captionHeight;
444
+
445
+ var floatContainerHeight = $floatContainer.height();
446
+ var tableOffset = $table.offset();
447
+ if(locked){
448
+ var containerOffset = $scrollContainer.offset();
449
+ tableContainerGap = tableOffset.top - containerOffset.top + scrollingContainerTop;
450
+ if(haveCaption && captionAlignTop){
451
+ tableContainerGap += captionHeight;
452
+ }
453
+ } else {
454
+ floatEnd = tableOffset.top - scrollingTop - floatContainerHeight + scrollingBottom + scrollbarOffset.horizontal;
455
+ }
456
+ var windowTop = $window.scrollTop();
457
+ var windowLeft = $window.scrollLeft();
458
+ var scrollContainerLeft = $scrollContainer.scrollLeft();
459
+ scrollingContainerTop = $scrollContainer.scrollTop();
460
+
461
+
462
+
463
+ return function(eventType){
464
+ if(eventType == 'windowScroll'){
465
+ windowTop = $window.scrollTop();
466
+ windowLeft = $window.scrollLeft();
467
+ } else if(eventType == 'containerScroll'){
468
+ scrollingContainerTop = $scrollContainer.scrollTop();
469
+ scrollContainerLeft = $scrollContainer.scrollLeft();
470
+ } else if(eventType != 'init') {
471
+ windowTop = $window.scrollTop();
472
+ windowLeft = $window.scrollLeft();
473
+ scrollingContainerTop = $scrollContainer.scrollTop();
474
+ scrollContainerLeft = $scrollContainer.scrollLeft();
475
+ }
476
+ if(isChrome && (windowTop < 0 || windowLeft < 0)){ //chrome overscroll effect at the top of the page - breaks fixed positioned floated headers
477
+ return;
478
+ }
479
+
480
+ if(absoluteToFixedOnScroll){
481
+ if(eventType == 'windowScrollDone'){
482
+ changePositioning(true); //change to absolute
483
+ } else {
484
+ changePositioning(false); //change to fixed
485
+ }
486
+ } else if(eventType == 'windowScrollDone'){
487
+ return null; //event is fired when they stop scrolling. ignore it if not 'absoluteToFixedOnScroll'
488
+ }
489
+
490
+ tableOffset = $table.offset();
491
+ if(haveCaption && captionAlignTop){
492
+ tableOffset.top += captionHeight;
493
+ }
494
+ var top, left;
495
+ var tableHeight = $table.outerHeight();
496
+
497
+ if(locked && useAbsolutePositioning){ //inner scrolling, absolute positioning
498
+ if (tableContainerGap >= scrollingContainerTop) {
499
+ var gap = tableContainerGap - scrollingContainerTop;
500
+ gap = gap > 0 ? gap : 0;
501
+ top = gap;
502
+ } else {
503
+ top = wrappedContainer ? 0 : scrollingContainerTop;
504
+ //headers stop at the top of the viewport
505
+ }
506
+ left = 0;
507
+ } else if(!locked && useAbsolutePositioning) { //window scrolling, absolute positioning
508
+ if(windowTop > floatEnd + tableHeight + captionScrollOffset){
509
+ top = tableHeight - floatContainerHeight + captionScrollOffset; //scrolled past table
510
+ } else if (tableOffset.top > windowTop + scrollingTop) {
511
+ top = 0; //scrolling to table
512
+ unfloat();
513
+ } else {
514
+ top = scrollingTop + windowTop - tableOffset.top + tableContainerGap + (captionAlignTop ? captionHeight : 0);
515
+ refloat(); //scrolling within table. header floated
516
+ }
517
+ left = 0;
518
+ } else if(locked && !useAbsolutePositioning){ //inner scrolling, fixed positioning
519
+ if (tableContainerGap > scrollingContainerTop || scrollingContainerTop - tableContainerGap > tableHeight) {
520
+ top = tableOffset.top - windowTop;
521
+ unfloat();
522
+ } else {
523
+ top = tableOffset.top + scrollingContainerTop - windowTop - tableContainerGap;
524
+ refloat();
525
+ //headers stop at the top of the viewport
526
+ }
527
+ left = tableOffset.left + scrollContainerLeft - windowLeft;
528
+ } else if(!locked && !useAbsolutePositioning) { //window scrolling, fixed positioning
529
+ if(windowTop > floatEnd + tableHeight + captionScrollOffset){
530
+ top = tableHeight + scrollingTop - windowTop + floatEnd + captionScrollOffset;
531
+ //scrolled past the bottom of the table
532
+ } else if (tableOffset.top > windowTop + scrollingTop) {
533
+ top = tableOffset.top - windowTop;
534
+ refloat();
535
+ //scrolled past the top of the table
536
+ } else {
537
+ //scrolling within the table
538
+ top = scrollingTop;
539
+ }
540
+ left = tableOffset.left - windowLeft;
541
+ }
542
+ return {top: top, left: left};
543
+ };
544
+ }
545
+ /**
546
+ * returns a function that caches old floating container position and only updates css when the position changes
547
+ * @return {Function}
548
+ */
549
+ function repositionFloatContainerFn(){
550
+ var oldTop = null;
551
+ var oldLeft = null;
552
+ var oldScrollLeft = null;
553
+ return function(pos, setWidth, setHeight){
554
+ if(pos != null && (oldTop != pos.top || oldLeft != pos.left)){
555
+ $floatContainer.css({
556
+ top: pos.top,
557
+ left: pos.left
558
+ });
559
+ oldTop = pos.top;
560
+ oldLeft = pos.left;
561
+ }
562
+ if(setWidth){
563
+ setFloatWidth();
564
+ }
565
+ if(setHeight){
566
+ setHeaderHeight();
567
+ }
568
+ var scrollLeft = $scrollContainer.scrollLeft();
569
+ if(oldScrollLeft != scrollLeft){
570
+ $floatContainer.scrollLeft(scrollLeft);
571
+ oldScrollLeft = scrollLeft;
572
+ }
573
+ }
574
+ }
575
+
576
+ /**
577
+ * checks if THIS table has scrollbars, and finds their widths
578
+ */
579
+ function calculateScrollBarSize(){ //this should happen after the floating table has been positioned
580
+ if($scrollContainer.length){
581
+ var sw = $scrollContainer.width(), sh = $scrollContainer.height(), th = $table.height(), tw = $table.width();
582
+ var offseth = sw < tw ? scWidth : 0;
583
+ var offsetv = sh < th ? scWidth : 0;
584
+ scrollbarOffset.horizontal = sw - offsetv < tw ? scWidth : 0;
585
+ scrollbarOffset.vertical = sh - offseth < th ? scWidth: 0;
586
+ }
587
+ }
588
+ //finish up. create all calculation functions and bind them to events
589
+ calculateScrollBarSize();
590
+
591
+ var flow;
592
+
593
+ var ensureReflow = function(){
594
+ flow = reflow();
595
+ flow();
596
+ };
597
+
598
+ ensureReflow();
599
+
600
+ var calculateFloatContainerPos = calculateFloatContainerPosFn();
601
+ var repositionFloatContainer = repositionFloatContainerFn();
602
+
603
+ repositionFloatContainer(calculateFloatContainerPos('init'), true); //this must come after reflow because reflow changes scrollLeft back to 0 when it rips out the thead
604
+
605
+ var windowScrollDoneEvent = util.debounce(function(){
606
+ repositionFloatContainer(calculateFloatContainerPos('windowScrollDone'), false);
607
+ }, 300);
608
+
609
+ var windowScrollEvent = function(){
610
+ repositionFloatContainer(calculateFloatContainerPos('windowScroll'), false);
611
+ windowScrollDoneEvent();
612
+ };
613
+ var containerScrollEvent = function(){
614
+ repositionFloatContainer(calculateFloatContainerPos('containerScroll'), false);
615
+ };
616
+
617
+
618
+ var windowResizeEvent = function(){
619
+ updateScrollingOffsets();
620
+ calculateScrollBarSize();
621
+ ensureReflow();
622
+ calculateFloatContainerPos = calculateFloatContainerPosFn();
623
+ repositionFloatContainer = repositionFloatContainerFn();
624
+ repositionFloatContainer(calculateFloatContainerPos('resize'), true, true);
625
+ };
626
+ var reflowEvent = util.debounce(function(){
627
+ calculateScrollBarSize();
628
+ updateScrollingOffsets();
629
+ ensureReflow();
630
+ calculateFloatContainerPos = calculateFloatContainerPosFn();
631
+ repositionFloatContainer(calculateFloatContainerPos('reflow'), true);
632
+ }, 1);
633
+ if(locked){ //internal scrolling
634
+ if(useAbsolutePositioning){
635
+ $scrollContainer.on(eventName('scroll'), containerScrollEvent);
636
+ } else {
637
+ $scrollContainer.on(eventName('scroll'), containerScrollEvent);
638
+ $window.on(eventName('scroll'), windowScrollEvent);
639
+ }
640
+ } else { //window scrolling
641
+ $window.on(eventName('scroll'), windowScrollEvent);
642
+ }
643
+
644
+ $window.on(eventName('load'), reflowEvent); //for tables with images
645
+
646
+ windowResize(opts.debounceResizeMs, eventName('resize'), windowResizeEvent);
647
+ $table.on('reflow', reflowEvent);
648
+ if(isDatatable($table)){
649
+ $table
650
+ .on('filter', reflowEvent)
651
+ .on('sort', reflowEvent)
652
+ .on('page', reflowEvent);
653
+ }
654
+
655
+ //attach some useful functions to the table.
656
+ $table.data('floatThead-attached', {
657
+ destroy: function(){
658
+ var ns = '.fth-'+floatTheadId;
659
+ unfloat();
660
+ $table.css(layoutAuto);
661
+ $tableColGroup.remove();
662
+ isChrome && $fthGrp.remove();
663
+ if($newHeader.parent().length){ //only if its in the dom
664
+ $newHeader.replaceWith($header);
665
+ }
666
+ $table.off('reflow');
667
+ $scrollContainer.off(ns);
668
+ if (wrappedContainer) {
669
+ $scrollContainer.unwrap();
670
+ }
671
+ $floatContainer.remove();
672
+ $table.data('floatThead-attached', false);
673
+
674
+ $window.off(ns);
675
+ },
676
+ reflow: function(){
677
+ reflowEvent();
678
+ },
679
+ setHeaderHeight: function(){
680
+ setHeaderHeight();
681
+ },
682
+ getFloatContainer: function(){
683
+ return $floatContainer;
684
+ },
685
+ getRowGroups: function(){
686
+ if(headerFloated){
687
+ return $floatContainer.find("thead").add($table.find("tbody,tfoot"));
688
+ } else {
689
+ return $table.find("thead,tbody,tfoot");
690
+ }
691
+ }
692
+ });
693
+ floatTheadCreated++;
694
+ });
695
+ return this;
696
+ };
697
+ })(jQuery);
698
+
699
+ /* jQuery.floatThead.utils - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2014 Misha Koryak
700
+ * License: MIT
701
+ *
702
+ * This file is required if you do not use underscore in your project and you want to use floatThead.
703
+ * It contains functions from underscore that the plugin uses.
704
+ *
705
+ * YOU DON'T NEED TO INCLUDE THIS IF YOU ALREADY INCLUDE UNDERSCORE!
706
+ *
707
+ */
708
+
709
+ (function($){
710
+
711
+ $.floatThead = $.floatThead || {};
712
+
713
+ $.floatThead._ = window._ || (function(){
714
+ var that = {};
715
+ var hasOwnProperty = Object.prototype.hasOwnProperty, isThings = ['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'];
716
+ that.has = function(obj, key) {
717
+ return hasOwnProperty.call(obj, key);
718
+ };
719
+ that.keys = function(obj) {
720
+ if (obj !== Object(obj)) throw new TypeError('Invalid object');
721
+ var keys = [];
722
+ for (var key in obj) if (that.has(obj, key)) keys.push(key);
723
+ return keys;
724
+ };
725
+ $.each(isThings, function(){
726
+ var name = this;
727
+ that['is' + name] = function(obj) {
728
+ return Object.prototype.toString.call(obj) == '[object ' + name + ']';
729
+ };
730
+ });
731
+ that.debounce = function(func, wait, immediate) {
732
+ var timeout, args, context, timestamp, result;
733
+ return function() {
734
+ context = this;
735
+ args = arguments;
736
+ timestamp = new Date();
737
+ var later = function() {
738
+ var last = (new Date()) - timestamp;
739
+ if (last < wait) {
740
+ timeout = setTimeout(later, wait - last);
741
+ } else {
742
+ timeout = null;
743
+ if (!immediate) result = func.apply(context, args);
744
+ }
745
+ };
746
+ var callNow = immediate && !timeout;
747
+ if (!timeout) {
748
+ timeout = setTimeout(later, wait);
749
+ }
750
+ if (callNow) result = func.apply(context, args);
751
+ return result;
752
+ };
753
+ };
754
+ return that;
755
+ })();
756
+ })(jQuery);
757
+
languages/cpac-fr_FR.po CHANGED
@@ -1,17 +1,17 @@
1
- #
2
  # Translators:
3
  # 16kbit <code@ms-studio.net>, 2014
4
  # Jean-Christophe Brebion <pro@jcbrebion.com>, 2014
 
5
  # Etic <pub@eticweb.ca>, 2014
6
  msgid ""
7
  msgstr ""
8
  "Project-Id-Version: Admin Columns\n"
9
  "Report-Msgid-Bugs-To: \n"
10
  "POT-Creation-Date: 2014-05-22 17:03+0100\n"
11
- "PO-Revision-Date: 2014-06-23 11:39+0100\n"
12
- "Last-Translator: Codepress <info@codepress.nl>\n"
13
- "Language-Team: French (France) (http://www.transifex.com/projects/p/admin-"
14
- "columns/language/fr_FR/)\n"
15
  "MIME-Version: 1.0\n"
16
  "Content-Type: text/plain; charset=UTF-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
@@ -20,17 +20,17 @@ msgstr ""
20
  "X-Generator: Poedit 1.6.5\n"
21
  "X-Poedit-Basepath: .\n"
22
  "X-Poedit-KeywordsList: __;_e\n"
23
- "X-Poedit-SourceCharset: UTF-8\n"
24
  "X-Poedit-SearchPath-0: .\n"
25
  "X-Poedit-SearchPath-1: ..\n"
 
26
 
27
  #: ../classes/addons.php:117
28
  msgid "Third party plugin integration"
29
- msgstr ""
30
 
31
  #: ../classes/addons.php:142
32
  msgid "Advanced Custom Fields"
33
- msgstr ""
34
 
35
  #: ../classes/addons.php:143
36
  msgid ""
@@ -71,9 +71,7 @@ msgstr "Exemple :"
71
  msgid ""
72
  "Leave empty for WordPress date format, change your <a href=\"%s\">default "
73
  "date format here</a>."
74
- msgstr ""
75
- "Laisser vide pour utiliser le format spécifié par WordPress, modifier votre "
76
- "<a href=\"%s\">votre format de date par défaut ici</a>."
77
 
78
  #: ../classes/column.php:761
79
  msgid "Documentation on date and time formatting."
@@ -162,11 +160,11 @@ msgstr "Par défaut"
162
 
163
  #: ../classes/column/acf-placeholder.php:16
164
  msgid "ACF Field"
165
- msgstr ""
166
 
167
  #: ../classes/column/acf-placeholder.php:32
168
  msgid "This feature is only available in Admin Columns Pro - Developer."
169
- msgstr ""
170
 
171
  #: ../classes/column/acf-placeholder.php:35
172
  #, php-format
@@ -178,13 +176,13 @@ msgstr ""
178
  #: ../classes/column/acf-placeholder.php:38
179
  msgid ""
180
  "Admin Columns Pro - Developer offers full Advanced Custom Fields "
181
- "integeration, allowing you to easily display and edit ACF fields from within "
182
- "your posts overview."
183
  msgstr ""
184
 
185
  #: ../classes/column/acf-placeholder.php:40
186
  msgid "Find out more"
187
- msgstr ""
188
 
189
  #: ../classes/column/comment/actions.php:14
190
  #: ../classes/column/link/actions.php:14
@@ -293,7 +291,7 @@ msgstr "Par défaut"
293
 
294
  #: ../classes/column/custom-field.php:66
295
  msgid "Checkmark (true/false)"
296
- msgstr ""
297
 
298
  #: ../classes/column/custom-field.php:67 ../classes/settings.php:304
299
  msgid "Color"
@@ -301,7 +299,7 @@ msgstr "Couleur"
301
 
302
  #: ../classes/column/custom-field.php:68 ../classes/settings.php:305
303
  msgid "Counter"
304
- msgstr ""
305
 
306
  #: ../classes/column/custom-field.php:71 ../classes/column/link/image.php:12
307
  #: ../classes/settings.php:296
@@ -326,7 +324,7 @@ msgstr "Titre du post (Post ID)"
326
 
327
  #: ../classes/column/custom-field.php:76
328
  msgid "Username (User ID's)"
329
- msgstr ""
330
 
331
  #: ../classes/column/custom-field.php:384
332
  msgid "Select your custom field."
@@ -391,7 +389,7 @@ msgstr "Tailles disponibles"
391
 
392
  #: ../classes/column/media/available-sizes.php:37
393
  msgid "full size"
394
- msgstr ""
395
 
396
  #: ../classes/column/media/caption.php:12
397
  #: ../classes/column/media/exif-data.php:36
@@ -412,27 +410,27 @@ msgstr "Ouverture"
412
 
413
  #: ../classes/column/media/exif-data.php:34
414
  msgid "Credit"
415
- msgstr ""
416
 
417
  #: ../classes/column/media/exif-data.php:35
418
  msgid "Camera"
419
- msgstr ""
420
 
421
  #: ../classes/column/media/exif-data.php:37
422
  msgid "Timestamp"
423
- msgstr ""
424
 
425
  #: ../classes/column/media/exif-data.php:38
426
  msgid "Copyright EXIF"
427
- msgstr ""
428
 
429
  #: ../classes/column/media/exif-data.php:39
430
  msgid "Focal Length"
431
- msgstr ""
432
 
433
  #: ../classes/column/media/exif-data.php:40
434
  msgid "ISO"
435
- msgstr ""
436
 
437
  #: ../classes/column/media/exif-data.php:41
438
  msgid "Shutter Speed"
@@ -452,7 +450,7 @@ msgstr "Taille du fichier"
452
 
453
  #: ../classes/column/media/full-path.php:12
454
  msgid "Full path"
455
- msgstr ""
456
 
457
  #: ../classes/column/media/height.php:12
458
  msgid "Height"
@@ -516,19 +514,19 @@ msgstr "Pièce jointe"
516
 
517
  #: ../classes/column/post/author-name.php:12
518
  msgid "Display Author As"
519
- msgstr ""
520
 
521
  #: ../classes/column/post/author-name.php:34
522
  msgid "Display Name"
523
- msgstr ""
524
 
525
  #: ../classes/column/post/author-name.php:35
526
  msgid "First Name"
527
- msgstr ""
528
 
529
  #: ../classes/column/post/author-name.php:36
530
  msgid "Last Name"
531
- msgstr ""
532
 
533
  #: ../classes/column/post/author-name.php:37
534
  #: ../classes/column/user/nickname.php:14
@@ -537,11 +535,11 @@ msgstr "Surnom"
537
 
538
  #: ../classes/column/post/author-name.php:38
539
  msgid "User Login"
540
- msgstr ""
541
 
542
  #: ../classes/column/post/author-name.php:39
543
  msgid "User Email"
544
- msgstr ""
545
 
546
  #: ../classes/column/post/author-name.php:40 ../classes/column/user/ID.php:14
547
  msgid "User ID"
@@ -553,11 +551,11 @@ msgstr "Nom et prénom"
553
 
554
  #: ../classes/column/post/author-name.php:118
555
  msgid "This is the format of the author name."
556
- msgstr ""
557
 
558
  #: ../classes/column/post/before-moretag.php:14
559
  msgid "Before More Tag"
560
- msgstr ""
561
 
562
  #: ../classes/column/post/comment-count.php:14
563
  msgid "Comment count"
@@ -569,7 +567,7 @@ msgstr "Total"
569
 
570
  #: ../classes/column/post/comment-count.php:32
571
  msgid "Pending"
572
- msgstr ""
573
 
574
  #: ../classes/column/post/comment-count.php:33
575
  msgid "Spam"
@@ -582,7 +580,7 @@ msgstr "Status de commentaire"
582
 
583
  #: ../classes/column/post/comment-count.php:95
584
  msgid "Select which comment status you like to display."
585
- msgstr ""
586
 
587
  #: ../classes/column/post/featured-image.php:14
588
  msgid "Featured Image"
@@ -606,11 +604,11 @@ msgstr "Modèle de page"
606
 
607
  #: ../classes/column/post/parent.php:12
608
  msgid "Parent"
609
- msgstr ""
610
 
611
  #: ../classes/column/post/permalink.php:12
612
  msgid "Permalink"
613
- msgstr ""
614
 
615
  #: ../classes/column/post/ping-status.php:14
616
  msgid "Ping status"
@@ -638,7 +636,7 @@ msgstr "Brouillon"
638
 
639
  #: ../classes/column/post/status.php:34
640
  msgid "Scheduled"
641
- msgstr ""
642
 
643
  #: ../classes/column/post/status.php:35
644
  msgid "Private"
@@ -646,11 +644,11 @@ msgstr "Privé"
646
 
647
  #: ../classes/column/post/status.php:36
648
  msgid "Pending Review"
649
- msgstr ""
650
 
651
  #: ../classes/column/post/status.php:37
652
  msgid "Auto Draft"
653
- msgstr ""
654
 
655
  #: ../classes/column/post/sticky.php:14
656
  msgid "Sticky"
@@ -674,11 +672,11 @@ msgstr "Nom"
674
 
675
  #: ../classes/column/user/post-count.php:14
676
  msgid "Post Count"
677
- msgstr ""
678
 
679
  #: ../classes/column/user/post-count.php:99
680
  msgid "Post Type"
681
- msgstr ""
682
 
683
  #: ../classes/column/user/registered.php:14
684
  msgid "Registered"
@@ -690,11 +688,11 @@ msgstr "URL"
690
 
691
  #: ../classes/settings.php:97
692
  msgid "Add-on successfully activated."
693
- msgstr ""
694
 
695
  #: ../classes/settings.php:100
696
  msgid "Add-on successfully deactivated."
697
- msgstr ""
698
 
699
  #: ../classes/settings.php:155
700
  msgid "Admin Columns Settings"
@@ -723,11 +721,7 @@ msgid ""
723
  "This plugin is for adding and removing additional columns to the "
724
  "administration screens for post(types), pages, media library, comments, "
725
  "links and users. Change the column's label and reorder them."
726
- msgstr ""
727
- "Cette extension permet l'ajout et la suppression de colonnes additionnelles "
728
- "dans les écrans d'administration pour les articles (types), pages, librairie "
729
- "des médias, commentaires, liens et usagers. Modifier le libellé des colonnes "
730
- "et réarranger leur ordre à votre guise."
731
 
732
  #: ../classes/settings.php:279
733
  msgid "Basics"
@@ -740,9 +734,7 @@ msgstr "Modifier l'ordre"
740
  #: ../classes/settings.php:282
741
  msgid ""
742
  "By dragging the columns you can change the order which they will appear in."
743
- msgstr ""
744
- "En déplaçant les colonnes vous modifierez ainsi l'ordre dans lequel ils "
745
- "apparaissent."
746
 
747
  #: ../classes/settings.php:283
748
  msgid "Change label"
@@ -788,12 +780,13 @@ msgstr ""
788
 
789
  #: ../classes/settings.php:297
790
  msgid "Value: This will show the first 20 words of the Post content."
791
- msgstr ""
792
 
793
  #: ../classes/settings.php:298
794
  msgid ""
795
- "Value: should be an array. This will flatten any ( multi dimensional ) array."
796
- msgstr ""
 
797
 
798
  #: ../classes/settings.php:299
799
  msgid ""
@@ -811,7 +804,7 @@ msgstr ""
811
 
812
  #: ../classes/settings.php:301
813
  msgid "Post Titles"
814
- msgstr ""
815
 
816
  #: ../classes/settings.php:301
817
  msgid "Value: can be one or more Post ID's (seperated by ',')."
@@ -819,7 +812,7 @@ msgstr ""
819
 
820
  #: ../classes/settings.php:302
821
  msgid "Usernames"
822
- msgstr ""
823
 
824
  #: ../classes/settings.php:302
825
  msgid "Value: can be one or more User ID's (seperated by ',')."
@@ -827,15 +820,15 @@ msgstr ""
827
 
828
  #: ../classes/settings.php:303
829
  msgid "Checkmark"
830
- msgstr ""
831
 
832
  #: ../classes/settings.php:303
833
  msgid "Value: should be a 1 (one) or 0 (zero)."
834
- msgstr ""
835
 
836
  #: ../classes/settings.php:304
837
  msgid "Value: hex value color, such as #808080."
838
- msgstr ""
839
 
840
  #: ../classes/settings.php:305
841
  msgid ""
@@ -863,7 +856,7 @@ msgstr "Quoi de neuf"
863
 
864
  #: ../classes/settings.php:409
865
  msgid "Changelog"
866
- msgstr ""
867
 
868
  #: ../classes/settings.php:414
869
  msgid "Addons"
@@ -887,11 +880,11 @@ msgstr ""
887
 
888
  #: ../classes/settings.php:422
889
  msgid "Download your Addons"
890
- msgstr ""
891
 
892
  #: ../classes/settings.php:428
893
  msgid "This website does not use add-ons"
894
- msgstr ""
895
 
896
  #: ../classes/settings.php:428
897
  msgid "See our website for Admin Columns Pro."
@@ -907,13 +900,13 @@ msgstr "Changements dans la base de données"
907
 
908
  #: ../classes/settings.php:438
909
  msgid ""
910
- "The database has been changed between versions 1 and 2. But we made sure you "
911
- "can still roll back to version 1x without any issues."
912
- msgstr ""
913
 
914
  #: ../classes/settings.php:441
915
  msgid "Make sure you backup your database and then click"
916
- msgstr ""
917
 
918
  #: ../classes/settings.php:441 ../classes/upgrade.php:91
919
  msgid "Upgrade Database"
@@ -925,9 +918,9 @@ msgstr "Problèmes potentiels"
925
 
926
  #: ../classes/settings.php:445
927
  msgid ""
928
- "Do to the sizable refactoring the code, surounding Addons and action/"
929
- "filters, your website may not operate correctly. It is important that you "
930
- "read the full"
931
  msgstr ""
932
 
933
  #: ../classes/settings.php:445
@@ -936,7 +929,7 @@ msgstr "Migration de la v1 à la v2"
936
 
937
  #: ../classes/settings.php:445
938
  msgid "guide to view the full list of changes."
939
- msgstr ""
940
 
941
  #: ../classes/settings.php:445
942
  #, php-format
@@ -998,9 +991,7 @@ msgstr "Rétablir les réglages"
998
 
999
  #: ../classes/settings.php:594
1000
  msgid "This will delete all column settings and restore the default settings."
1001
- msgstr ""
1002
- "Cette opération va supprimer tous les paramètres de colonnes et restaure "
1003
- "tous les paramètres par défaut."
1004
 
1005
  #: ../classes/settings.php:600
1006
  msgid "Restore default settings"
@@ -1010,9 +1001,7 @@ msgstr "Restaurer les paramètres par défaut"
1010
  msgid ""
1011
  "Warning! ALL saved admin columns data will be deleted. This cannot be "
1012
  "undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
1013
- msgstr ""
1014
- "Attention! Tous les données des colonnes d'administration seront supprimées. "
1015
- "Cela n'est pas irréversible. \\'OK\\' supprimer, \\'Annuler\\' arrêter"
1016
 
1017
  #: ../classes/settings.php:620 ../codepress-admin-columns.php:354
1018
  msgid "Settings"
@@ -1020,25 +1009,25 @@ msgstr "Réglages"
1020
 
1021
  #: ../classes/settings.php:621
1022
  msgid "Add-ons"
1023
- msgstr ""
1024
 
1025
  #: ../classes/settings.php:647
1026
  msgid "Posttypes"
1027
- msgstr ""
1028
 
1029
  #: ../classes/settings.php:648
1030
  msgid "Others"
1031
- msgstr ""
1032
 
1033
  #: ../classes/settings.php:649
1034
  msgid "Taxonomies"
1035
- msgstr ""
1036
 
1037
  #: ../classes/settings.php:668
1038
  #, php-format
1039
  msgid ""
1040
- "The columns for <strong>%s</strong> are set up via PHP and can therefore not "
1041
- "be edited in the admin panel."
1042
  msgstr ""
1043
 
1044
  #: ../classes/settings.php:678
@@ -1052,8 +1041,8 @@ msgstr "Mettre à jour"
1052
  #: ../classes/settings.php:686
1053
  #, php-format
1054
  msgid ""
1055
- "Warning! The %s columns data will be deleted. This cannot be undone. \\'OK"
1056
- "\\' to delete, \\'Cancel\\' to stop"
1057
  msgstr ""
1058
 
1059
  #: ../classes/settings.php:687
@@ -1066,19 +1055,19 @@ msgstr ""
1066
 
1067
  #: ../classes/settings.php:705
1068
  msgid "Add Sorting"
1069
- msgstr ""
1070
 
1071
  #: ../classes/settings.php:706
1072
  msgid "Add Filtering"
1073
- msgstr ""
1074
 
1075
  #: ../classes/settings.php:707
1076
  msgid "Add Import/Export"
1077
- msgstr ""
1078
 
1079
  #: ../classes/settings.php:708
1080
  msgid "Add Direct Editing"
1081
- msgstr ""
1082
 
1083
  #: ../classes/settings.php:711
1084
  #, php-format
@@ -1110,27 +1099,27 @@ msgstr "Ajouter une colonne."
1110
 
1111
  #: ../classes/settings.php:853
1112
  msgid "Active"
1113
- msgstr ""
1114
 
1115
  #: ../classes/settings.php:854
1116
  msgid "Deactivate"
1117
- msgstr ""
1118
 
1119
  #: ../classes/settings.php:861
1120
  msgid "Installed"
1121
- msgstr ""
1122
 
1123
  #: ../classes/settings.php:862
1124
  msgid "Activate"
1125
- msgstr ""
1126
 
1127
  #: ../classes/settings.php:876
1128
  msgid "Download & Install"
1129
- msgstr ""
1130
 
1131
  #: ../classes/settings.php:881
1132
  msgid "Get this add-on"
1133
- msgstr ""
1134
 
1135
  #: ../classes/storage_model.php:207
1136
  msgid "settings succesfully restored."
@@ -1138,17 +1127,17 @@ msgstr "les paramètres ont été restaurés avec succès."
1138
 
1139
  #: ../classes/storage_model.php:222
1140
  msgid "No columns settings available."
1141
- msgstr ""
1142
 
1143
  #: ../classes/storage_model.php:243
1144
  #, php-format
1145
  msgid "You are trying to store the same settings for %s."
1146
- msgstr ""
1147
 
1148
  #: ../classes/storage_model.php:247
1149
  #, php-format
1150
  msgid "Settings for %s updated succesfully."
1151
- msgstr ""
1152
 
1153
  #: ../classes/storage_model/comment.php:13
1154
  msgid "Comments"
@@ -1188,7 +1177,7 @@ msgstr "puis cliquer"
1188
 
1189
  #: ../classes/upgrade.php:298
1190
  msgid "Migrating Column Settings"
1191
- msgstr ""
1192
 
1193
  #: ../classes/upgrade.php:334
1194
  msgid "No Upgrade Required"
@@ -1214,7 +1203,7 @@ msgstr "Erreur"
1214
  msgid ""
1215
  "Sorry. Something went wrong during the upgrade process. Please report this "
1216
  "on the support forum."
1217
- msgstr ""
1218
 
1219
  #: ../codepress-admin-columns.php:439
1220
  msgid "Edit columns"
1
+ #
2
  # Translators:
3
  # 16kbit <code@ms-studio.net>, 2014
4
  # Jean-Christophe Brebion <pro@jcbrebion.com>, 2014
5
+ # Mohamed-Younès BOUMEDIENE <m-boumediene@live.fr>, 2014
6
  # Etic <pub@eticweb.ca>, 2014
7
  msgid ""
8
  msgstr ""
9
  "Project-Id-Version: Admin Columns\n"
10
  "Report-Msgid-Bugs-To: \n"
11
  "POT-Creation-Date: 2014-05-22 17:03+0100\n"
12
+ "PO-Revision-Date: 2014-07-04 14:43+0000\n"
13
+ "Last-Translator: Mohamed-Younès BOUMEDIENE <m-boumediene@live.fr>\n"
14
+ "Language-Team: French (France) (http://www.transifex.com/projects/p/admin-columns/language/fr_FR/)\n"
 
15
  "MIME-Version: 1.0\n"
16
  "Content-Type: text/plain; charset=UTF-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
20
  "X-Generator: Poedit 1.6.5\n"
21
  "X-Poedit-Basepath: .\n"
22
  "X-Poedit-KeywordsList: __;_e\n"
 
23
  "X-Poedit-SearchPath-0: .\n"
24
  "X-Poedit-SearchPath-1: ..\n"
25
+ "X-Poedit-SourceCharset: UTF-8\n"
26
 
27
  #: ../classes/addons.php:117
28
  msgid "Third party plugin integration"
29
+ msgstr "Troisième parties d'intégration du module complémentaire"
30
 
31
  #: ../classes/addons.php:142
32
  msgid "Advanced Custom Fields"
33
+ msgstr "Personnalisation avancée de champ"
34
 
35
  #: ../classes/addons.php:143
36
  msgid ""
71
  msgid ""
72
  "Leave empty for WordPress date format, change your <a href=\"%s\">default "
73
  "date format here</a>."
74
+ msgstr "Laisser vide pour utiliser le format spécifié par WordPress, modifier votre <a href=\"%s\">votre format de date par défaut ici</a>."
 
 
75
 
76
  #: ../classes/column.php:761
77
  msgid "Documentation on date and time formatting."
160
 
161
  #: ../classes/column/acf-placeholder.php:16
162
  msgid "ACF Field"
163
+ msgstr "Champ ACF"
164
 
165
  #: ../classes/column/acf-placeholder.php:32
166
  msgid "This feature is only available in Admin Columns Pro - Developer."
167
+ msgstr "Cette caractéristique est essentiellement disponible pour l'admin colonne Pro - Développeur."
168
 
169
  #: ../classes/column/acf-placeholder.php:35
170
  #, php-format
176
  #: ../classes/column/acf-placeholder.php:38
177
  msgid ""
178
  "Admin Columns Pro - Developer offers full Advanced Custom Fields "
179
+ "integeration, allowing you to easily display and edit ACF fields from within"
180
+ " your posts overview."
181
  msgstr ""
182
 
183
  #: ../classes/column/acf-placeholder.php:40
184
  msgid "Find out more"
185
+ msgstr "En savoir plus"
186
 
187
  #: ../classes/column/comment/actions.php:14
188
  #: ../classes/column/link/actions.php:14
291
 
292
  #: ../classes/column/custom-field.php:66
293
  msgid "Checkmark (true/false)"
294
+ msgstr "Cocher (vrai/faux)"
295
 
296
  #: ../classes/column/custom-field.php:67 ../classes/settings.php:304
297
  msgid "Color"
299
 
300
  #: ../classes/column/custom-field.php:68 ../classes/settings.php:305
301
  msgid "Counter"
302
+ msgstr "Compteur"
303
 
304
  #: ../classes/column/custom-field.php:71 ../classes/column/link/image.php:12
305
  #: ../classes/settings.php:296
324
 
325
  #: ../classes/column/custom-field.php:76
326
  msgid "Username (User ID's)"
327
+ msgstr "Nom d'utilisateur (ID d'utilisateur)"
328
 
329
  #: ../classes/column/custom-field.php:384
330
  msgid "Select your custom field."
389
 
390
  #: ../classes/column/media/available-sizes.php:37
391
  msgid "full size"
392
+ msgstr "Taille réelle"
393
 
394
  #: ../classes/column/media/caption.php:12
395
  #: ../classes/column/media/exif-data.php:36
410
 
411
  #: ../classes/column/media/exif-data.php:34
412
  msgid "Credit"
413
+ msgstr "Crédit"
414
 
415
  #: ../classes/column/media/exif-data.php:35
416
  msgid "Camera"
417
+ msgstr "Appareil photo"
418
 
419
  #: ../classes/column/media/exif-data.php:37
420
  msgid "Timestamp"
421
+ msgstr "Horodateur"
422
 
423
  #: ../classes/column/media/exif-data.php:38
424
  msgid "Copyright EXIF"
425
+ msgstr "Copyright EXIF"
426
 
427
  #: ../classes/column/media/exif-data.php:39
428
  msgid "Focal Length"
429
+ msgstr "Distance focale"
430
 
431
  #: ../classes/column/media/exif-data.php:40
432
  msgid "ISO"
433
+ msgstr "ISO"
434
 
435
  #: ../classes/column/media/exif-data.php:41
436
  msgid "Shutter Speed"
450
 
451
  #: ../classes/column/media/full-path.php:12
452
  msgid "Full path"
453
+ msgstr "Chemin d'accès complet"
454
 
455
  #: ../classes/column/media/height.php:12
456
  msgid "Height"
514
 
515
  #: ../classes/column/post/author-name.php:12
516
  msgid "Display Author As"
517
+ msgstr "Afficher l'auteur comme"
518
 
519
  #: ../classes/column/post/author-name.php:34
520
  msgid "Display Name"
521
+ msgstr "Afficher nom"
522
 
523
  #: ../classes/column/post/author-name.php:35
524
  msgid "First Name"
525
+ msgstr "Nom"
526
 
527
  #: ../classes/column/post/author-name.php:36
528
  msgid "Last Name"
529
+ msgstr "Prénom"
530
 
531
  #: ../classes/column/post/author-name.php:37
532
  #: ../classes/column/user/nickname.php:14
535
 
536
  #: ../classes/column/post/author-name.php:38
537
  msgid "User Login"
538
+ msgstr "Nom d'utilisateur"
539
 
540
  #: ../classes/column/post/author-name.php:39
541
  msgid "User Email"
542
+ msgstr "E-mail"
543
 
544
  #: ../classes/column/post/author-name.php:40 ../classes/column/user/ID.php:14
545
  msgid "User ID"
551
 
552
  #: ../classes/column/post/author-name.php:118
553
  msgid "This is the format of the author name."
554
+ msgstr "Ceci est le format du nom de l'auteur"
555
 
556
  #: ../classes/column/post/before-moretag.php:14
557
  msgid "Before More Tag"
558
+ msgstr "Avant plus de balise"
559
 
560
  #: ../classes/column/post/comment-count.php:14
561
  msgid "Comment count"
567
 
568
  #: ../classes/column/post/comment-count.php:32
569
  msgid "Pending"
570
+ msgstr "En attente"
571
 
572
  #: ../classes/column/post/comment-count.php:33
573
  msgid "Spam"
580
 
581
  #: ../classes/column/post/comment-count.php:95
582
  msgid "Select which comment status you like to display."
583
+ msgstr "Sélectionnez quel commentaire voulez-vous afficher."
584
 
585
  #: ../classes/column/post/featured-image.php:14
586
  msgid "Featured Image"
604
 
605
  #: ../classes/column/post/parent.php:12
606
  msgid "Parent"
607
+ msgstr "Parent"
608
 
609
  #: ../classes/column/post/permalink.php:12
610
  msgid "Permalink"
611
+ msgstr "Permalien"
612
 
613
  #: ../classes/column/post/ping-status.php:14
614
  msgid "Ping status"
636
 
637
  #: ../classes/column/post/status.php:34
638
  msgid "Scheduled"
639
+ msgstr "Planifié"
640
 
641
  #: ../classes/column/post/status.php:35
642
  msgid "Private"
644
 
645
  #: ../classes/column/post/status.php:36
646
  msgid "Pending Review"
647
+ msgstr "Avis en attente"
648
 
649
  #: ../classes/column/post/status.php:37
650
  msgid "Auto Draft"
651
+ msgstr "Projet automatique"
652
 
653
  #: ../classes/column/post/sticky.php:14
654
  msgid "Sticky"
672
 
673
  #: ../classes/column/user/post-count.php:14
674
  msgid "Post Count"
675
+ msgstr "Nombre d'article"
676
 
677
  #: ../classes/column/user/post-count.php:99
678
  msgid "Post Type"
679
+ msgstr "Type d'article"
680
 
681
  #: ../classes/column/user/registered.php:14
682
  msgid "Registered"
688
 
689
  #: ../classes/settings.php:97
690
  msgid "Add-on successfully activated."
691
+ msgstr "Module correctement activé."
692
 
693
  #: ../classes/settings.php:100
694
  msgid "Add-on successfully deactivated."
695
+ msgstr "Module correctement désactivé."
696
 
697
  #: ../classes/settings.php:155
698
  msgid "Admin Columns Settings"
721
  "This plugin is for adding and removing additional columns to the "
722
  "administration screens for post(types), pages, media library, comments, "
723
  "links and users. Change the column's label and reorder them."
724
+ msgstr "Cette extension permet l'ajout et la suppression de colonnes additionnelles dans les écrans d'administration pour les articles (types), pages, librairie des médias, commentaires, liens et usagers. Modifier le libellé des colonnes et réarranger leur ordre à votre guise."
 
 
 
 
725
 
726
  #: ../classes/settings.php:279
727
  msgid "Basics"
734
  #: ../classes/settings.php:282
735
  msgid ""
736
  "By dragging the columns you can change the order which they will appear in."
737
+ msgstr "En déplaçant les colonnes vous modifierez ainsi l'ordre dans lequel ils apparaissent."
 
 
738
 
739
  #: ../classes/settings.php:283
740
  msgid "Change label"
780
 
781
  #: ../classes/settings.php:297
782
  msgid "Value: This will show the first 20 words of the Post content."
783
+ msgstr "Utile : Ceci affiche les 20 premiers mots de l'article."
784
 
785
  #: ../classes/settings.php:298
786
  msgid ""
787
+ "Value: should be an array. This will flatten any ( multi dimensional ) "
788
+ "array."
789
+ msgstr "Utile : Ce devrait être un tableau. Ce sera n'importe quel tableau (multidimensionnel) flottant."
790
 
791
  #: ../classes/settings.php:299
792
  msgid ""
804
 
805
  #: ../classes/settings.php:301
806
  msgid "Post Titles"
807
+ msgstr "Titre de l'article"
808
 
809
  #: ../classes/settings.php:301
810
  msgid "Value: can be one or more Post ID's (seperated by ',')."
812
 
813
  #: ../classes/settings.php:302
814
  msgid "Usernames"
815
+ msgstr "Noms d'utilisateurs"
816
 
817
  #: ../classes/settings.php:302
818
  msgid "Value: can be one or more User ID's (seperated by ',')."
820
 
821
  #: ../classes/settings.php:303
822
  msgid "Checkmark"
823
+ msgstr "Cocher"
824
 
825
  #: ../classes/settings.php:303
826
  msgid "Value: should be a 1 (one) or 0 (zero)."
827
+ msgstr "Utile : Peut être la valeur un (1) ou zéro (0)."
828
 
829
  #: ../classes/settings.php:304
830
  msgid "Value: hex value color, such as #808080."
831
+ msgstr "Utile : code couleur en hexadécimal, comme #808080."
832
 
833
  #: ../classes/settings.php:305
834
  msgid ""
856
 
857
  #: ../classes/settings.php:409
858
  msgid "Changelog"
859
+ msgstr "Modifications"
860
 
861
  #: ../classes/settings.php:414
862
  msgid "Addons"
880
 
881
  #: ../classes/settings.php:422
882
  msgid "Download your Addons"
883
+ msgstr "Télécharger vos modules"
884
 
885
  #: ../classes/settings.php:428
886
  msgid "This website does not use add-ons"
887
+ msgstr "Ce site internet n'utilise pas de modules"
888
 
889
  #: ../classes/settings.php:428
890
  msgid "See our website for Admin Columns Pro."
900
 
901
  #: ../classes/settings.php:438
902
  msgid ""
903
+ "The database has been changed between versions 1 and 2. But we made sure you"
904
+ " can still roll back to version 1x without any issues."
905
+ msgstr "La base de données à été modifiée entre les versions 1 et 2. Mais nous sommes sûr que vous pouvez retourner à la version 1x sans aucun problème."
906
 
907
  #: ../classes/settings.php:441
908
  msgid "Make sure you backup your database and then click"
909
+ msgstr "Assurez-vous de sauvegarder votre base de données et cliquez "
910
 
911
  #: ../classes/settings.php:441 ../classes/upgrade.php:91
912
  msgid "Upgrade Database"
918
 
919
  #: ../classes/settings.php:445
920
  msgid ""
921
+ "Do to the sizable refactoring the code, surounding Addons and "
922
+ "action/filters, your website may not operate correctly. It is important that"
923
+ " you read the full"
924
  msgstr ""
925
 
926
  #: ../classes/settings.php:445
929
 
930
  #: ../classes/settings.php:445
931
  msgid "guide to view the full list of changes."
932
+ msgstr "guide pour voir la liste complète des modifications."
933
 
934
  #: ../classes/settings.php:445
935
  #, php-format
991
 
992
  #: ../classes/settings.php:594
993
  msgid "This will delete all column settings and restore the default settings."
994
+ msgstr "Cette opération va supprimer tous les paramètres de colonnes et restaure tous les paramètres par défaut."
 
 
995
 
996
  #: ../classes/settings.php:600
997
  msgid "Restore default settings"
1001
  msgid ""
1002
  "Warning! ALL saved admin columns data will be deleted. This cannot be "
1003
  "undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
1004
+ msgstr "Attention! Tous les données des colonnes d'administration seront supprimées. Cela n'est pas irréversible. \\'OK\\' supprimer, \\'Annuler\\' arrêter"
 
 
1005
 
1006
  #: ../classes/settings.php:620 ../codepress-admin-columns.php:354
1007
  msgid "Settings"
1009
 
1010
  #: ../classes/settings.php:621
1011
  msgid "Add-ons"
1012
+ msgstr "Modules"
1013
 
1014
  #: ../classes/settings.php:647
1015
  msgid "Posttypes"
1016
+ msgstr "Type d'article"
1017
 
1018
  #: ../classes/settings.php:648
1019
  msgid "Others"
1020
+ msgstr "Autres"
1021
 
1022
  #: ../classes/settings.php:649
1023
  msgid "Taxonomies"
1024
+ msgstr "Taxonomie"
1025
 
1026
  #: ../classes/settings.php:668
1027
  #, php-format
1028
  msgid ""
1029
+ "The columns for <strong>%s</strong> are set up via PHP and can therefore not"
1030
+ " be edited in the admin panel."
1031
  msgstr ""
1032
 
1033
  #: ../classes/settings.php:678
1041
  #: ../classes/settings.php:686
1042
  #, php-format
1043
  msgid ""
1044
+ "Warning! The %s columns data will be deleted. This cannot be undone. "
1045
+ "\\'OK\\' to delete, \\'Cancel\\' to stop"
1046
  msgstr ""
1047
 
1048
  #: ../classes/settings.php:687
1055
 
1056
  #: ../classes/settings.php:705
1057
  msgid "Add Sorting"
1058
+ msgstr "Ajouter le tri"
1059
 
1060
  #: ../classes/settings.php:706
1061
  msgid "Add Filtering"
1062
+ msgstr "Ajouter le filtrage"
1063
 
1064
  #: ../classes/settings.php:707
1065
  msgid "Add Import/Export"
1066
+ msgstr "Ajouter l'import/export"
1067
 
1068
  #: ../classes/settings.php:708
1069
  msgid "Add Direct Editing"
1070
+ msgstr "Ajouter la modification directe"
1071
 
1072
  #: ../classes/settings.php:711
1073
  #, php-format
1099
 
1100
  #: ../classes/settings.php:853
1101
  msgid "Active"
1102
+ msgstr "Actif"
1103
 
1104
  #: ../classes/settings.php:854
1105
  msgid "Deactivate"
1106
+ msgstr "Désactiver"
1107
 
1108
  #: ../classes/settings.php:861
1109
  msgid "Installed"
1110
+ msgstr "Installé"
1111
 
1112
  #: ../classes/settings.php:862
1113
  msgid "Activate"
1114
+ msgstr "Activer"
1115
 
1116
  #: ../classes/settings.php:876
1117
  msgid "Download & Install"
1118
+ msgstr "Télécharger & Installer"
1119
 
1120
  #: ../classes/settings.php:881
1121
  msgid "Get this add-on"
1122
+ msgstr "Obtenir ce module"
1123
 
1124
  #: ../classes/storage_model.php:207
1125
  msgid "settings succesfully restored."
1127
 
1128
  #: ../classes/storage_model.php:222
1129
  msgid "No columns settings available."
1130
+ msgstr "Aucun paramètre de colonne disponible."
1131
 
1132
  #: ../classes/storage_model.php:243
1133
  #, php-format
1134
  msgid "You are trying to store the same settings for %s."
1135
+ msgstr "Vous essayez de conserver les mêmes paramètres pour %s."
1136
 
1137
  #: ../classes/storage_model.php:247
1138
  #, php-format
1139
  msgid "Settings for %s updated succesfully."
1140
+ msgstr "Les paramètres pour %s correctement mis à jour."
1141
 
1142
  #: ../classes/storage_model/comment.php:13
1143
  msgid "Comments"
1177
 
1178
  #: ../classes/upgrade.php:298
1179
  msgid "Migrating Column Settings"
1180
+ msgstr "Migration des paramètres de colonne"
1181
 
1182
  #: ../classes/upgrade.php:334
1183
  msgid "No Upgrade Required"
1203
  msgid ""
1204
  "Sorry. Something went wrong during the upgrade process. Please report this "
1205
  "on the support forum."
1206
+ msgstr "Désoler. Quelque chose ne c'est pas bien déroulé durant la mise à jour. Veuillez reporter cela au support du forum."
1207
 
1208
  #: ../codepress-admin-columns.php:439
1209
  msgid "Edit columns"
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: 3.9.1
7
- Stable tag: 2.2.4
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
 
@@ -248,6 +248,11 @@ You can find a list of the available actions and filters (and examples on how to
248
 
249
  == Changelog ==
250
 
 
 
 
 
 
251
  = 2.2.4 =
252
  * [Added] New filter `cpac/storage_model/columns_default` for filtering the columns that should be loaded if there are no stored columns
253
  * [Added] Option (column property `hidden`) to hide column types from the dropdown list of column types
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: 3.9.1
7
+ Stable tag: 2.2.5
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
 
248
 
249
  == Changelog ==
250
 
251
+ = 2.2.5 =
252
+ * [Fixed] Error with actions icons.
253
+ * [Added] New Column! Used-by-menu column; will display in which menu a post/page/taxonomy is being used. With support for column sorting in posts.
254
+ * [Fixed] Only ajax calls from cpac will trigger the loading of storage_models now.
255
+
256
  = 2.2.4 =
257
  * [Added] New filter `cpac/storage_model/columns_default` for filtering the columns that should be loaded if there are no stored columns
258
  * [Added] Option (column property `hidden`) to hide column types from the dropdown list of column types