Skip to content

Commit

Permalink
changed file names
Browse files Browse the repository at this point in the history
  • Loading branch information
madalinungureanu committed Jan 5, 2012
1 parent bf80da5 commit 60c5a4d
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 213 deletions.
6 changes: 3 additions & 3 deletions readme.txt
Expand Up @@ -21,7 +21,7 @@ Usage Example 1
'meta_array' => $fint
);

new Custom_Fields_Creator( $args );
new Wordpress_Creation_Kit( $args );

?>

Expand Down Expand Up @@ -92,7 +92,7 @@ wpml_compatibility
How to add into a plugin:

1. Copy the foldder "custom-fields-creator" into the plugin dir
2. Change the class name "Custom_Fields_Creator" if multiple plugins use custom-fields-creator on the same site.
2. Change the class name "Wordpress_Creation_Kit" if multiple plugins use custom-fields-creator on the same site.
3. Include "custom-fields-creator.php" into the plugin file

/* include Custom Fields Creator API */
Expand All @@ -105,4 +105,4 @@ WPML Compatibility

When wpml_compatibility is true on a meta box, besides saving the contents of the box in one serialized custom field, we create automatically a custom field for every field in every entry. We do this because WPML can't handle serialized custom fields and also we will get good control on what actions we want to perform (don't translate, copy, translate ) on each of the fields.

After the fields are translated with Icanlcalize and we have the translated post in our system, we can go on the translated post and press the "Syncronize CFC Translation" button which will create the serialized array from the individual custom fields.
After the fields are translated with Icanlcalize and we have the translated post in our system, we can go on the translated post and press the "Syncronize WCK Translation" button which will create the serialized array from the individual custom fields.
File renamed without changes.
24 changes: 12 additions & 12 deletions custom-fields-creator.js → wordpress-creation-kit.js
Expand Up @@ -30,10 +30,10 @@ function addMeta(value, id, nonce){
values[key.toString()] = jQuery(this).val().toString();
});

jQuery.post( ajaxurl , { action:"cfc_add_meta"+value, meta:value, id:id, values:values, _ajax_nonce:nonce}, function(response) {
jQuery.post( ajaxurl , { action:"wck_add_meta"+value, meta:value, id:id, values:values, _ajax_nonce:nonce}, function(response) {
//alert(response);
/* refresh the list */
jQuery.post( ajaxurl , { action:"cfc_refresh_list"+value, meta:value, id:id}, function(response) {
jQuery.post( ajaxurl , { action:"wck_refresh_list"+value, meta:value, id:id}, function(response) {

jQuery('#container_'+value).replaceWith(response);

Expand Down Expand Up @@ -67,18 +67,18 @@ function removeMeta(value, id, element_id, nonce){
if( response == true ){

jQuery('#'+value).parent().css({'opacity':'0.4', 'position':'relative'}).append('<div id="mb-ajax-loading"></div>');
jQuery.post( ajaxurl , { action:"cfc_remove_meta"+value, meta:value, id:id, element_id:element_id, _ajax_nonce:nonce}, function(response) {
jQuery.post( ajaxurl , { action:"wck_remove_meta"+value, meta:value, id:id, element_id:element_id, _ajax_nonce:nonce}, function(response) {

/* If single add the form */
if( jQuery( '#container_'+value ).hasClass('single') ){
jQuery.post( ajaxurl , { action:"cfc_add_form"+value, meta:value, id:id }, function(response) {
jQuery.post( ajaxurl , { action:"wck_add_form"+value, meta:value, id:id }, function(response) {
jQuery( '#container_'+value ).before( response );
jQuery( '#'+value ).addClass('single');
});
}

/* refresh the list */
jQuery.post( ajaxurl , { action:"cfc_refresh_list"+value, meta:value, id:id}, function(response) {
jQuery.post( ajaxurl , { action:"wck_refresh_list"+value, meta:value, id:id}, function(response) {
jQuery('#container_'+value).replaceWith(response);

jQuery('.mb-table-container tbody td').css('width', function(){ return jQuery(this).width() });
Expand Down Expand Up @@ -123,8 +123,8 @@ function mb_sortable_elements() {

jQuery('#'+value).parent().css({'opacity':'0.4', 'position':'relative'}).append('<div id="mb-ajax-loading"></div>');

jQuery.post( ajaxurl , { action:"cfc_reorder_meta"+value, meta:value, id:id, values:values}, function(response) {
jQuery.post( ajaxurl , { action:"cfc_refresh_list"+value, meta:value, id:id}, function(response) {
jQuery.post( ajaxurl , { action:"wck_reorder_meta"+value, meta:value, id:id, values:values}, function(response) {
jQuery.post( ajaxurl , { action:"wck_refresh_list"+value, meta:value, id:id}, function(response) {
jQuery('#container_'+value).replaceWith(response);

jQuery('.mb-table-container tbody td').css('width', function(){ return jQuery(this).width() });
Expand All @@ -149,7 +149,7 @@ function showUpdateFormMeta(value, id, element_id, nonce){

jQuery( '#container_' + value + " tbody" ).sortable("disable");

jQuery.post( ajaxurl , { action:"cfc_show_update"+value, meta:value, id:id, element_id:element_id, _ajax_nonce:nonce}, function(response) {
jQuery.post( ajaxurl , { action:"wck_show_update"+value, meta:value, id:id, element_id:element_id, _ajax_nonce:nonce}, function(response) {
//jQuery('#container_'+value+' #element_'+element_id).append(response);
jQuery(response).insertAfter('#container_'+value+' #element_'+element_id);
jQuery('#'+value).parent().css('opacity','1');
Expand Down Expand Up @@ -182,10 +182,10 @@ function updateMeta(value, id, element_id, nonce){

});

jQuery.post( ajaxurl , { action:"cfc_update_meta"+value, meta:value, id:id, element_id:element_id, values:values, _ajax_nonce:nonce}, function(response) {
jQuery.post( ajaxurl , { action:"wck_update_meta"+value, meta:value, id:id, element_id:element_id, values:values, _ajax_nonce:nonce}, function(response) {
jQuery('#update_container_'+value+'_'+element_id).remove();
/* refresh the list */
jQuery.post( ajaxurl , { action:"cfc_refresh_list"+value, meta:value, id:id}, function(response) {
jQuery.post( ajaxurl , { action:"wck_refresh_list"+value, meta:value, id:id}, function(response) {
jQuery('#container_'+value).replaceWith(response);

jQuery('.mb-table-container tbody td').css('width', function(){ return jQuery(this).width() });
Expand All @@ -199,8 +199,8 @@ function updateMeta(value, id, element_id, nonce){
}

/* function syncs the translation */
function cfcSyncTranslation(id){
jQuery.post( ajaxurl , { action:"cfc_sync_translation", id:id}, function(response) {
function wckSyncTranslation(id){
jQuery.post( ajaxurl , { action:"wck_sync_translation", id:id}, function(response) {
if( response == 'syncsuccess' )
window.location.reload();
});
Expand Down

0 comments on commit 60c5a4d

Please sign in to comment.