Skip to content

Commit

Permalink
Show more setting options add-to-any to users admin xtecbloc. Replace…
Browse files Browse the repository at this point in the history
… languages files. Fix show tabs for superadmins. Preselected options to all users except superadmin
  • Loading branch information
xaviernietosanchez committed Oct 18, 2016
1 parent 59534b2 commit 56f6755
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 139 deletions.
104 changes: 88 additions & 16 deletions addtoany.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,17 @@ function A2A_SHARE_SAVE_options_page() {
}

$options = get_option( 'addtoany_options' );
// XTEC ************ AFEGIT - Define default values

// XTEC ************ AFEGIT - Define default values. The xtecblock users default other options
// 2016.03.16 @sarjona
if (!isset($options['display_in_posts_on_front_page'])) {
// 2016.06.02 @xavinieto
if( is_xtec_super_admin() ){
if (!isset($options['display_in_posts_on_front_page'])) {
$options['display_in_posts_on_front_page'] = -1;
}
if (!isset($options['display_in_posts_on_archive_pages'])) {
$options['display_in_posts_on_archive_pages'] = -1;
}
if (!isset($options['display_in_posts_on_archive_pages'])) {
$options['display_in_posts_on_archive_pages'] = -1;
}
}
if (!isset($options['display_in_feed'])) {
$options['display_in_feed'] = -1;
Expand Down Expand Up @@ -441,12 +445,24 @@ function position_in_content( $options, $option_box = false ) {
<!--
// XTEC ************ MODIFICAT - Added language translation
// 2015.09.22 @nacho
// 2016.02.03 @xavinieto

<?php if ( is_xtec_super_admin() ) { ?>

<a href="<?php echo admin_url( 'options-general.php?page=add-to-any.php' ); ?>" class="nav-tab<?php if ( 'default' == $current_screen ) echo ' nav-tab-active'; ?>"><?php esc_attr_e( _e('Standard:', 'add-to-any' ) );?></a>
//************ ORIGINAL
//************ ORIGINAL-->
<a href="<?php echo admin_url( 'options-general.php?page=addtoany' ); ?>" class="nav-tab<?php if ( 'default' == $current_screen ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Standard' ); ?></a>
<!--
//************ FI
-->
<!--
// XTEC ************ AFEGIT - Hide Floating Tab
// 2015.09.22 @xavinieto
-->
<?php } ?>
<!--
//************ FI
-->


<!--
// XTEC ************ AFEGIT - Hide Floating Tab
Expand Down Expand Up @@ -619,12 +635,12 @@ function position_in_content( $options, $option_box = false ) {

<!--
// XTEC ************ AFEGIT - Only show options for xtecadmin
// 2015.09.22 @nacho
// 2016.06.02 @xavinieto
-->
<?php if ( is_xtec_super_admin() ) {?>
<?php if ( is_xtec_super_admin() ) {?>
<!--
//************ FI
-->
-->
<tr valign="top">
<th scope="row"><?php _e('Sharing Header', 'add-to-any'); ?></th>
<td><fieldset id="addtoany_extra_section_sharing_header" class="addtoany_extra_section" role="region">
Expand All @@ -640,7 +656,16 @@ function position_in_content( $options, $option_box = false ) {
</label>
</fieldset></td>
</tr>


<!--
// XTEC ************ AFEGIT - Only show options for xtecadmin
// 2016.06.02 @xavinieto
-->
<?php } ?>
<!--
//************ FI
-->

<tr valign="top">
<th scope="row"><?php _e('Placement', 'add-to-any'); ?></th>
<td><fieldset>
Expand All @@ -665,6 +690,15 @@ function position_in_content( $options, $option_box = false ) {
?> value="1"/>
<?php printf(__('Display at the %s of posts on archive pages', 'add-to-any'), position_in_content( $options )); ?>
</label>

<!--
// XTEC ************ AFEGIT - Only show options for xtecadmin
// 2016.06.02 @xavinieto
-->
<?php if ( is_xtec_super_admin() ) {?>
<!--
//************ FI
-->
<br/>
<label>
&nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_feed" type="checkbox"<?php
Expand All @@ -680,6 +714,14 @@ function position_in_content( $options, $option_box = false ) {
?> value="1"/>
<?php printf(__('Display at the %s of excerpts', 'add-to-any'), position_in_content( $options, false )); ?>
</label>
<!--
// XTEC ************ AFEGIT - Only show options for xtecadmin
// 2016.06.02 @xavinieto
-->
<?php } ?>
<!--
//************ FI
-->
<br/>
<label>
<input name="A2A_SHARE_SAVE_display_in_pages" type="checkbox"<?php if ( ! isset( $options['display_in_pages'] ) || $options['display_in_pages'] != '-1' ) echo ' checked="checked"'; ?> value="1"/>
Expand All @@ -692,6 +734,15 @@ function position_in_content( $options, $option_box = false ) {
?> value="1"/>
<?php printf(__('Display at the %s of media pages', 'add-to-any'), position_in_content( $options, false )); ?>
</label>

<!--
// XTEC ************ AFEGIT - Only show options for xtecadmin
// 2016.06.02 @xavinieto
-->
<?php if ( is_xtec_super_admin() ) {?>
<!--
//************ FI
-->

<?php
$custom_post_types = array_values( get_post_types( array( 'public' => true, '_builtin' => false ), 'objects' ) );
Expand Down Expand Up @@ -722,9 +773,28 @@ function position_in_content( $options, $option_box = false ) {
<div class="setting-description">
<?php _e("See <a href=\"widgets.php\" title=\"Theme Widgets\">Widgets</a> and <a href=\"options-general.php?page=addtoany&action=floating\" title=\"AddToAny Floating Share Buttons\">Floating</a> for additional placement options. For advanced placement, see <a href=\"http://wordpress.org/plugins/add-to-any/faq/\">the FAQs</a>.", 'add-to-any'); ?>
</div>

<!--
// XTEC ************ AFEGIT - Only show options for xtecadmin
// 2016.06.02 @xavinieto
-->
<?php } ?>
<!--
//************ FI
-->

</fieldset></td>
</tr>

<!--
// XTEC ************ AFEGIT - Only show options for xtecadmin
// 2016.06.02 @xavinieto
-->
<?php if ( is_xtec_super_admin() ) {?>
<!--
//************ FI
-->

<tr valign="top">
<th scope="row"><?php _e('Menu Options', 'add-to-any'); ?></th>
<td><fieldset id="addtoany_extra_section_menu_options" class="addtoany_extra_section" role="region">
Expand Down Expand Up @@ -811,14 +881,16 @@ function position_in_content( $options, $option_box = false ) {
</p>
</fieldset></td>
</tr>
<!--
// XTEC ************ AFEGIT - End Only show options for xtecadmin
// 2015.09.22 @nacho
<!--
// XTEC ************ AFEGIT - Only show options for xtecadmin
// 2016.06.02 @xavinieto
-->
<?php }?>
<?php } else { ?>
<input name="A2A_SHARE_SAVE_inline_css" id="A2A_SHARE_SAVE_inline_css" type="hidden"<?php if ( ! isset( $options['inline_css'] ) || $options['inline_css'] != '-1' ) echo ' checked="checked"'; ?> value="1"/>
<?php } ?>
<!--
//************ FI
-->
-->
<?php endif; ?>

</table>
Expand Down
Binary file modified languages/add-to-any-ca.mo
Binary file not shown.
Loading

0 comments on commit 56f6755

Please sign in to comment.