Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Menu link with section link, PFWMA-221 #86

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ public function angelleye_display_multi_account_list() {
<td scope="row" class="titledesc">
<input name="is_edit" class="button-primary woocommerce-save-button" type="hidden" value="%1$s" />
<input id="microprocessing_save" name="microprocessing_save" class="button-primary" type="submit" value="%2$s" />
<a href="?page=wc-settings&tab=multi_account_management" class="button-primary button">%3$s</a>
<a href="?page=wc-settings&tab=multi_account_management&section=list" class="button-primary button">%3$s</a>
%4$s
</td>
</tr>', $_GET['ID'], __('Save Changes', 'paypal-for-woocommerce-multi-account-management'), __('Cancel', 'paypal-for-woocommerce-multi-account-management'), wp_nonce_field('microprocessing_save'));
Expand Down Expand Up @@ -722,7 +722,7 @@ public function angelleye_multi_account_settings_fields() {
<td class="forminp">
<fieldset>
<input name="global_commission_microprocessing_save" class="button-primary" type="submit" value="<?php esc_attr_e('Save Changes', 'paypal-for-woocommerce-multi-account-management'); ?>" />
<a href="?page=wc-settings&tab=multi_account_management" class="button-primary button"><?php esc_attr_e('Cancel', 'paypal-for-woocommerce-multi-account-management'); ?></a>
<a href="?page=wc-settings&tab=multi_account_management&section=list" class="button-primary button"><?php esc_attr_e('Cancel', 'paypal-for-woocommerce-multi-account-management'); ?></a>
<?php wp_nonce_field('microprocessing_save'); ?>
</fieldset>
</td>
Expand Down Expand Up @@ -797,7 +797,7 @@ public function angelleye_multi_account_ui() {
<tr valign="top">
<td scope="row" class="titledesc">
<input id="microprocessing_save" name="microprocessing_save" class="button-primary" type="submit" value="<?php esc_attr_e('Save Changes', 'paypal-for-woocommerce-multi-account-management'); ?>" />
<a href="?page=wc-settings&tab=multi_account_management" class="button-primary button"><?php esc_attr_e('Cancel', 'paypal-for-woocommerce-multi-account-management'); ?></a>
<a href="?page=wc-settings&tab=multi_account_management&section=list" class="button-primary button"><?php esc_attr_e('Cancel', 'paypal-for-woocommerce-multi-account-management'); ?></a>
<?php wp_nonce_field('microprocessing_save'); ?>
</td>
</tr>
Expand Down Expand Up @@ -1264,7 +1264,7 @@ public function angelleye_paypal_for_woocommerce_general_settings_tab() {
$gateway = 'paypal_for_wooCommerce_for_multi_account_management';
}
?>
<a href="?page=wc-settings&tab=multi_account_management" class="nav-tab <?php echo $gateway == 'paypal_for_wooCommerce_for_multi_account_management' ? 'nav-tab-active' : ''; ?>"><?php echo __('Multi-Account Management', 'paypal-for-woocommerce-multi-account-management'); ?></a> <?php
<a href="?page=wc-settings&tab=multi_account_management&section=list" class="nav-tab <?php echo $gateway == 'paypal_for_wooCommerce_for_multi_account_management' ? 'nav-tab-active' : ''; ?>"><?php echo __('Multi-Account Management', 'paypal-for-woocommerce-multi-account-management'); ?></a> <?php
}

public function display_admin_notice() {
Expand Down Expand Up @@ -2310,15 +2310,15 @@ public function angelleye_multi_account_enable_active_vendor_account() {
public function angelleye_pfwma_disable_all_vendor_rules() {
$update_count = $this->angelleye_multi_account_disable_active_vendor_account();
$message = __('Action completed; ', 'paypal-for-woocommerce-multi-account-management') . sprintf(_n('%s record ', '%s records ', $update_count, 'paypal-for-woocommerce-multi-account-management'), $update_count) . __('processed.', 'paypal-for-woocommerce-multi-account-management');
$redirect_url = admin_url('admin.php?page=wc-settings&tab=multi_account_management&section&message=' . $message);
$redirect_url = admin_url('admin.php?page=wc-settings&tab=multi_account_management&section=list&message=' . $message);
echo $redirect_url;
exit();
}

public function angelleye_pfwma_enable_all_vendor_rules() {
$update_count = $this->angelleye_multi_account_enable_active_vendor_account();
$message = __('Action completed; ', 'paypal-for-woocommerce-multi-account-management') . sprintf(_n('%s record ', '%s records ', $update_count, 'paypal-for-woocommerce-multi-account-management'), $update_count) . __('processed.', 'paypal-for-woocommerce-multi-account-management');
$redirect_url = admin_url('admin.php?page=wc-settings&tab=multi_account_management&section&message=' . $message);
$redirect_url = admin_url('admin.php?page=wc-settings&tab=multi_account_management&section=list&message=' . $message);
echo $redirect_url;
exit();
}
Expand Down Expand Up @@ -2627,7 +2627,7 @@ public function angelleye_pfwma_create_all_vendor_rules() {
}
if (is_ajax()) {
$message = __('Action completed; ', 'paypal-for-woocommerce-multi-account-management') . sprintf(_n('%s record ', '%s records ', $vendor_result->total_users, 'paypal-for-woocommerce-multi-account-management'), $vendor_result->total_users) . __('processed.', 'paypal-for-woocommerce-multi-account-management');
$redirect_url = admin_url('admin.php?page=wc-settings&tab=multi_account_management&section&message=' . $message);
$redirect_url = admin_url('admin.php?page=wc-settings&tab=multi_account_management&section=list&message=' . $message);
echo $redirect_url;
exit();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function get_version() {
*/
public function paypal_for_woocommerce_multi_account_management_action_links($actions, $plugin_file, $plugin_data, $context) {
$custom_actions = array(
'configure' => sprintf('<a href="%s">%s</a>', admin_url('admin.php?page=wc-settings&tab=multi_account_management'), __('Configure', 'paypal-for-woocommerce-multi-account-management')),
'configure' => sprintf('<a href="%s">%s</a>', admin_url('admin.php?page=wc-settings&tab=multi_account_management&section=list'), __('Configure', 'paypal-for-woocommerce-multi-account-management')),
'docs' => sprintf('<a href="%s" target="_blank">%s</a>', 'https://www.angelleye.com/category/docs/paypal-for-woocommerce-multi-account-management-documentation/?utm_source=paypal-for-woocommerce-multi-account&utm_medium=docs_link&utm_campaign=plugin', __('Docs', 'paypal-for-woocommerce-multi-account-management')),
'support' => sprintf('<a href="%s" target="_blank">%s</a>', 'https://www.angelleye.com/support/?utm_source=paypal-for-woocommerce-multi-account&utm_medium=support_link&utm_campaign=plugin', __('Support', 'paypal-for-woocommerce-multi-account-management')),
'review' => sprintf('<a href="%s" target="_blank">%s</a>', 'https://www.angelleye.com/product/paypal-for-woocommerce-multi-account-management?utm_source=paypal-for-woocommerce-multi-account&utm_medium=review_link&utm_campaign=plugin', __('Write a Review', 'paypal-for-woocommerce-multi-account-management')),
Expand All @@ -287,7 +287,7 @@ public function display_plugin_admin_page() {
$this->display_plugin_admin_page_submenu();
echo '<style> .button-primary.woocommerce-save-button { display: none; } </style>';
$this->plugin_admin->display_admin_notice();
if (empty($_GET['section'])) {
if (!empty($_GET['section']) && $_GET['section'] === 'list') {
$this->plugin_admin->angelleye_multi_account_list();
} elseif (!empty($_GET['section']) && $_GET['section'] === 'add_edit_account') {
$this->plugin_admin->angelleye_paypal_for_woocommerce_general_settings_tab_content();
Expand All @@ -303,7 +303,7 @@ public function display_plugin_admin_page_submenu() {
</form>
<div class="wrap">
<ul class="subsubsub">
<li><a href="<?php echo esc_url(admin_url('admin.php?page=wc-settings&tab=multi_account_management&section=')); ?>" class="<?php
<li><a href="<?php echo esc_url(admin_url('admin.php?page=wc-settings&tab=multi_account_management&section=list')); ?>" class="<?php
if (empty($_GET['section'])) {
echo 'current';
}
Expand All @@ -330,7 +330,7 @@ public function display_plugin_admin_page_submenu() {
}

public function angelleye_woocommerce_settings_tabs_array($settings_tabs) {
$settings_tabs['multi_account_management'] = __('PayPal Multi-Account Setup', 'paypal-for-woocommerce-multi-account-management');
$settings_tabs['multi_account_management&section=list'] = __('PayPal Multi-Account Setup', 'paypal-for-woocommerce-multi-account-management');
return $settings_tabs;
}

Expand Down