| 1 |
<?php |
| 2 |
/** |
| 3 |
* Administrative menu pages. |
| 4 |
* |
| 5 |
* Copyright: © 2009-2011 |
| 6 |
* {@link http://www.websharks-inc.com/ WebSharks, Inc.} |
| 7 |
* ( coded in the USA ) |
| 8 |
* |
| 9 |
* Released under the terms of the GNU General Public License. |
| 10 |
* You should have received a copy of the GNU General Public License, |
| 11 |
* along with this software. In the main directory, see: /licensing/ |
| 12 |
* If not, see: {@link http://www.gnu.org/licenses/}. |
| 13 |
* |
| 14 |
* @package s2Member\Menu_Pages |
| 15 |
* @since 3.5 |
| 16 |
*/ |
| 17 |
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"])) |
| 18 |
exit("Do not access this file directly."); |
| 19 |
/**/ |
| 20 |
if(!class_exists("c_ws_plugin__s2member_menu_pages")) |
| 21 |
{ |
| 22 |
/** |
| 23 |
* Administrative menu pages. |
| 24 |
* |
| 25 |
* @package s2Member\Menu_Pages |
| 26 |
* @since 3.5 |
| 27 |
*/ |
| 28 |
class c_ws_plugin__s2member_menu_pages |
| 29 |
{ |
| 30 |
/** |
| 31 |
* Pre-display errors. |
| 32 |
* |
| 33 |
* @package s2Member\Menu_Pages |
| 34 |
* @since 111209 |
| 35 |
* |
| 36 |
* @var array |
| 37 |
*/ |
| 38 |
public static $pre_display_errors = array(); |
| 39 |
/** |
| 40 |
* Saves all options from any menu page. |
| 41 |
* |
| 42 |
* Can also be self-verified; and configured extensively with function parameters. |
| 43 |
* |
| 44 |
* @package s2Member\Menu_Pages |
| 45 |
* @since 3.5 |
| 46 |
* |
| 47 |
* @param array $new_options Optional. Force feed an array of new options. Defaults to ``$_POST`` vars. |
| 48 |
* If ``$new_options`` are passed in, be SURE that you've already applied ``stripslashes_deep()``. |
| 49 |
* @param bool $verified Optional. Defaults to false. If true, ``wp_verify_nonce()`` is skipped in this routine. |
| 50 |
* @param bool $update_other Optional. Defaults to true. If false, other option-dependent routines will not be processed. |
| 51 |
* @param bool|array $display_notices Optional. Defaults to true. Can be false, or an array of certain notices that can be displayed. |
| 52 |
* @param bool|array $enqueue_notices Optional. Defaults to false. Can be true, or an array of certain notices that should be enqueued. |
| 53 |
* @param bool $request_refresh Optional. Defaults to false. If true, resulting `success` notice will include a link to refresh the menu page. |
| 54 |
* @return bool True if all s2Member options were updated successfully, else false. |
| 55 |
*/ |
| 56 |
public static function update_all_options($new_options = FALSE, $verified = FALSE, $update_other = TRUE, $display_notices = TRUE, $enqueue_notices = FALSE, $request_refresh = FALSE) |
| 57 |
{ |
| 58 |
$updated_all_options = false; /* Initialize this to a value of false. Initializing this variable here makes it an available reference-variable to Hooks/Filters. */ |
| 59 |
/**/ |
| 60 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); |
| 61 |
do_action("ws_plugin__s2member_before_update_all_options", get_defined_vars()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */ |
| 62 |
unset($__refs, $__v); /* Unset defined __refs, __v. */ |
| 63 |
/**/ |
| 64 |
if($verified || (!empty($_POST["ws_plugin__s2member_options_save"]) && ($nonce = $_POST["ws_plugin__s2member_options_save"]) && wp_verify_nonce($nonce, "ws-plugin--s2member-options-save"))) |
| 65 |
{ |
| 66 |
$options = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]; /* Acquire the full existing configuration options array here. */ |
| 67 |
/**/ |
| 68 |
$new_options = (is_array($new_options)) ? $new_options : ((!empty($_POST) && is_array($_POST)) ? stripslashes_deep($_POST) : array()); |
| 69 |
$new_options = c_ws_plugin__s2member_utils_strings::trim_deep($new_options); |
| 70 |
/**/ |
| 71 |
foreach($new_options as $key => $value) /* Find all keys contained within ``$new_options`` matching `^ws_plugin__s2member_`. */ |
| 72 |
if(strpos($key, "ws_plugin__s2member_") === 0) /* A relevant ``$new_options`` key matching `^ws_plugin__s2member_`? */ |
| 73 |
/**/ |
| 74 |
if($key === "ws_plugin__s2member_configured") /* s2Member is now configured ( according to these options )? */ |
| 75 |
($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["configured"] = $value).update_option("ws_plugin__s2member_configured", $value); |
| 76 |
/**/ |
| 77 |
else if(!is_array($value) || (is_array($value) && /* Updating an array? */ array_shift($value) === "update-signal")) |
| 78 |
$options[preg_replace("/^".preg_quote("ws_plugin__s2member_", "/")."/", "", $key)] = $value; |
| 79 |
/**/ |
| 80 |
unset($key, $value); /* Unset these utility variables now. This prevents bleeding vars into Hooks/Filters that are of no use. */ |
| 81 |
/**/ |
| 82 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); |
| 83 |
do_action("ws_plugin__s2member_during_update_all_options", get_defined_vars()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */ |
| 84 |
unset($__refs, $__v); /* Unset defined __refs, __v. */ |
| 85 |
/**/ |
| 86 |
$options = ws_plugin__s2member_configure_options_and_their_defaults(($options = array_merge($options, array("options_version" => (string)($options["options_version"] + 0.001))))); |
| 87 |
update_option("ws_plugin__s2member_options", $options).((is_multisite() && is_main_site()) ? update_site_option("ws_plugin__s2member_options", $options) : null).update_option("ws_plugin__s2member_cache", array()); |
| 88 |
/**/ |
| 89 |
if($update_other === true || in_array("auto_eot_system", (array)$update_other)) /* Handle the Auto-EOT System now ( enable/disable ). */ |
| 90 |
($options["auto_eot_system_enabled"] == 1) ? c_ws_plugin__s2member_auto_eots::add_auto_eot_system() : c_ws_plugin__s2member_auto_eots::delete_auto_eot_system(); |
| 91 |
/**/ |
| 92 |
if(($display_notices === true || in_array("success", (array)$display_notices)) && ($notice = '<strong>Options saved.'.(($request_refresh) ? ' Please <a href="'.esc_attr($_SERVER["REQUEST_URI"]).'">refresh</a>.' : '').'</strong>')) |
| 93 |
($enqueue_notices === true || in_array("success", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice($notice, "*:*") : c_ws_plugin__s2member_admin_notices::display_admin_notice($notice); |
| 94 |
/**/ |
| 95 |
if(empty($_GET["page"]) || $_GET["page"] !== "ws-plugin--s2member-mms-ops") /* Do NOT display page-conflict-warnings on the Main Multisite Configuration panel. */ |
| 96 |
{ |
| 97 |
if(!$options["membership_options_page"] && ($display_notices === true || in_array("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>NOTE:</strong> s2Member security restrictions will NOT be enforced until you\'ve configured a Membership Options Page. See: <code>s2Member -> General Options -> Membership Options Page</code>.')) |
| 98 |
($enqueue_notices === true || in_array("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice($notice, true); |
| 99 |
/**/ |
| 100 |
if($options["login_welcome_page"] && $options["login_welcome_page"] === $options["membership_options_page"] && ($display_notices === true || in_array("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Login Welcome Page is the same as your Membership Options Page. Please correct this. See: <code>s2Member -> General Options -> Login Welcome Page</code>.')) |
| 101 |
($enqueue_notices === true || in_array("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice($notice, true); |
| 102 |
/**/ |
| 103 |
if($options["membership_options_page"] && (string)get_option("page_on_front") === $options["membership_options_page"] && ($display_notices === true || in_array("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Membership Options Page is currently configured as your Home Page ( i.e. static page ) for WordPress®. This causes internal conflicts with s2Member. Your Membership Options Page MUST stand alone. Please correct this. See: <code>WordPress® -> Reading Options</code>. Or change: <code>s2Member -> General Options -> Membership Options Page</code>.')) |
| 104 |
($enqueue_notices === true || in_array("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice($notice, true); |
| 105 |
/**/ |
| 106 |
if($options["login_welcome_page"] && (string)get_option("page_on_front") === $options["login_welcome_page"] && ($display_notices === true || in_array("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Login Welcome Page is currently configured as your Home Page ( i.e. static page ) for WordPress®. This causes internal conflicts with s2Member. Your Login Welcome Page MUST stand alone. Please correct this. See: <code>WordPress® -> Reading Options</code>. Or change: <code>s2Member -> General Options -> Login Welcome Page</code>.')) |
| 107 |
($enqueue_notices === true || in_array("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice($notice, true); |
| 108 |
/**/ |
| 109 |
if($options["membership_options_page"] && (string)get_option("page_for_posts") === $options["membership_options_page"] && ($display_notices === true || in_array("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Membership Options Page is currently configured as your Posts Page ( i.e. static page ) for WordPress®. This causes internal conflicts with s2Member. Your Membership Options Page MUST stand alone. Please correct this. See: <code>WordPress® -> Reading Options</code>. Or change: <code>s2Member -> General Options -> Membership Options Page</code>.')) |
| 110 |
($enqueue_notices === true || in_array("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice($notice, true); |
| 111 |
/**/ |
| 112 |
if($options["login_welcome_page"] && (string)get_option("page_for_posts") === $options["login_welcome_page"] && ($display_notices === true || in_array("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Login Welcome Page is currently configured as your Posts Page ( i.e. static page ) for WordPress®. This causes internal conflicts with s2Member. Your Login Welcome Page MUST stand alone. Please correct this. See: <code>WordPress® -> Reading Options</code>. Or change: <code>s2Member -> General Options -> Login Welcome Page</code>.')) |
| 113 |
($enqueue_notices === true || in_array("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice($notice, true); |
| 114 |
/**/ |
| 115 |
if($options["file_download_limit_exceeded_page"] && $options["file_download_limit_exceeded_page"] === $options["membership_options_page"] && ($display_notices === true || in_array("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Download Limit Exceeded Page is the same as your Membership Options Page. Please correct this. See: <code>s2Member -> Download Options</code>.')) |
| 116 |
($enqueue_notices === true || in_array("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice($notice, true); |
| 117 |
} |
| 118 |
/**/ |
| 119 |
$updated_all_options = true; /* Flag indicating this routine was processed successfully; and that all s2Member options have been updated successfully.*/ |
| 120 |
} |
| 121 |
/**/ |
| 122 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); |
| 123 |
do_action("ws_plugin__s2member_after_update_all_options", get_defined_vars()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */ |
| 124 |
unset($__refs, $__v); /* Unset defined __refs, __v. */ |
| 125 |
/**/ |
| 126 |
return apply_filters("ws_plugin__s2member_update_all_options", (($updated_all_options) ? true : false), get_defined_vars()); |
| 127 |
} |
| 128 |
/** |
| 129 |
* Adds option menus / sub-menus. |
| 130 |
* |
| 131 |
* @package s2Member\Menu_Pages |
| 132 |
* @since 3.5 |
| 133 |
* |
| 134 |
* @attaches-to ``add_action("admin_menu");`` |
| 135 |
* |
| 136 |
* @return null |
| 137 |
*/ |
| 138 |
public static function add_admin_options() |
| 139 |
{ |
| 140 |
do_action("ws_plugin__s2member_before_add_admin_options", get_defined_vars()); |
| 141 |
/**/ |
| 142 |
add_filter("plugin_action_links", "c_ws_plugin__s2member_menu_pages::_add_settings_link", 10, 2); |
| 143 |
/**/ |
| 144 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_create_menu_items", true, get_defined_vars())) |
| 145 |
{ |
| 146 |
if((is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) || apply_filters("ws_plugin__s2member_during_add_admin_options_clear_right_side", false, get_defined_vars())) |
| 147 |
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"] = array(); /* Clear right side. */ |
| 148 |
/**/ |
| 149 |
$menu = apply_filters("ws_plugin__s2member_during_add_admin_options_menu_slug", "ws-plugin--s2member-start", get_defined_vars()); |
| 150 |
/**/ |
| 151 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_menu_page", true, get_defined_vars())) |
| 152 |
add_menu_page("s2Member®", "s2Member®", "create_users", $menu, "c_ws_plugin__s2member_menu_pages::start_page", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images/brand-favicon.png"); |
| 153 |
/**/ |
| 154 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_start_page", true, get_defined_vars())) |
| 155 |
add_submenu_page($menu, "s2Member Quick-Start Guide", "Quick-Start Guide", "create_users", "ws-plugin--s2member-start", "c_ws_plugin__s2member_menu_pages::start_page"); |
| 156 |
/**/ |
| 157 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_1", true, get_defined_vars())) /* Divider. */ |
| 158 |
add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#"); |
| 159 |
/**/ |
| 160 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_mms_ops_page", (!is_multisite() || is_main_site()), get_defined_vars())) |
| 161 |
add_submenu_page($menu, "s2Member Multisite Configuration", "Multisite (Config)", "create_users", "ws-plugin--s2member-mms-ops", "c_ws_plugin__s2member_menu_pages::mms_ops_page"); |
| 162 |
/**/ |
| 163 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_gen_ops_page", true, get_defined_vars())) |
| 164 |
add_submenu_page($menu, "s2Member General Options", "General Options", "create_users", "ws-plugin--s2member-gen-ops", "c_ws_plugin__s2member_menu_pages::gen_ops_page"); |
| 165 |
/**/ |
| 166 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_res_ops_page", true, get_defined_vars())) |
| 167 |
add_submenu_page($menu, "s2Member Restriction Options", "Restriction Options", "create_users", "ws-plugin--s2member-res-ops", "c_ws_plugin__s2member_menu_pages::res_ops_page"); |
| 168 |
/**/ |
| 169 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_down_ops_page", (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()), get_defined_vars())) |
| 170 |
add_submenu_page($menu, "s2Member Download Options", "Download Options", "create_users", "ws-plugin--s2member-down-ops", "c_ws_plugin__s2member_menu_pages::down_ops_page"); |
| 171 |
/**/ |
| 172 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_2", true, get_defined_vars())) /* Divider. */ |
| 173 |
add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#"); |
| 174 |
/**/ |
| 175 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_new_user_page", true, get_defined_vars())) /* Shortcut. */ |
| 176 |
add_submenu_page($menu, "s2Member / Add A Member", "Add A Member", "create_users", "user-new.php"); |
| 177 |
/**/ |
| 178 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_browse_users_page", true, get_defined_vars())) /* Shortcut. */ |
| 179 |
add_submenu_page($menu, "s2Member / Browse Members", "Browse Members", "create_users", "users.php"); |
| 180 |
/**/ |
| 181 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_3", true, get_defined_vars())) /* Divider. */ |
| 182 |
add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#"); |
| 183 |
/**/ |
| 184 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_paypal_ops_page", true, get_defined_vars())) |
| 185 |
add_submenu_page($menu, "s2Member PayPal Options", "PayPal® Options", "create_users", "ws-plugin--s2member-paypal-ops", "c_ws_plugin__s2member_menu_pages::paypal_ops_page"); |
| 186 |
/**/ |
| 187 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_paypal_buttons_page", true, get_defined_vars())) |
| 188 |
add_submenu_page($menu, "s2Member PayPal® Buttons", "PayPal® Buttons", "create_users", "ws-plugin--s2member-paypal-buttons", "c_ws_plugin__s2member_menu_pages::paypal_buttons_page"); |
| 189 |
/**/ |
| 190 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_4", true, get_defined_vars())) /* Divider. */ |
| 191 |
add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#"); |
| 192 |
/**/ |
| 193 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_trk_ops_page", true, get_defined_vars())) |
| 194 |
add_submenu_page($menu, "s2Member API / Tracking", "API / Tracking", "create_users", "ws-plugin--s2member-trk-ops", "c_ws_plugin__s2member_menu_pages::trk_ops_page"); |
| 195 |
/**/ |
| 196 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_els_ops_page", true, get_defined_vars())) |
| 197 |
add_submenu_page($menu, "s2Member API / List Servers", "API / List Servers", "create_users", "ws-plugin--s2member-els-ops", "c_ws_plugin__s2member_menu_pages::els_ops_page"); |
| 198 |
/**/ |
| 199 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_api_ops_page", true, get_defined_vars())) |
| 200 |
add_submenu_page($menu, "s2Member API / Notifications", "API / Notifications", "create_users", "ws-plugin--s2member-api-ops", "c_ws_plugin__s2member_menu_pages::api_ops_page"); |
| 201 |
/**/ |
| 202 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_scripting_page", true, get_defined_vars())) |
| 203 |
add_submenu_page($menu, "s2Member API / Scripting", "API / Scripting", "create_users", "ws-plugin--s2member-scripting", "c_ws_plugin__s2member_menu_pages::scripting_page"); |
| 204 |
/**/ |
| 205 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_5", true, get_defined_vars())) /* Divider. */ |
| 206 |
add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#"); |
| 207 |
/**/ |
| 208 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_integrations_page", (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()), get_defined_vars())) |
| 209 |
add_submenu_page($menu, "s2Member / Other Integrations", "Other Integrations", "create_users", "ws-plugin--s2member-integrations", "c_ws_plugin__s2member_menu_pages::integrations_page"); |
| 210 |
/**/ |
| 211 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_6", true, get_defined_vars())) /* Divider. */ |
| 212 |
add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#"); |
| 213 |
/**/ |
| 214 |
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_info_page", (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()), get_defined_vars())) |
| 215 |
add_submenu_page($menu, "s2Member Information", "s2Member Info", "create_users", "ws-plugin--s2member-info", "c_ws_plugin__s2member_menu_pages::info_page"); |
| 216 |
/**/ |
| 217 |
do_action("ws_plugin__s2member_during_add_admin_options_additional_pages", get_defined_vars()); |
| 218 |
} |
| 219 |
/**/ |
| 220 |
do_action("ws_plugin__s2member_after_add_admin_options", get_defined_vars()); |
| 221 |
/**/ |
| 222 |
return; /* Return for uniformity. */ |
| 223 |
} |
| 224 |
/** |
| 225 |
* Adds network option menus / sub-menus. |
| 226 |
* |
| 227 |
* @package s2Member\Menu_Pages |
| 228 |
* @since 3.5 |
| 229 |
* |
| 230 |
* @attaches-to ``add_action("network_admin_menu");`` |
| 231 |
* |
| 232 |
* @return null |
| 233 |
*/ |
| 234 |
public static function add_network_admin_options() |
| 235 |
{ |
| 236 |
do_action("ws_plugin__s2member_before_add_network_admin_options", get_defined_vars()); |
| 237 |
/**/ |
| 238 |
if(apply_filters("ws_plugin__s2member_during_add_network_admin_options_create_menu_items", true, get_defined_vars())) |
| 239 |
{ |
| 240 |
if((is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) || apply_filters("ws_plugin__s2member_during_add_network_admin_options_clear_right_side", false, get_defined_vars())) |
| 241 |
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"] = array(); /* Clear right side. */ |
| 242 |
/**/ |
| 243 |
$menu = "ws-plugin--s2member-mms-ops"; /* Used below for nesting additional sub-menu pages. */ |
| 244 |
/**/ |
| 245 |
add_menu_page("s2Member®", "s2Member®", "create_users", $menu, "c_ws_plugin__s2member_menu_pages::mms_ops_page", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images/brand-favicon.png"); |
| 246 |
/**/ |
| 247 |
add_submenu_page($menu, "s2Member Multisite ( Configuration )", "Multisite (Config)", "create_users", "ws-plugin--s2member-mms-ops", "c_ws_plugin__s2member_menu_pages::mms_ops_page"); |
| 248 |
/**/ |
| 249 |
if(apply_filters("ws_plugin__s2member_during_add_network_admin_options_add_info_page", (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()), get_defined_vars())) |
| 250 |
add_submenu_page($menu, "s2Member Information", "s2Member Info", "create_users", "ws-plugin--s2member-info", "c_ws_plugin__s2member_menu_pages::info_page"); |
| 251 |
/**/ |
| 252 |
do_action("ws_plugin__s2member_during_add_network_admin_options_additional_pages", get_defined_vars()); |
| 253 |
} |
| 254 |
/**/ |
| 255 |
do_action("ws_plugin__s2member_after_add_network_admin_options", get_defined_vars()); |
| 256 |
/**/ |
| 257 |
return; /* Return for uniformity. */ |
| 258 |
} |
| 259 |
/** |
| 260 |
* A sort of callback function to add the settings link. |
| 261 |
* |
| 262 |
* @package s2Member\Menu_Pages |
| 263 |
* @since 3.5 |
| 264 |
* |
| 265 |
* @attaches-to ``add_filter("plugin_action_links");`` |
| 266 |
* |
| 267 |
* @param array $actions Expects an existing array of actions links, passed in by the Filter. |
| 268 |
* @param str $plugin_file Expects path to a plugin file. We need to test against this for s2Member. |
| 269 |
* @return array An array of links, Filtered by this routine. |
| 270 |
*/ |
| 271 |
public static function _add_settings_link($actions = FALSE, $plugin_file = FALSE) |
| 272 |
{ |
| 273 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); |
| 274 |
do_action("_ws_plugin__s2member_before_add_settings_link", get_defined_vars()); |
| 275 |
unset($__refs, $__v); /* Unset defined __refs, __v. */ |
| 276 |
/**/ |
| 277 |
if($plugin_file === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["plugin_basename"] && is_array($actions)) |
| 278 |
{ |
| 279 |
$settings = '<a href="'.esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-gen-ops")).'">Settings</a>'; |
| 280 |
array_unshift($actions, apply_filters("ws_plugin__s2member_add_settings_link", $settings, get_defined_vars())); |
| 281 |
/**/ |
| 282 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); |
| 283 |
do_action("_ws_plugin__s2member_during_add_settings_link", get_defined_vars()); |
| 284 |
unset($__refs, $__v); /* Unset defined __refs, __v. */ |
| 285 |
} |
| 286 |
/**/ |
| 287 |
return apply_filters("_ws_plugin__s2member_add_settings_link", $actions, get_defined_vars()); |
| 288 |
} |
| 289 |
/** |
| 290 |
* Enqueue scripts for administrative menu pages. |
| 291 |
* |
| 292 |
* @package s2Member\Menu_Pages |
| 293 |
* @since 3.5 |
| 294 |
* |
| 295 |
* @attaches-to ``add_action("admin_print_scripts");`` |
| 296 |
* |
| 297 |
* @return null |
| 298 |
*/ |
| 299 |
public static function add_admin_scripts() |
| 300 |
{ |
| 301 |
do_action("ws_plugin__s2member_before_add_admin_scripts", get_defined_vars()); |
| 302 |
/**/ |
| 303 |
if(!empty($_GET["page"]) && preg_match("/ws-plugin--s2member-/", $_GET["page"])) |
| 304 |
{ |
| 305 |
wp_enqueue_script("jquery"); |
| 306 |
wp_enqueue_script("thickbox"); |
| 307 |
wp_enqueue_script("media-upload"); |
| 308 |
wp_enqueue_script("jquery-ui-core"); |
| 309 |
wp_enqueue_script("jquery-sprintf", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/includes/jquery/jquery.sprintf/jquery.sprintf-min.js", array("jquery"), c_ws_plugin__s2member_utilities::ver_checksum()); |
| 310 |
wp_enqueue_script("jquery-json-ps", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/includes/jquery/jquery.json-ps/jquery.json-ps-min.js", array("jquery"), c_ws_plugin__s2member_utilities::ver_checksum()); |
| 311 |
wp_enqueue_script("jquery-ui-effects", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/includes/jquery/jquery.ui-effects/jquery.ui-effects-min.js", array("jquery", "jquery-ui-core"), c_ws_plugin__s2member_utilities::ver_checksum()); |
| 312 |
wp_enqueue_script("ws-plugin--s2member-menu-pages", site_url("/?ws_plugin__s2member_menu_pages_js=".urlencode(mt_rand())), array("jquery", "thickbox", "media-upload", "jquery-sprintf", "jquery-json-ps", "jquery-ui-core", "jquery-ui-effects", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum()); |
| 313 |
/**/ |
| 314 |
do_action("ws_plugin__s2member_during_add_admin_scripts", get_defined_vars()); |
| 315 |
} |
| 316 |
/**/ |
| 317 |
do_action("ws_plugin__s2member_after_add_admin_scripts", get_defined_vars()); |
| 318 |
/**/ |
| 319 |
return; /* Return for uniformity. */ |
| 320 |
} |
| 321 |
/** |
| 322 |
* Enqueue styles for administrative menu pages. |
| 323 |
* |
| 324 |
* @package s2Member\Menu_Pages |
| 325 |
* @since 3.5 |
| 326 |
* |
| 327 |
* @attaches-to ``add_action("admin_print_styles");`` |
| 328 |
* |
| 329 |
* @return null |
| 330 |
*/ |
| 331 |
public static function add_admin_styles() |
| 332 |
{ |
| 333 |
do_action("ws_plugin__s2member_before_add_admin_styles", get_defined_vars()); |
| 334 |
/**/ |
| 335 |
if(!empty($_GET["page"]) && preg_match("/ws-plugin--s2member-/", $_GET["page"])) |
| 336 |
{ |
| 337 |
wp_enqueue_style("thickbox"); |
| 338 |
wp_enqueue_style("ws-plugin--s2member-menu-pages", site_url("/?ws_plugin__s2member_menu_pages_css=".urlencode(mt_rand())), array("thickbox"), c_ws_plugin__s2member_utilities::ver_checksum(), "all"); |
| 339 |
/**/ |
| 340 |
do_action("ws_plugin__s2member_during_add_admin_styles", get_defined_vars()); |
| 341 |
} |
| 342 |
/**/ |
| 343 |
do_action("ws_plugin__s2member_after_add_admin_styles", get_defined_vars()); |
| 344 |
/**/ |
| 345 |
return; /* Return for uniformity. */ |
| 346 |
} |
| 347 |
/** |
| 348 |
* Builds and handles the Quick Start page. |
| 349 |
* |
| 350 |
* @package s2Member\Menu_Pages |
| 351 |
* @since 3.5 |
| 352 |
* |
| 353 |
* @return null |
| 354 |
*/ |
| 355 |
public static function start_page() |
| 356 |
{ |
| 357 |
do_action("ws_plugin__s2member_before_start_page", get_defined_vars()); |
| 358 |
/**/ |
| 359 |
include_once dirname(dirname(__FILE__))."/menu-pages/start.inc.php"; |
| 360 |
/**/ |
| 361 |
do_action("ws_plugin__s2member_after_start_page", get_defined_vars()); |
| 362 |
/**/ |
| 363 |
return; /* Return for uniformity. */ |
| 364 |
} |
| 365 |
/** |
| 366 |
* Builds and handles the Main Multisite Options page. |
| 367 |
* |
| 368 |
* @package s2Member\Menu_Pages |
| 369 |
* @since 3.5 |
| 370 |
* |
| 371 |
* @return null |
| 372 |
*/ |
| 373 |
public static function mms_ops_page() |
| 374 |
{ |
| 375 |
do_action("ws_plugin__s2member_before_mms_ops_page", get_defined_vars()); |
| 376 |
/**/ |
| 377 |
if(c_ws_plugin__s2member_menu_pages::update_all_options()) |
| 378 |
c_ws_plugin__s2member_mms_patches::mms_patches(true); |
| 379 |
/**/ |
| 380 |
include_once dirname(dirname(__FILE__))."/menu-pages/mms-ops.inc.php"; |
| 381 |
/**/ |
| 382 |
do_action("ws_plugin__s2member_after_mms_ops_page", get_defined_vars()); |
| 383 |
/**/ |
| 384 |
return; /* Return for uniformity. */ |
| 385 |
} |
| 386 |
/** |
| 387 |
* Builds and handles the General Options page. |
| 388 |
* |
| 389 |
* @package s2Member\Menu_Pages |
| 390 |
* @since 3.5 |
| 391 |
* |
| 392 |
* @return null |
| 393 |
*/ |
| 394 |
public static function gen_ops_page() |
| 395 |
{ |
| 396 |
do_action("ws_plugin__s2member_before_gen_ops_page", get_defined_vars()); |
| 397 |
/**/ |
| 398 |
c_ws_plugin__s2member_menu_pages::update_all_options(); |
| 399 |
/**/ |
| 400 |
include_once dirname(dirname(__FILE__))."/menu-pages/gen-ops.inc.php"; |
| 401 |
/**/ |
| 402 |
do_action("ws_plugin__s2member_after_gen_ops_page", get_defined_vars()); |
| 403 |
/**/ |
| 404 |
return; /* Return for uniformity. */ |
| 405 |
} |
| 406 |
/** |
| 407 |
* Builds and handles the Restriction Options page. |
| 408 |
* |
| 409 |
* @package s2Member\Menu_Pages |
| 410 |
* @since 3.5 |
| 411 |
* |
| 412 |
* @return null |
| 413 |
*/ |
| 414 |
public static function res_ops_page() |
| 415 |
{ |
| 416 |
do_action("ws_plugin__s2member_before_res_ops_page", get_defined_vars()); |
| 417 |
/**/ |
| 418 |
c_ws_plugin__s2member_menu_pages::update_all_options(); |
| 419 |
/**/ |
| 420 |
include_once dirname(dirname(__FILE__))."/menu-pages/res-ops.inc.php"; |
| 421 |
/**/ |
| 422 |
do_action("ws_plugin__s2member_after_res_ops_page", get_defined_vars()); |
| 423 |
/**/ |
| 424 |
return; /* Return for uniformity. */ |
| 425 |
} |
| 426 |
/** |
| 427 |
* Builds and handles the Paypal Options page. |
| 428 |
* |
| 429 |
* @package s2Member\Menu_Pages |
| 430 |
* @since 3.5 |
| 431 |
* |
| 432 |
* @return null |
| 433 |
*/ |
| 434 |
public static function paypal_ops_page() |
| 435 |
{ |
| 436 |
do_action("ws_plugin__s2member_before_paypal_ops_page", get_defined_vars()); |
| 437 |
/**/ |
| 438 |
c_ws_plugin__s2member_menu_pages::update_all_options(); |
| 439 |
/**/ |
| 440 |
$logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]; |
| 441 |
/**/ |
| 442 |
if(!is_dir($logs_dir) && is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($logs_dir)))) |
| 443 |
mkdir($logs_dir, 0777, true).clearstatcache(); |
| 444 |
/**/ |
| 445 |
$htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]."/.htaccess"; |
| 446 |
$htaccess_contents = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir_htaccess"]))); |
| 447 |
/**/ |
| 448 |
if(is_dir($logs_dir) && is_writable($logs_dir) && !file_exists($htaccess)) |
| 449 |
file_put_contents($htaccess, $htaccess_contents).clearstatcache(); |
| 450 |
/**/ |
| 451 |
if($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) /* Logging enabled? */ |
| 452 |
{ |
| 453 |
if(!is_dir($logs_dir)) /* If the security-enabled logs directory does not exist yet. */ |
| 454 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('The security-enabled logs directory ( <code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)).'</code> ) does not exist. Please create this directory manually & make it writable ( chmod 777 ).', true); |
| 455 |
/**/ |
| 456 |
else if(!is_writable($logs_dir)) /* If the logs directory is not writable yet. */ |
| 457 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('Permissions error. The security-enabled logs directory ( <code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)).'</code> ) is not writable. Please make this directory writable ( chmod 777 ).', true); |
| 458 |
/**/ |
| 459 |
if(!file_exists($htaccess)) /* If the .htaccess file has not been created yet. */ |
| 460 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('The .htaccess protection file ( <code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)).'</code> ) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>'.esc_html($htaccess_contents).'</pre>', true); |
| 461 |
/**/ |
| 462 |
else if(!preg_match("/deny from all/i", file_get_contents($htaccess))) /* Else if the .htaccess file does not offer the required protection. */ |
| 463 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file ( <code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)).'</code> ) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>'.esc_html($htaccess_contents).'</pre>', true); |
| 464 |
} |
| 465 |
/**/ |
| 466 |
include_once dirname(dirname(__FILE__))."/menu-pages/paypal-ops.inc.php"; |
| 467 |
/**/ |
| 468 |
do_action("ws_plugin__s2member_after_paypal_ops_page", get_defined_vars()); |
| 469 |
/**/ |
| 470 |
return; /* Return for uniformity. */ |
| 471 |
} |
| 472 |
/** |
| 473 |
* Builds and handles the Download Options page. |
| 474 |
* |
| 475 |
* @package s2Member\Menu_Pages |
| 476 |
* @since 3.5 |
| 477 |
* |
| 478 |
* @return null |
| 479 |
*/ |
| 480 |
public static function down_ops_page() |
| 481 |
{ |
| 482 |
do_action("ws_plugin__s2member_before_down_ops_page", get_defined_vars()); |
| 483 |
/**/ |
| 484 |
c_ws_plugin__s2member_menu_pages::update_all_options(); |
| 485 |
/**/ |
| 486 |
$files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]; |
| 487 |
/**/ |
| 488 |
$htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]."/.htaccess"; |
| 489 |
$htaccess_contents = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir_htaccess"]))); |
| 490 |
/**/ |
| 491 |
$no_gzip_htaccess = /* Always located in the absolute root path for WordPress®. */ ABSPATH.".htaccess"; |
| 492 |
$no_gzip_htaccess_contents = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_no_gzip_htaccess"]))); |
| 493 |
/**/ |
| 494 |
if(!c_ws_plugin__s2member_files::no_gzip_rules_in_root_htaccess() /* If s2Member's GZIP exclusions do NOT yet exist in the root `.htaccess` file. */) |
| 495 |
c_ws_plugin__s2member_files::write_no_gzip_into_root_htaccess(). /* Handle the root `.htaccess` file now. */clearstatcache(); |
| 496 |
/**/ |
| 497 |
if(!is_dir($files_dir) && is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($files_dir)))) |
| 498 |
mkdir($files_dir, 0777, true). /* Create this directory structure now. */clearstatcache(); |
| 499 |
/**/ |
| 500 |
if(is_dir($files_dir) && is_writable($files_dir) && !file_exists($htaccess) /* This file does NOT exist yet? */) |
| 501 |
file_put_contents($htaccess, $htaccess_contents). /* Create the `.htaccess` file now. */clearstatcache(); |
| 502 |
/**/ |
| 503 |
if(!c_ws_plugin__s2member_files::no_gzip_rules_in_root_htaccess /* If s2Member's GZIP exclusions do NOT yet exist in the root `.htaccess` file. */()) |
| 504 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('Possible GZIP conflict on server. Unable to write GZIP exclusions into root .htaccess file (<code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($no_gzip_htaccess)).'</code>). Please read the panel below: <strong>Preventing GZIP Conflicts</strong>, and add this section yourself:<br /><pre>'.esc_html($no_gzip_htaccess_contents).'</pre>', true); |
| 505 |
/**/ |
| 506 |
if(!is_dir($files_dir)) /* If the security-enabled files directory does not exist yet. */ |
| 507 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('The security-enabled files directory (<code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($files_dir)).'</code>) does not exist. Please create this directory manually.', true); |
| 508 |
/**/ |
| 509 |
if(!file_exists($htaccess)) /* If the `.htaccess` file has not been created yet. */ |
| 510 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('The .htaccess protection file (<code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)).'</code>) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>'.esc_html($htaccess_contents).'</pre>', true); |
| 511 |
/**/ |
| 512 |
else if(!preg_match("/deny from all/i", file_get_contents($htaccess))) /* Else if the `.htaccess` file does not offer the required protection. */ |
| 513 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file (<code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)).'</code>) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>'.esc_html($htaccess_contents).'</pre>', true); |
| 514 |
/**/ |
| 515 |
if(!empty($_POST["ws_plugin__s2member_amazon_cf_files_auto_configure_distros"]) && ($nonce = $_POST["ws_plugin__s2member_amazon_cf_files_auto_configure_distros"]) && wp_verify_nonce($nonce, "ws-plugin--s2member-amazon-cf-files-auto-configure-distros")) |
| 516 |
if(($amazon_cf_auto_configure_distros = c_ws_plugin__s2member_files_in::amazon_cf_auto_configure_distros()) && $amazon_cf_auto_configure_distros["success"]) |
| 517 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('Amazon® CloudFront Distributions auto-configured successfully. Please allow 30 minutes for propagation.'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) ? '<br /><em>Downloads Distribution CNAME: <code>'.esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]).' —» '.esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_dname"]).'</code></em>' : '').(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) ? '<br /><em>Streaming Distribution CNAME: <code>'.esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]).' —» '.esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_dname"]).'</code></em>' : '')); |
| 518 |
else /* Else there was an error. We need to report this back to the site owner so they can understand what's going on. */ |
| 519 |
(c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"] = true).c_ws_plugin__s2member_admin_notices::display_admin_notice('Unable to auto-configure Amazon® CloudFront Distributions.<br />Error code: <code>'.esc_html($amazon_cf_auto_configure_distros["code"]).'</code>. Error Message: <code>'.esc_html($amazon_cf_auto_configure_distros["message"]).'</code>', true); |
| 520 |
/**/ |
| 521 |
if(!empty($_POST["ws_plugin__s2member_amazon_s3_files_auto_configure_acls"]) && ($nonce = $_POST["ws_plugin__s2member_amazon_s3_files_auto_configure_acls"]) && wp_verify_nonce($nonce, "ws-plugin--s2member-amazon-s3-files-auto-configure-acls")) |
| 522 |
if(($amazon_s3_auto_configure_acls = c_ws_plugin__s2member_files_in::amazon_s3_auto_configure_acls()) && $amazon_s3_auto_configure_acls["success"]) |
| 523 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('Amazon® S3 ACLs auto-configured successfully.'); |
| 524 |
else /* Else there was an error. We need to report this back to the site owner so they can understand what's going on. */ |
| 525 |
(c_ws_plugin__s2member_menu_pages::$pre_display_errors["s3_files_auto_configure_acls"] = true).c_ws_plugin__s2member_admin_notices::display_admin_notice('Unable to auto-configure Amazon® S3 ACLs.<br />Error code: <code>'.esc_html($amazon_s3_auto_configure_acls["code"]).'</code>. Error Message: <code>'.esc_html($amazon_s3_auto_configure_acls["message"]).'</code>', true); |
| 526 |
/**/ |
| 527 |
include_once dirname(dirname(__FILE__))."/menu-pages/down-ops.inc.php"; |
| 528 |
/**/ |
| 529 |
do_action("ws_plugin__s2member_after_down_ops_page", get_defined_vars()); |
| 530 |
/**/ |
| 531 |
return; /* Return for uniformity. */ |
| 532 |
} |
| 533 |
/** |
| 534 |
* Builds and handles the API Tracking options page. |
| 535 |
* |
| 536 |
* @package s2Member\Menu_Pages |
| 537 |
* @since 3.5 |
| 538 |
* |
| 539 |
* @return null |
| 540 |
*/ |
| 541 |
public static function trk_ops_page() |
| 542 |
{ |
| 543 |
do_action("ws_plugin__s2member_before_trk_ops_page", get_defined_vars()); |
| 544 |
/**/ |
| 545 |
c_ws_plugin__s2member_menu_pages::update_all_options(); |
| 546 |
/**/ |
| 547 |
include_once dirname(dirname(__FILE__))."/menu-pages/trk-ops.inc.php"; |
| 548 |
/**/ |
| 549 |
do_action("ws_plugin__s2member_after_trk_ops_page", get_defined_vars()); |
| 550 |
/**/ |
| 551 |
return; /* Return for uniformity. */ |
| 552 |
} |
| 553 |
/** |
| 554 |
* Builds and handles the API List Server options page. |
| 555 |
* |
| 556 |
* @package s2Member\Menu_Pages |
| 557 |
* @since 3.5 |
| 558 |
* |
| 559 |
* @return null |
| 560 |
*/ |
| 561 |
public static function els_ops_page() |
| 562 |
{ |
| 563 |
do_action("ws_plugin__s2member_before_els_ops_page", get_defined_vars()); |
| 564 |
/**/ |
| 565 |
c_ws_plugin__s2member_menu_pages::update_all_options(); |
| 566 |
/**/ |
| 567 |
include_once dirname(dirname(__FILE__))."/menu-pages/els-ops.inc.php"; |
| 568 |
/**/ |
| 569 |
do_action("ws_plugin__s2member_after_els_ops_page", get_defined_vars()); |
| 570 |
/**/ |
| 571 |
return; /* Return for uniformity. */ |
| 572 |
} |
| 573 |
/** |
| 574 |
* Builds and handles the API Notifications page. |
| 575 |
* |
| 576 |
* @package s2Member\Menu_Pages |
| 577 |
* @since 3.5 |
| 578 |
* |
| 579 |
* @return null |
| 580 |
*/ |
| 581 |
public static function api_ops_page() |
| 582 |
{ |
| 583 |
do_action("ws_plugin__s2member_before_api_ops_page", get_defined_vars()); |
| 584 |
/**/ |
| 585 |
c_ws_plugin__s2member_menu_pages::update_all_options(); |
| 586 |
/**/ |
| 587 |
include_once dirname(dirname(__FILE__))."/menu-pages/api-ops.inc.php"; |
| 588 |
/**/ |
| 589 |
do_action("ws_plugin__s2member_after_api_ops_page", get_defined_vars()); |
| 590 |
/**/ |
| 591 |
return; /* Return for uniformity. */ |
| 592 |
} |
| 593 |
/** |
| 594 |
* Builds and handles the PayPal Button Generator page. |
| 595 |
* |
| 596 |
* @package s2Member\Menu_Pages |
| 597 |
* @since 3.5 |
| 598 |
* |
| 599 |
* @return null |
| 600 |
*/ |
| 601 |
public static function paypal_buttons_page() |
| 602 |
{ |
| 603 |
do_action("ws_plugin__s2member_before_paypal_buttons_page", get_defined_vars()); |
| 604 |
/**/ |
| 605 |
if(!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_username"] || !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_password"] || !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_signature"]) |
| 606 |
c_ws_plugin__s2member_admin_notices::display_admin_notice('Please configure <code>s2Member -> PayPal® Options</code> first. Once all of your PayPal® Options are configured; including your Email Address, API Username, Password, and Signature; return to this page & generate your PayPal® Button(s).', true); |
| 607 |
/**/ |
| 608 |
include_once dirname(dirname(__FILE__))."/menu-pages/paypal-buttons.inc.php"; |
| 609 |
/**/ |
| 610 |
do_action("ws_plugin__s2member_after_paypal_buttons_page", get_defined_vars()); |
| 611 |
/**/ |
| 612 |
return; /* Return for uniformity. */ |
| 613 |
} |
| 614 |
/** |
| 615 |
* Builds and handles the API Scripting page. |
| 616 |
* |
| 617 |
* @package s2Member\Menu_Pages |
| 618 |
* @since 3.5 |
| 619 |
* |
| 620 |
* @return null |
| 621 |
*/ |
| 622 |
public static function scripting_page() |
| 623 |
{ |
| 624 |
do_action("ws_plugin__s2member_before_scripting_page", get_defined_vars()); |
| 625 |
/**/ |
| 626 |
include_once dirname(dirname(__FILE__))."/menu-pages/scripting.inc.php"; |
| 627 |
/**/ |
| 628 |
do_action("ws_plugin__s2member_after_scripting_page", get_defined_vars()); |
| 629 |
/**/ |
| 630 |
return; /* Return for uniformity. */ |
| 631 |
} |
| 632 |
/** |
| 633 |
* Builds and handles the Integrations page. |
| 634 |
* |
| 635 |
* @package s2Member\Menu_Pages |
| 636 |
* @since 3.5 |
| 637 |
* |
| 638 |
* @return null |
| 639 |
*/ |
| 640 |
public static function integrations_page() |
| 641 |
{ |
| 642 |
do_action("ws_plugin__s2member_before_integrations_page", get_defined_vars()); |
| 643 |
/**/ |
| 644 |
include_once dirname(dirname(__FILE__))."/menu-pages/integrations.inc.php"; |
| 645 |
/**/ |
| 646 |
do_action("ws_plugin__s2member_after_integrations_page", get_defined_vars()); |
| 647 |
/**/ |
| 648 |
return; /* Return for uniformity. */ |
| 649 |
} |
| 650 |
/** |
| 651 |
* Builds and handles the s2Member Info page. |
| 652 |
* |
| 653 |
* @package s2Member\Menu_Pages |
| 654 |
* @since 3.5 |
| 655 |
* |
| 656 |
* @return null |
| 657 |
*/ |
| 658 |
public static function info_page() |
| 659 |
{ |
| 660 |
do_action("ws_plugin__s2member_before_info_page", get_defined_vars()); |
| 661 |
/**/ |
| 662 |
include_once dirname(dirname(__FILE__))."/menu-pages/info.inc.php"; |
| 663 |
/**/ |
| 664 |
do_action("ws_plugin__s2member_after_info_page", get_defined_vars()); |
| 665 |
/**/ |
| 666 |
return; /* Return for uniformity. */ |
| 667 |
} |
| 668 |
} |
| 669 |
} |
| 670 |
?> |