Skip to content

Commit

Permalink
Merge pull request #112 from OpenDevelopmentMekong/master
Browse files Browse the repository at this point in the history
merging to prod to release v2.1.2
  • Loading branch information
Alex Corbi authored Dec 22, 2016
2 parents 15349ea + f59e0f7 commit 91b0a52
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 5 deletions.
45 changes: 41 additions & 4 deletions post-types/profile-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ public function profiles_page_settings_box($post = false)
$link_to_detail_column_localization = get_post_meta($post->ID, '_link_to_detail_column_localization', true);
?>
<div id="multiple-site">
<input type="radio" id="en" class="en" name="p_language_site" value="en" checked />
<input type="radio" id="en" class="en" name="language_site" value="en" checked />
<label for="en"><?php _e('ENGLISH', 'wp-odm_profile_pages');
?></label> &nbsp;
<?php if (odm_language_manager()->get_the_language_by_site() != "English"): ?>
<input type="radio" id="localization" class="localization" name="p_language_site" value="localization" />
<input type="radio" id="localization" class="localization" name="language_site" value="localization" />
<label for="localization"><?php _e(odm_language_manager()->get_the_language_by_site(), 'wp-odm_profile_pages');?></label>
<?php endif; ?>
</div>
Expand Down Expand Up @@ -359,6 +359,25 @@ public function profiles_page_settings_box($post = false)
</div>
<?php } ?>
</div>

<script type="text/javascript">
jQuery(document).ready(function($) {
var $container = $('#multiple-site');
var $languageSelection = $('input[type="radio"]');
var $forms = $('.language_settings');
var showForms = function() {
$forms.hide();
var selected = $('input[type="radio"][name=language_site]').filter(':checked').val();
$('.language-' + selected).show();
}
$languageSelection.on('change', function() {
$('.' + this.className).prop('checked', this.checked);
showForms();
});

showForms();
});
</script>
<?php
}
public function full_width_middle_content_box($post = false)
Expand All @@ -367,10 +386,10 @@ public function full_width_middle_content_box($post = false)
$full_width_middle_content_localization = get_post_meta($post->ID, '_full_width_middle_content_localization', true);
?>
<div id="multiple-site">
<input type="radio" id="middle_content_en" class="en" name="language_site1" value="en" checked />
<input type="radio" id="middle_content_en" class="en" name="language_site" value="en" checked />
<label for="middle_content_en"><?php _e('ENGLISH', 'wp-odm_profile_pages'); ?></label> &nbsp;
<?php if (odm_language_manager()->get_the_language_by_site() != "English"): ?>
<input type="radio" id="middle_content_localization" class="localization" name="language_site1" value="localization" />
<input type="radio" id="middle_content_localization" class="localization" name="language_site" value="localization" />
<label for="middle_content_localization"><?php _e(odm_language_manager()->get_the_language_by_site(), 'wp-odm_profile_pages'); ?></label>
<?php endif; ?>

Expand Down Expand Up @@ -412,6 +431,24 @@ public function full_width_middle_content_box($post = false)
}
?>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
var $container = $('#multiple-site');
var $languageSelection = $('input[type="radio"]');
var $forms = $('.language_settings');
var showForms = function() {
$forms.hide();
var selected = $('input[type="radio"][name=language_site]').filter(':checked').val();
$('.language-' + selected).show();
}
$languageSelection.on('change', function() {
$('.' + this.className).prop('checked', this.checked);
showForms();
});

showForms();
});
</script>
<?php
}

Expand Down
2 changes: 1 addition & 1 deletion wp-odm_profile_pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: ODM Profile Pages
* Plugin URI: http://github.com/OpenDevelopmentMekong/odm_profile_pages
* Description: Internal wordpress plugin for exposing custom content type for profile pages
* Version: 2.1.1
* Version: 2.1.2
* Author: Alex Corbi ([email protected])
* Author URI: http://www.lifeformapps.com
* License: GPLv3.
Expand Down

0 comments on commit 91b0a52

Please sign in to comment.