Source Code Documentation


s2member-pro\includes\classes\menu-pages.inc.php


  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. * This WordPress® plugin ( s2Member Pro ) is comprised of two parts:
  10. *
  11. * o (1) Its PHP code is licensed under the GPL license, as is WordPress®.
  12. * You should have received a copy of the GNU General Public License,
  13. * along with this software. In the main directory, see: /licensing/
  14. * If not, see: {@link http://www.gnu.org/licenses/}.
  15. *
  16. * o (2) All other parts of ( s2Member Pro ); including, but not limited to:
  17. * the CSS code, some JavaScript code, images, and design;
  18. * are licensed according to the license purchased.
  19. * See: {@link http://www.s2member.com/prices/}
  20. *
  21. * Unless you have our prior written consent, you must NOT directly or indirectly license,
  22. * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module;
  23. * or make an offer to do any of these things. All of these things are strictly
  24. * prohibited with part (2) of the s2Member Pro Module.
  25. *
  26. * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com
  27. * ( i.e. new features, bug fixes, updates, improvements ); along with full access
  28. * to our video tutorial library: {@link http://www.s2member.com/videos/}
  29. *
  30. * @package s2Member\Menu_Pages
  31. * @since 1.5
  32. */
  33. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  34. exit("Do not access this file directly.");
  35. /**/
  36. if (!class_exists ("c_ws_plugin__s2member_pro_menu_pages"))
  37. {
  38. /**
  39. * Administrative Menu Pages.
  40. *
  41. * @package s2Member\Menu_Pages
  42. * @since 1.5
  43. */
  44. class c_ws_plugin__s2member_pro_menu_pages
  45. {
  46. /**
  47. * Identifies the s2Member Pro Module.
  48. *
  49. * @package s2Member\Menu_Pages
  50. * @since 1.5
  51. *
  52. * @attaches-to ``add_filter("plugin_row_meta");``
  53. *
  54. * @param array $plugin_meta Expects an array of meta details for the ``$plugin_file``.
  55. * @param str $plugin_file Expects a string holding the basename of the plugin.
  56. * We need to look for a match to the s2Member Pro Module in this variable.
  57. * @return array Array of meta details for the plugin.
  58. */
  59. public static function module_identifier ($plugin_meta = FALSE, $plugin_file = FALSE)
  60. {
  61. if ($plugin_file === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["plugin_basename"])
  62. {
  63. $plugin_meta[0] .= ' + <strong>s2Member Pro v' . esc_html (WS_PLUGIN__S2MEMBER_PRO_VERSION) . '</strong>';
  64. }
  65. /**/
  66. return $plugin_meta; /* Now return all plugin meta; imploded by WordPress®. */
  67. }
  68. /**
  69. * Add the Coupon Codes page.
  70. *
  71. * @package s2Member\Menu_Pages
  72. * @since 1.5
  73. *
  74. * @attaches-to ``add_filter("ws_plugin__s2member_during_add_admin_options_add_divider_2");``
  75. *
  76. * @param bool $add_divider Expects a boolean value, passed through by the Filter.
  77. * @param array $vars Expects an array of defined variables passed through by the Filter.
  78. * @return bool Passes back the original value of ``$add_divider``.
  79. */
  80. public static function add_coupon_codes_page ($add_divider = TRUE, $vars = FALSE)
  81. {
  82. add_submenu_page ($vars["menu"], "s2Member Pro / Coupon Codes", "Pro Coupon Codes", "create_users", "ws-plugin--s2member-pro-coupon-codes", "c_ws_plugin__s2member_pro_menu_pages::coupon_codes_page");
  83. /**/
  84. return $add_divider; /* Now add the divider. */
  85. }
  86. /**
  87. * Add the Pro Module Import/Export page here.
  88. *
  89. * @package s2Member\Menu_Pages
  90. * @since 1.5
  91. *
  92. * @attaches-to ``add_filter("ws_plugin__s2member_during_add_admin_options_add_divider_3");``
  93. *
  94. * @param bool $add_divider Expects a boolean value, passed through by the Filter.
  95. * @param array $vars Expects an array of defined variables passed through by the Filter.
  96. * @return bool Passes back the original value of ``$add_divider``.
  97. */
  98. public static function add_import_export_page ($add_divider = TRUE, $vars = FALSE)
  99. {
  100. add_submenu_page ($vars["menu"], "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#");
  101. add_submenu_page ($vars["menu"], "s2Member Pro ( User Import/Export )", "Import / Export", "create_users", "ws-plugin--s2member-pro-import-export", "c_ws_plugin__s2member_pro_menu_pages::import_export_page");
  102. /**/
  103. return $add_divider; /* Now add the divider. */
  104. }
  105. /**
  106. * Add the page for configuration of other Payment Gateways.
  107. *
  108. * @package s2Member\Menu_Pages
  109. * @since 1.5
  110. *
  111. * @attaches-to ``add_filter("ws_plugin__s2member_during_add_admin_options_add_divider_4");``
  112. *
  113. * @param bool $add_divider Expects a boolean value, passed through by the Filter.
  114. * @param array $vars Expects an array of defined variables passed through by the Filter.
  115. * @return bool Passes back the original value of ``$add_divider``.
  116. */
  117. public static function add_other_gateways_page ($add_divider = TRUE, $vars = FALSE)
  118. {
  119. add_submenu_page ($vars["menu"], "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#");
  120. add_submenu_page ($vars["menu"], "s2Member Pro / Other Payment Gateways", "Other Gateways", "create_users", "ws-plugin--s2member-pro-other-gateways", "c_ws_plugin__s2member_pro_menu_pages::other_gateways_page");
  121. /**/
  122. return $add_divider; /* Now add the divider. */
  123. }
  124. /**
  125. * Add the Pro Module info page here.
  126. *
  127. * @package s2Member\Menu_Pages
  128. * @since 1.5
  129. *
  130. * @attaches-to ``add_action("ws_plugin__s2member_during_add_admin_options_additional_pages");``
  131. * @attaches-to ``add_action("ws_plugin__s2member_during_add_network_admin_options_additional_pages");``
  132. *
  133. * @param array $vars Expects an array of defined variables passed through by the Action Hook.
  134. * @return null
  135. */
  136. public static function add_info_page ($vars = FALSE)
  137. {
  138. if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
  139. add_submenu_page ($vars["menu"], "s2Member Pro Information", "s2Member Pro Info", "create_users", "ws-plugin--s2member-pro-info", "c_ws_plugin__s2member_pro_menu_pages::info_page");
  140. /**/
  141. return; /* Return for uniformity. */
  142. }
  143. /**
  144. * Add options for Login Welcome Page / One-Time-Offers.
  145. *
  146. * @package s2Member\Menu_Pages
  147. * @since 110720
  148. *
  149. * @attaches-to ``add_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_login_welcome_page");``
  150. *
  151. * @param array $vars Expects an array of defined variables passed through by the Action Hook.
  152. * @return null
  153. */
  154. public static function gen_ops_lwp_otos ($vars = FALSE)
  155. {
  156. include_once dirname (dirname (__FILE__)) . "/menu-pages/gen-ops-lwp-otos.inc.php";
  157. /**/
  158. return; /* Return for uniformity. */
  159. }
  160. /**
  161. * Add options for captcha anti-spam preferences.
  162. *
  163. * @package s2Member\Menu_Pages
  164. * @since 111203
  165. *
  166. * @attaches-to ``add_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_url_shortening");``
  167. *
  168. * @param array $vars Expects an array of defined variables passed through by the Action Hook.
  169. * @return null
  170. */
  171. public static function gen_ops_captcha_ops ($vars = FALSE)
  172. {
  173. include_once dirname (dirname (__FILE__)) . "/menu-pages/gen-ops-captcha-ops.inc.php";
  174. /**/
  175. return; /* Return for uniformity. */
  176. }
  177. /**
  178. * Add instructions to configure Membership Levels.
  179. *
  180. * @package s2Member\Menu_Pages
  181. * @since 1.5
  182. *
  183. * @attaches-to ``add_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_membership_levels");``
  184. *
  185. * @param array $vars Expects an array of defined variables passed through by the Action Hook.
  186. * @return null
  187. */
  188. public static function add_level_instructions ($vars = FALSE)
  189. {
  190. if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
  191. include_once dirname (dirname (__FILE__)) . "/menu-pages/unlimited-level-instructions.inc.php";
  192. /**/
  193. return; /* Return for uniformity. */
  194. }
  195. /**
  196. * Builds the documentation for the Remote Operations API.
  197. *
  198. * @package s2Member\Menu_Pages
  199. * @since 110713
  200. *
  201. * @attaches-to ``add_filter("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_hooks");``
  202. *
  203. * @param bool $display_api_hooks Expects a boolean value passed through by the Filter.
  204. * @return bool The same value of ``$display_api_hooks`` passes through.
  205. */
  206. public static function scripting_page_remote_ops_api ($display_api_hooks = FALSE)
  207. {
  208. include_once dirname (dirname (__FILE__)) . "/menu-pages/scripting-api-remote-ops.inc.php";
  209. /**/
  210. return $display_api_hooks; /* Now display API Hooks. */
  211. }
  212. /**
  213. * Builds the documentation for the Pro Login Widget.
  214. *
  215. * @package s2Member\Menu_Pages
  216. * @since 1.5
  217. *
  218. * @attaches-to ``add_filter("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_hooks");``
  219. *
  220. * @param bool $display_api_hooks Expects a boolean value passed through by the Filter.
  221. * @return bool The same value of ``$display_api_hooks`` passes through.
  222. */
  223. public static function scripting_page_login_widget_api ($display_api_hooks = FALSE)
  224. {
  225. include_once dirname (dirname (__FILE__)) . "/menu-pages/scripting-api-login-widget.inc.php";
  226. /**/
  227. return $display_api_hooks; /* Now display API Hooks. */
  228. }
  229. /**
  230. * Builds the documentation for Scripting / API Constants.
  231. *
  232. * @package s2Member\Menu_Pages
  233. * @since 1.5
  234. *
  235. * @attaches-to ``add_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_list_of_api_constants");``
  236. *
  237. * @param array $vars Expects an array of defined variables passed through by the Action Hook.
  238. * @return null
  239. */
  240. public static function scripting_page_api_constants ($vars = FALSE)
  241. {
  242. include_once dirname (dirname (__FILE__)) . "/menu-pages/scripting-api-constants.inc.php";
  243. /**/
  244. return; /* Return for uniformity. */
  245. }
  246. /**
  247. * Builds documentation for additional Shortcode Attributes integrated w/ PayPal® Buttons.
  248. *
  249. * @package s2Member\Menu_Pages
  250. * @since 1.5
  251. *
  252. * @attaches-to ``add_action("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_shortcode_attrs_lis");``
  253. *
  254. * @param array $vars Expects an array of defined variables passed through by the Action Hook.
  255. * @return null
  256. */
  257. public static function paypal_button_attrs ($vars = FALSE)
  258. {
  259. include_once dirname (dirname (__FILE__)) . "/menu-pages/paypal-button-attrs.inc.php";
  260. /**/
  261. return; /* Return for uniformity. */
  262. }
  263. /**
  264. * Builds options to customize the PayPal® Return-Page template.
  265. *
  266. * @package s2Member\Menu_Pages
  267. * @since 110720
  268. *
  269. * @attaches-to ``add_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_pdt_after_more_info");``
  270. *
  271. * @param array $vars Expects an array of defined variables passed through by the Action Hook.
  272. * @return null
  273. */
  274. public static function paypal_return_template ($vars = FALSE)
  275. {
  276. include_once dirname (dirname (__FILE__)) . "/menu-pages/paypal-ops-return-template.inc.php";
  277. /**/
  278. return; /* Return for uniformity. */
  279. }
  280. /**
  281. * Builds the other Payment Gateways page.
  282. *
  283. * @package s2Member\Menu_Pages
  284. * @since 1.5
  285. *
  286. * @return null
  287. */
  288. public static function other_gateways_page ()
  289. {
  290. c_ws_plugin__s2member_menu_pages::update_all_options (false, false, true, true, false, true);
  291. /**/
  292. include_once dirname (dirname (__FILE__)) . "/menu-pages/other-gateways.inc.php";
  293. /**/
  294. return; /* Return for uniformity. */
  295. }
  296. /**
  297. * Builds the User Import / Export page.
  298. *
  299. * @package s2Member\Menu_Pages
  300. * @since 1.5
  301. *
  302. * @return null
  303. */
  304. public static function import_export_page ()
  305. {
  306. c_ws_plugin__s2member_pro_imports::import (); /* Handles imports. */
  307. /**/
  308. include_once dirname (dirname (__FILE__)) . "/menu-pages/import-export.inc.php";
  309. /**/
  310. return; /* Return for uniformity. */
  311. }
  312. /**
  313. * Builds the Coupon Codes page.
  314. *
  315. * @package s2Member\Menu_Pages
  316. * @since 1.5
  317. *
  318. * @return null
  319. */
  320. public static function coupon_codes_page ()
  321. {
  322. c_ws_plugin__s2member_menu_pages::update_all_options (); /* Updates options. */
  323. /**/
  324. include_once dirname (dirname (__FILE__)) . "/menu-pages/coupon-codes.inc.php";
  325. /**/
  326. return; /* Return for uniformity. */
  327. }
  328. /**
  329. * Builds the s2Member Pro Info page.
  330. *
  331. * @package s2Member\Menu_Pages
  332. * @since 1.5
  333. *
  334. * @return null
  335. */
  336. public static function info_page ()
  337. {
  338. include_once dirname (dirname (__FILE__)) . "/menu-pages/info.inc.php";
  339. /**/
  340. return; /* Return for uniformity. */
  341. }
  342. }
  343. }
  344. ?>

s2member-pro\includes\classes\menu-pages.inc.php

Source Code Documentation