PluginProbe
Social Share for WooCommerce / trunk
Social Share for WooCommerce vtrunk
1.2.23 trunk 1.0 1.0.1 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.6.1 1.1.6.2 1.1.7 1.2.0 1.2.1 1.2.1.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.15.1 1.2.16 All 41 releases
product-share / includes / layout.php

layout.php in Social Share for WooCommerce trunk, at includes/layout.php

164 lines 6.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
3 <div class="wrap">
4
5 <h1>
6 <?php echo esc_attr__('Social Share for WooCommerce Settings', 'product-share') ?>
7 <?php echo wp_kses_post( apply_filters( 'psfw_version_title', sprintf( '<small class="wpx-version-title">%s</small>', product_share()->version() ) ) ); ?>
8
9 </h1>
10 <?php settings_errors(); ?>
11
12 <?php
13
14 $psfw_layout_page_nonce = wp_create_nonce( 'psfw-layout-nonce' );
15
16 // Checking Nonce [Generated by layout.php] on page load
17 if( wp_verify_nonce( $psfw_layout_page_nonce, 'psfw-layout-nonce' ) ){
18
19 //Get the active plugin page from the $_GET param
20 $psfw_plugin_name = isset($_GET['page']) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
21
22 //Get the active tab from the $_GET param
23 $psfw_default_tab = null;
24 $psfw_curTab = isset($_GET['tab']) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : $psfw_default_tab;
25 }
26
27 do_action('psfw_layout_start');
28 ?>
29
30 <!-- Here are our tabs -->
31 <nav class="nav-tab-wrapper psfw-nav-wrapper">
32 <?php
33 $tab = "<a href='?page=product-share' class='nav-tab ".($psfw_curTab===null ? 'nav-tab-active' : null)."'> ".__('General', 'product-share')."</a>";
34 $tab .= "<a href='?page=product-share&tab=advanced' class='nav-tab ".($psfw_curTab==='advanced' ? 'nav-tab-active' : null)."'> ".WPXtension_Setting_Fields::pro_not_exist(Product_Share::check_plugin_state('product-share-pro')).__(' Advanced', 'product-share')."</a>";
35 ?>
36
37 <?php echo wp_kses_post( apply_filters('psfw_admin_setting_tab', $tab, $psfw_curTab) ); ?>
38 </nav>
39
40 <div id="poststuff">
41
42 <div id="post-body" class="metabox-holder columns-2">
43
44 <!-- main content -->
45 <div id="post-body-content">
46
47 <form method="post" action="options.php">
48 <?php //settings_fields( 'product-share-group' ); ?>
49 <?php //do_settings_sections( 'product-share-group' ); ?>
50
51 <div class="tab-content">
52
53 <?php
54
55 // print_r( array_merge( (array) get_option('product_share_option'), (array) get_option('product_share_option_advanced') ) );
56
57 do_action('psfw_setting_tab_content', $psfw_plugin_name, $psfw_curTab);
58
59 ?>
60
61 </div>
62
63 <p class="submit submitbox psfw-setting-btn">
64
65 <?php
66
67 // submit_button( __( 'Save Settings', 'product-share' ), 'primary', 'psfw-save-settings', false);
68
69 // Making Nonce URL for Reset Link
70
71 $psfw_current_page = 'product-share';
72 $psfw_current_tab = $psfw_curTab;
73
74 $psfw_reset_url_args = array(
75 'action' => 'reset',
76 '_wpnonce' => wp_create_nonce( 'psfw-settings' ),
77 );
78
79 $psfw_action_url_args = array(
80 'page' => $psfw_current_page,
81 'tab' => $psfw_current_tab,
82 );
83
84 $psfw_reset_url = add_query_arg( wp_parse_args( $psfw_reset_url_args, $psfw_action_url_args ), admin_url( 'admin.php' ) );
85
86 /**
87 *
88 * Condition if companion installed and activated display the submit/reset button for all tab
89 * if companion is not activated then display submit/reset button only for General tab
90 *
91 * @since 1.2.12
92 *
93 * @return $psfw_curTab returns null for General tab
94 *
95 */
96
97 if( Product_Share::check_plugin_state('product-share-pro') ){
98 submit_button( __( 'Save Settings', 'product-share' ), 'primary', 'psfw-save-settings', false);
99 ?>
100 <a onclick="return confirm('<?php esc_html_e( 'Are you sure to reset?', 'product-share' ) ?>')" class="submitdelete" href="<?php echo esc_url( $psfw_reset_url ) ?>"><?php esc_attr_e( 'Reset Current Tab', 'product-share' ); ?></a>
101 <?php
102 }
103 if( !Product_Share::check_plugin_state('product-share-pro') && null === $psfw_curTab ){
104 submit_button( __( 'Save Settings', 'product-share' ), 'primary', 'psfw-save-settings', false);
105 ?>
106 <a onclick="return confirm('<?php esc_html_e( 'Are you sure to reset?', 'product-share' ) ?>')" class="submitdelete" href="<?php echo esc_url( $psfw_reset_url ) ?>"><?php esc_attr_e( 'Reset Current Tab', 'product-share' ); ?></a>
107 <?php
108 }
109
110 ?>
111
112 </p>
113
114
115 </form>
116
117 </div>
118 <!-- post-body-content -->
119
120 <!-- sidebar -->
121 <?php
122
123 WPXtension_Sidebar::sidebar_start();
124
125 do_action( 'psfw_settings_sidebar_start' );
126
127 // Documentation Block
128 WPXtension_Sidebar::block(
129 'dashicons dashicons-text-page',
130 'Documentation',
131 'To know more about settings, Please check our <a href="https://wpxtension.com/doc-category/social-share-for-woocommerce/" target="_blank">documentation</a>'
132 );
133
134 // Help & Support Block
135 WPXtension_Sidebar::block(
136 'dashicons dashicons-editor-help',
137 'Help & Support',
138 'Still facing issues with Social Share for WooCommerce? Please <a href="https://wpxtension.com/submit-a-ticket/" target="_blank">open a ticket.</a>'
139 );
140
141 // Rating Block
142 WPXtension_Sidebar::block(
143 'dashicons dashicons-star-filled',
144 'Love Our Plugin?',
145 'We feel honored when you use our plugin on your site. If you have found our plugin useful and makes you smile, please consider giving us a <a href="https://wordpress.org/support/plugin/product-share/reviews/" target="_blank">5-star rating on WordPress.org</a>. It will inspire us a lot.'
146 );
147
148 // Shortcode Block
149 WPXtension_Sidebar::block(
150 'dashicons dashicons-shortcode',
151 'Shortcode',
152 '<p>Not working with your page builder? or, want to display it in a different position on the Single Product page? Use this shortcode-</p> <code>[psfw_basic_share]</code>'
153 );
154
155 do_action( 'psfw_settings_sidebar_end' );
156
157 WPXtension_Sidebar::sidebar_end();
158
159 ?>
160 <!-- #sidebar -->
161
162 </div>
163 </div>
164