function _wpsc_action_load_settings_for_update() { if (isset($_REQUEST['tab'])) { require_once WPSC_FILE_PATH . '/wpsc-admin/settings-page.php'; WPSC_Settings_Page::get_instance(); } }
/** * Includes and enqueues scripts and styles for the WPEC options page * * @uses wp_enqueue_script() Includes and prints out the JS for the WPEC options page * @uses wp_localize_script() Sets up the JS vars needed * @uses _wpsc_create_ajax_nonce() Alias for wp_create_nonce, creates a random one time use token * @uses get_current_tab_id() Returns the current tab id * @uses wp_enqueue_style() Includes and prints out the CSS for the WPEC options page */ function wpsc_admin_include_optionspage_css_and_js() { _wpsc_enqueue_wp_e_commerce_admin(); $version_identifier = WPSC_VERSION . "." . WPSC_MINOR_VERSION; wp_enqueue_script('wp-e-commerce-admin-settings-page', WPSC_URL . '/wpsc-admin/js/settings-page.js', array('jquery-query'), $version_identifier); wp_localize_script('wp-e-commerce-admin-settings-page', 'WPSC_Settings_Page', array('navigate_settings_tab_nonce' => _wpsc_create_ajax_nonce('navigate_settings_tab'), 'payment_gateway_settings_form_nonce' => _wpsc_create_ajax_nonce('payment_gateway_settings_form'), 'shipping_module_settings_form_nonce' => _wpsc_create_ajax_nonce('shipping_module_settings_form'), 'display_region_list_nonce' => _wpsc_create_ajax_nonce('display_region_list'), 'update_checkout_fields_order_nonce' => _wpsc_create_ajax_nonce('update_checkout_fields_order'), 'add_tax_rate_nonce' => _wpsc_create_ajax_nonce('add_tax_rate'), 'current_tab' => WPSC_Settings_Page::get_instance()->get_current_tab_id(), 'before_unload_dialog' => __('The changes you made will be lost if you navigate away from this page.', 'wpsc'), 'ajax_navigate_confirm_dialog' => __('The changes you made will be lost if you navigate away from this page.', 'wpsc') . "\n\n" . __('Click OK to discard your changes, or Cancel to remain on this page.'), 'edit_field_options' => __('Edit Options', 'wpsc'), 'hide_edit_field_options' => __('Hide Options', 'wpsc'), 'delete_form_set_confirm' => __('Are you sure you want to delete %s? Submitted data of this form set will also be removed from sales logs.', 'wpsc'))); wp_enqueue_style('wp-e-commerce-admin_2.7', WPSC_URL . '/wpsc-admin/css/settingspage.css', false, false, 'all'); wp_enqueue_style('wp-e-commerce-ui-tabs', WPSC_URL . '/wpsc-admin/css/jquery.ui.tabs.css', false, $version_identifier, 'all'); }
/** * Display settings tab via AJAX * * @since 3.8.9 * @access private * * @uses WPSC_Settings_Page * @uses WPSC_Settings_Page::display_current_tab() Shows current tab of settings page * * @return array $return Response args */ function _wpsc_ajax_navigate_settings_tab() { require_once 'settings-page.php'; $return = array(); ob_start(); $settings_page = new WPSC_Settings_Page($_POST['tab']); $settings_page->display_current_tab(); $return['content'] = ob_get_clean(); return $return; }
/** * Get active object instance * * @since 3.8.8 * * @access public * @static * @return object */ public static function get_instance() { if (!self::$instance) { self::$instance = new WPSC_Settings_Page(); } return self::$instance; }
/** * wpsc_admin_include_optionspage_css_and_js function, includes the wpsc_admin CSS and JS for the specific options page * No parameters, returns nothing */ function wpsc_admin_include_optionspage_css_and_js() { $version_identifier = WPSC_VERSION . "." . WPSC_MINOR_VERSION; wp_enqueue_script('wp-e-commerce-js-ajax', WPSC_URL . '/wpsc-core/js/ajax.js', false, $version_identifier); wp_enqueue_script('wp-e-commerce-js-dimensions', WPSC_URL . '/wpsc-admin/js/dimensions.js', false, $version_identifier); wp_enqueue_script('wp-e-commerce-admin-settings-page', WPSC_URL . '/wpsc-admin/js/settings-page.js', array('jquery-query'), $version_identifier); wp_localize_script('wp-e-commerce-admin-settings-page', 'WPSC_Settings_Page', array('nonce' => wp_create_nonce('wpsc_settings_page_nonce'), 'current_tab' => WPSC_Settings_Page::get_instance()->get_current_tab_id(), 'before_unload_dialog' => __('The changes you made will be lost if you navigate away from this page.', 'wpsc'), 'ajax_navigate_confirm_dialog' => __('The changes you made will be lost if you navigate away from this page.', 'wpsc') . "\n\n" . __('Click OK to discard your changes, or Cancel to remain on this page.'), 'checkout_field_sort_error_dialog' => __("An error occurred when saving your field order preference.\n\nPlease refresh the page and try again.", 'wpsc'), 'edit_field_options' => __('Edit Options', 'wpsc'), 'hide_edit_field_options' => __('Hide Options', 'wpsc'))); wp_enqueue_style('wp-e-commerce-admin_2.7', WPSC_URL . '/wpsc-admin/css/settingspage.css', false, false, 'all'); wp_enqueue_style('wp-e-commerce-ui-tabs', WPSC_URL . '/wpsc-admin/css/jquery.ui.tabs.css', false, $version_identifier, 'all'); }
function wpsc_navigate_settings_tab() { if (!wp_verify_nonce($_POST['nonce'], 'wpsc_settings_page_nonce')) { die('Session expired. Try refreshing your settings page.'); } require_once 'settings-page.php'; $settings_page = new WPSC_Settings_Page($_POST['tab']); $settings_page->display_current_tab(); exit; }
function wpsc_the_settings_tabs() { WPSC_Settings_Page::get_instance()->output_tabs(); }