M_Tutorial

The Membership 2 M Tutorial class.

Defined (1)

The class is defined in the following location(s).

/app_old/membershipincludes/classes/class.tutorial.php  
  1. class M_Tutorial { 
  2.  
  3. private $_membership_tutorial; 
  4. private $_wizard_tutorial; 
  5.  
  6. private $_membership_steps = array( 
  7. 'welcome',  
  8. 'members',  
  9. 'membersfilter',  
  10. 'memberssubs',  
  11. 'levels',  
  12. 'levelsaddnew',  
  13. 'levelsaddnewformtitle',  
  14. 'levelsaddnewformrules',  
  15. 'levelsaddnewformrulesdrag',  
  16. 'levelsaddnewformrulespositive',  
  17. 'levelsaddnewformrulesnegative',  
  18. 'levelsaddnewformrulesadvanced',  
  19. 'subscriptions',  
  20. 'subscriptionsaddnew',  
  21. 'subscriptionsaddtitle',  
  22. 'subscriptionsadddescription',  
  23. 'subscriptionsaddpricetext',  
  24. 'subscriptionsaddlevels',  
  25. 'subscriptionsadddrophere',  
  26. 'gateways',  
  27. 'options',  
  28. 'optionspages',  
  29. 'optionsprotection',  
  30. 'optionsdownloads',  
  31. 'optionsadmins',  
  32. 'optionsextras',  
  33. 'optionsadvanced',  
  34. 'communications',  
  35. 'communicationsadd',  
  36. 'communicationsaddform',  
  37. 'communicationsaddformsubject',  
  38. 'urlgroups',  
  39. 'pings',  
  40. 'enablemembership' 
  41. ); 
  42.  
  43. private $_wizard_steps = array( 
  44. 'wizardwelcome',  
  45. 'wizardshow',  
  46. 'wizarddismiss' 
  47. ); 
  48.  
  49. function __construct () { 
  50. if (!class_exists('Pointer_Tutorial')) require_once(membership_dir('membershipincludes/includes/new-pointer-tutorials.php')); 
  51.  
  52. $this->_membership_tutorial = new Pointer_Tutorial('membership', __('Membership tutorial', 'membership'), false, false); 
  53. $this->_membership_tutorial->add_icon(membership_url('membershipincludes/images/pointer-icon.png')); 
  54.  
  55. $this->_wizard_tutorial = new Pointer_Tutorial('membershipwizard', __('Membership tutorial', 'membership'), false, false); 
  56. $this->_wizard_tutorial->add_icon(membership_url('membershipincludes/images/pointer-icon.png')); 
  57.  
  58.  
  59. function M_Tutorial() { 
  60. $this->__construct(); 
  61.  
  62. function serve () { 
  63. $this->_add_hooks(); 
  64.  
  65. private function _add_hooks () { 
  66. add_action('admin_init', array($this, 'process_tutorial')); 
  67. add_action('wp_ajax_membership_restart_tutorial', array($this, 'json_restart_tutorial')); 
  68. add_action( 'admin_init', array(&$this, 'process_restart') ); 
  69.  
  70. function process_restart() { 
  71. // Check for a reset of the tutorial 
  72. if(isset($_GET['restarttutorial']) && $_GET['restarttutorial'] == 'yes') { 
  73. check_admin_referer('restarttutorial'); 
  74. $this->_membership_tutorial->restart(); 
  75. wp_safe_redirect( remove_query_arg( 'restarttutorial', remove_query_arg( '_wpnonce') ) ); 
  76.  
  77. function wizard_visible() { 
  78. if(defined('MEMBERSHIP_GLOBAL_TABLES') && MEMBERSHIP_GLOBAL_TABLES === true) { 
  79. if(function_exists('get_blog_option')) { 
  80. if(function_exists('switch_to_blog')) { 
  81. switch_to_blog(MEMBERSHIP_GLOBAL_MAINSITE); 
  82. $wizard_visible = get_blog_option(MEMBERSHIP_GLOBAL_MAINSITE, 'membership_wizard_visible', 'yes'); 
  83. if(function_exists('restore_current_blog')) { 
  84. restore_current_blog(); 
  85. } else { 
  86. $wizard_visible = get_option('membership_wizard_visible', 'yes'); 
  87. } else { 
  88. $wizard_visible = get_option('membership_wizard_visible', 'yes'); 
  89.  
  90. return $wizard_visible; 
  91.  
  92. function process_tutorial () { 
  93. global $pagenow; 
  94.  
  95. //if($_GET['page'] == ) 
  96. $visible = $this->wizard_visible(); 
  97. if($visible == 'no') { 
  98. // Show after the wizard is dissmissed 
  99. $this->_init_tutorial($this->_membership_steps); 
  100. $this->_membership_tutorial->initialize(); 
  101. } else { 
  102. $this->_init_wizard_tutorial($this->_wizard_steps); 
  103. $this->_wizard_tutorial->initialize(); 
  104.  
  105.  
  106. /** 
  107. if ('wdsm' == wdsm_getval($_GET, 'page')) $this->_init_tutorial($this->_setup_steps); 
  108. if ('social_marketing_ad' == wdsm_getval($_GET, 'post_type') && 'post-new.php' == $pagenow) $this->_init_tutorial($this->_edit_steps); 
  109. if ('first' == wdsm_getval($_GET, 'wdsm') && 'post-new.php' == $pagenow) $this->_init_tutorial($this->_insert_steps); 
  110. if (defined('DOING_AJAX')) { 
  111. $this->_init_tutorial($this->_setup_steps); 
  112. $this->_init_tutorial($this->_edit_steps); 
  113. $this->_edit_tutorial->initialize(); 
  114. $this->_setup_tutorial->initialize(); 
  115. $this->_insert_tutorial->initialize(); 
  116. */ 
  117.  
  118. function json_restart_tutorial () { 
  119. $tutorial = @$_POST['tutorial']; 
  120. $this->restart($tutorial); 
  121. die; 
  122.  
  123. public function restart ($part=false) { 
  124. $this->_membership_tutorial->restart(); 
  125.  
  126. private function _init_tutorial ($steps) { 
  127. $this->_membership_tutorial->set_textdomain('membership'); 
  128. $this->_membership_tutorial->set_capability('manage_options'); 
  129.  
  130. foreach ($steps as $step) { 
  131. $call_step = "add_{$step}_step"; 
  132. if (method_exists($this, $call_step)) $this->$call_step(); 
  133.  
  134. private function _init_wizard_tutorial ($steps) { 
  135. $this->_wizard_tutorial->set_textdomain('membership'); 
  136. $this->_wizard_tutorial->set_capability('manage_options'); 
  137.  
  138. foreach ($steps as $step) { 
  139. $call_step = "add_{$step}_step"; 
  140. if (method_exists($this, $call_step)) $this->$call_step(); 
  141.  
  142. /** ----- Wizard steps ---- */ 
  143.  
  144. function add_wizardwelcome_step () { 
  145. $this->_wizard_tutorial->add_step( 
  146. $this->admin_url('admin.php?page=membership'), 'toplevel_page_membership',  
  147. '#icon-index',  
  148. __('Welcome to Membership', 'membership'),  
  149. array( 
  150. 'content' => '<p>' . esc_js(__('This is the membership dashboard panel where you can keep track of your sites statistics and information.', 'membership')) . '</p>',  
  151. 'position' => array('edge' => 'top', 'align' => 'left'),  
  152. ); 
  153.  
  154.  
  155. function add_wizardshow_step () { 
  156. $this->_wizard_tutorial->add_step( 
  157. $this->admin_url('admin.php?page=membership'), 'toplevel_page_membership',  
  158. 'div.welcome-panel-content h3',  
  159. __('Getting started wizard', 'membership'),  
  160. array( 
  161. 'content' => '<p>' . esc_js(__('We have built a short (very short) wizard to help you get started with the plugin.', 'membership')) . '</p>',  
  162. 'position' => array('edge' => 'top', 'align' => 'left'),  
  163. ); 
  164.  
  165.  
  166. function add_wizarddismiss_step () { 
  167. $this->_wizard_tutorial->add_step( 
  168. $this->admin_url('admin.php?page=membership'), 'toplevel_page_membership',  
  169. 'p.welcome-panel-dismiss',  
  170. __('Dismissing the wizard', 'membership'),  
  171. array( 
  172. 'content' => '<p>' . esc_js(__('If you do not want to use the wizard then you can dismiss it here.', 'membership')) . '</p>',  
  173. 'position' => array('edge' => 'bottom', 'align' => 'left'),  
  174. ); 
  175.  
  176.  
  177. /** ----- Edit Steps ----- */ 
  178.  
  179. function add_welcome_step () { 
  180. $this->_membership_tutorial->add_step( 
  181. $this->admin_url('admin.php?page=membership'), 'toplevel_page_membership',  
  182. '#toplevel_page_membership',  
  183. __('Membership Menu', 'membership'),  
  184. array( 
  185. 'content' => '<p>' . esc_js(__('This is your main membership menu, you have direct access to all the areas of the plugin from here.', 'membership')) . '</p>',  
  186. 'position' => array('edge' => 'left', 'align' => 'bottom'),  
  187. ); 
  188.  
  189.  
  190. function add_members_step () { 
  191. $this->_membership_tutorial->add_step( 
  192. $this->admin_url('admin.php?page=membershipmembers'), 'membership_page_membershipmembers',  
  193. '#icon-users',  
  194. __('Members screen', 'membership'),  
  195. array( 
  196. 'content' => '<p>' . esc_js(__('This is the list of members for your site, you can control their subscriptions from here.', 'membership')) . '</p>',  
  197. 'position' => array('edge' => 'top', 'align' => 'left'),  
  198. ); 
  199.  
  200.  
  201. function add_membersfilter_step () { 
  202. $this->_membership_tutorial->add_step( 
  203. $this->admin_url('admin.php?page=membershipmembers'), 'membership_page_membershipmembers',  
  204. '#doaction',  
  205. __('Member filtering', 'membership'),  
  206. array( 
  207. 'content' => '<p>' . esc_js(__('You can use the filters at the top of the list to find members with specific criteria.', 'membership')) . '</p>',  
  208. 'position' => array('edge' => 'top', 'align' => 'left'),  
  209. ); 
  210.  
  211.  
  212. function add_memberssubs_step () { 
  213. $this->_membership_tutorial->add_step( 
  214. $this->admin_url('admin.php?page=membershipmembers'), 'membership_page_membershipmembers',  
  215. '#sub',  
  216. __('Member subscriptions', 'membership'),  
  217. array( 
  218. 'content' => '<p>' . esc_js(__('You can Add, move or drop members from a subscription or level by using the links on a members row.', 'membership')) . '</p>',  
  219. 'position' => array('edge' => 'bottom', 'align' => 'left'),  
  220. ); 
  221.  
  222.  
  223. function add_levels_step () { 
  224. $this->_membership_tutorial->add_step( 
  225. $this->admin_url('admin.php?page=membershiplevels'), 'membership_page_membershiplevels',  
  226. '#icon-link-manager',  
  227. __('Access Levels', 'membership'),  
  228. array( 
  229. 'content' => '<p>' . esc_js(__('Access levels allow you to control the amount of access to content members are entitled to see.', 'membership')) . '</p>',  
  230. 'position' => array('edge' => 'top', 'align' => 'left'),  
  231. ); 
  232.  
  233.  
  234. function add_levelsaddnew_step () { 
  235. $this->_membership_tutorial->add_step( 
  236. $this->admin_url('admin.php?page=membershiplevels'), 'membership_page_membershiplevels',  
  237. '.add-new-h2',  
  238. __('Adding Levels', 'membership'),  
  239. array( 
  240. 'content' => '<p>' . esc_js(__('Click on the Add New link to create a new level.', 'membership')) . '</p>',  
  241. 'position' => array('edge' => 'top', 'align' => 'left'),  
  242. ); 
  243.  
  244.  
  245. function add_levelsaddnewformtitle_step () { 
  246. $this->_membership_tutorial->add_step( 
  247. $this->admin_url('admin.php?page=membershiplevels&action=edit&level_id='), 'membership_page_membershiplevels',  
  248. '#level_title',  
  249. __('Level Title', 'membership'),  
  250. array( 
  251. 'content' => '<p>' . esc_js(__('The Level title enables you to quickly identify a level and should be as descriptive as possible.', 'membership')) . '</p>',  
  252. 'position' => array('edge' => 'top', 'align' => 'left'),  
  253. ); 
  254.  
  255.  
  256. function add_levelsaddnewformrules_step () { 
  257. $this->_membership_tutorial->add_step( 
  258. $this->admin_url('admin.php?page=membershiplevels&action=edit&level_id='), 'membership_page_membershiplevels',  
  259. '#sidebar-main',  
  260. __('Level Rules', 'membership'),  
  261. array( 
  262. 'content' => '<p>' . esc_js(__('Each rule allows you to specify specific content to protect or allow access to.', 'membership')) . '</p>',  
  263. 'position' => array('edge' => 'right', 'align' => 'left'),  
  264. ); 
  265.  
  266.  
  267. function add_levelsaddnewformrulesdrag_step () { 
  268. $this->_membership_tutorial->add_step( 
  269. $this->admin_url('admin.php?page=membershiplevels&action=edit&level_id='), 'membership_page_membershiplevels',  
  270. '#positive-rules',  
  271. __('Adding Rules', 'membership'),  
  272. array( 
  273. 'content' => '<p>' . esc_js(__('To add a rule to your level, drag it to the Drop Here box. You can then select the content you want to protect / allow access to. To remove a rule you can click the Remove link in the rules title.', 'membership')) . '</p>',  
  274. 'position' => array('edge' => 'top', 'align' => 'left'),  
  275. ); 
  276.  
  277.  
  278. function add_levelsaddnewformrulespositive_step () { 
  279. $this->_membership_tutorial->add_step( 
  280. $this->admin_url('admin.php?page=membershiplevels&action=edit&level_id='), 'membership_page_membershiplevels',  
  281. 'li.positivetab',  
  282. __('Positive Rules', 'membership'),  
  283. array( 
  284. 'content' => '<p>' . esc_js(__('Positive rules allow you to specify what a member on this level has access to.', 'membership')) . '</p>',  
  285. 'position' => array('edge' => 'top', 'align' => 'left'),  
  286. ); 
  287.  
  288.  
  289. function add_levelsaddnewformrulesnegative_step () { 
  290. $this->_membership_tutorial->add_step( 
  291. $this->admin_url('admin.php?page=membershiplevels&action=edit&level_id='), 'membership_page_membershiplevels',  
  292. 'li.negativetab',  
  293. __('Negative Rules', 'membership'),  
  294. array( 
  295. 'content' => '<p>' . esc_js(__('Negative rules allow you to specify what a member does not have access to.', 'membership')) . '</p>',  
  296. 'position' => array('edge' => 'top', 'align' => 'left'),  
  297. ); 
  298.  
  299.  
  300. function add_levelsaddnewformrulesadvanced_step () { 
  301. $this->_membership_tutorial->add_step( 
  302. $this->admin_url('admin.php?page=membershiplevels&action=edit&level_id='), 'membership_page_membershiplevels',  
  303. 'li.advancedtab',  
  304. __('Advanced Rules', 'membership'),  
  305. array( 
  306. 'content' => '<p>' . esc_js(__('If you want to use a combination of Positive and Negative rules then you can add both in the advanced area.', 'membership')) . '</p>',  
  307. 'position' => array('edge' => 'top', 'align' => 'left'),  
  308. ); 
  309.  
  310.  
  311. function add_subscriptions_step () { 
  312. $this->_membership_tutorial->add_step( 
  313. $this->admin_url('admin.php?page=membershipsubs'), 'membership_page_membershipsubs',  
  314. '#icon-link-manager',  
  315. __('Subscriptions', 'membership'),  
  316. array( 
  317. 'content' => '<p>' . esc_js(__('Subscriptions control a members passage through your site and the length of time / amount of money they spend on each level.', 'membership')) . '</p>',  
  318. 'position' => array('edge' => 'top', 'align' => 'left'),  
  319. ); 
  320.  
  321.  
  322. function add_subscriptionsaddnew_step () { 
  323. $this->_membership_tutorial->add_step( 
  324. $this->admin_url('admin.php?page=membershipsubs'), 'membership_page_membershipsubs',  
  325. 'a.add-new-h2',  
  326. __('Adding Subscriptions', 'membership'),  
  327. array( 
  328. 'content' => '<p>' . esc_js(__('To add a subscription click on the Add New link.', 'membership')) . '</p>',  
  329. 'position' => array('edge' => 'top', 'align' => 'left'),  
  330. ); 
  331.  
  332.  
  333. function add_subscriptionsaddtitle_step () { 
  334. $this->_membership_tutorial->add_step( 
  335. $this->admin_url('admin.php?page=membershipsubs&action=edit&sub_id='), 'membership_page_membershipsubs',  
  336. '#sub_name',  
  337. __('Subscription Name', 'membership'),  
  338. array( 
  339. 'content' => '<p>' . esc_js(__('The subscription name helps identify the subscription and is shown on the subscriptions list on the front end of your site.', 'membership')) . '</p>',  
  340. 'position' => array('edge' => 'top', 'align' => 'left'),  
  341. ); 
  342.  
  343. function add_subscriptionsadddescription_step () { 
  344. $this->_membership_tutorial->add_step( 
  345. $this->admin_url('admin.php?page=membershipsubs&action=edit&sub_id='), 'membership_page_membershipsubs',  
  346. '#wp-sub_description-wrap',  
  347. __('Subscription Description', 'membership'),  
  348. array( 
  349. 'content' => '<p>' . esc_js(__('The subscription description is shown on the front end of your site and should describe the subscription and the benefits of selecting it.', 'membership')) . '</p>',  
  350. 'position' => array('edge' => 'top', 'align' => 'left'),  
  351. ); 
  352.  
  353. function add_subscriptionsaddpricetext_step () { 
  354. $this->_membership_tutorial->add_step( 
  355. $this->admin_url('admin.php?page=membershipsubs&action=edit&sub_id='), 'membership_page_membershipsubs',  
  356. '#sub_pricetext',  
  357. __('Subscription Price Text', 'membership'),  
  358. array( 
  359. 'content' => '<p>' . esc_js(__('The subscription price text is shown on the front end of your site and should contain a description of the pricing. E.g. $35 per month', 'membership')) . '</p>',  
  360. 'position' => array('edge' => 'top', 'align' => 'left'),  
  361. ); 
  362.  
  363. function add_subscriptionsaddlevels_step () { 
  364. $this->_membership_tutorial->add_step( 
  365. $this->admin_url('admin.php?page=membershipsubs&action=edit&sub_id='), 'membership_page_membershipsubs',  
  366. '#sidebar-levels',  
  367. __('Subscription Levels', 'membership'),  
  368. array( 
  369. 'content' => '<p>' . esc_js(__('The levels that you have available are shown here, to add them to this subscription you can drag them over to the Drop Here box.', 'membership')) . '</p>',  
  370. 'position' => array('edge' => 'right', 'align' => 'left'),  
  371. ); 
  372.  
  373. function add_subscriptionsadddrophere_step () { 
  374. $this->_membership_tutorial->add_step( 
  375. $this->admin_url('admin.php?page=membershipsubs&action=edit&sub_id='), 'membership_page_membershipsubs',  
  376. '#membership-levels',  
  377. __('Subscription Level Drop', 'membership'),  
  378. array( 
  379. 'content' => '<p>' . esc_js(__('Drop any Levels you want to add to this subscription here, you can re-order levels by dragging them into the desired order. To remove a level from the subscription you can click on the Remove link.', 'membership')) . '</p>',  
  380. 'position' => array('edge' => 'top', 'align' => 'left'),  
  381. ); 
  382.  
  383. function add_gateways_step () { 
  384. $this->_membership_tutorial->add_step( 
  385. $this->admin_url('admin.php?page=membershipgateways'), 'membership_page_membershipgateways',  
  386. '#icon-plugins',  
  387. __('Gateways', 'membership'),  
  388. array( 
  389. 'content' => '<p>' . esc_js(__('A gateway controls the interface between your website and a payment provider. You should activate the gateways you want to use on your site by clicking the Activate link underneath each gateways name. The settings for each gateway can be accessed by click the Settings link under the gateways name once it is active.', 'membership')) . '</p>',  
  390. 'position' => array('edge' => 'top', 'align' => 'left'),  
  391. ); 
  392.  
  393.  
  394. function add_options_step () { 
  395. $this->_membership_tutorial->add_step( 
  396. $this->admin_url('admin.php?page=membershipoptions'), 'membership_page_membershipoptions',  
  397. '#icon-options-general',  
  398. __('General Options', 'membership'),  
  399. array( 
  400. 'content' => '<p>' . esc_js(__('This options page allows you to set the level that you wish unregistered visitors to your site to belong to, as well as the subscription that you want new subscribers to be automatically added to.', 'membership')) . '</p>',  
  401. 'position' => array('edge' => 'top', 'align' => 'left'),  
  402. ); 
  403.  
  404.  
  405. function add_optionspages_step () { 
  406. $this->_membership_tutorial->add_step( 
  407. $this->admin_url('admin.php?page=membershipoptions&tab=pages'), 'membership_page_membershipoptions',  
  408. '#icon-options-general',  
  409. __('Membership Page Options', 'membership'),  
  410. array( 
  411. 'content' => '<p>' . esc_js(__('This options page allows you to control and create the pages that display specific membership information, such as the registration page and the account details page.', 'membership')) . '</p>',  
  412. 'position' => array('edge' => 'top', 'align' => 'left'),  
  413. ); 
  414.  
  415.  
  416. function add_optionsprotection_step () { 
  417. $this->_membership_tutorial->add_step( 
  418. $this->admin_url('admin.php?page=membershipoptions&tab=posts'), 'membership_page_membershipoptions',  
  419. '#icon-options-general',  
  420. __('Content Protection Options', 'membership'),  
  421. array( 
  422. 'content' => '<p>' . esc_js(__('This options page allows you to create the message that is displayed when a member does not have access to shortcode and / or more tag protected content.', 'membership')) . '</p>',  
  423. 'position' => array('edge' => 'top', 'align' => 'left'),  
  424. ); 
  425.  
  426.  
  427. function add_optionsdownloads_step () { 
  428. $this->_membership_tutorial->add_step( 
  429. $this->admin_url('admin.php?page=membershipoptions&tab=downloads'), 'membership_page_membershipoptions',  
  430. '#icon-options-general',  
  431. __('Download / Media Options', 'membership'),  
  432. array( 
  433. 'content' => '<p>' . esc_js(__('This options page allows you to set up a masking URL for your sites media and downloads and to create some groups that you can assign different media files to.', 'membership')) . '</p>',  
  434. 'position' => array('edge' => 'top', 'align' => 'left'),  
  435. ); 
  436.  
  437.  
  438. function add_optionsadmins_step () { 
  439. $this->_membership_tutorial->add_step( 
  440. $this->admin_url('admin.php?page=membershipoptions&tab=users'), 'membership_page_membershipoptions',  
  441. '#icon-options-general',  
  442. __('Membership Admin Users', 'membership'),  
  443. array( 
  444. 'content' => '<p>' . esc_js(__('You can add or remove membership administration rights to admin users using this page.', 'membership')) . '</p>',  
  445. 'position' => array('edge' => 'top', 'align' => 'left'),  
  446. ); 
  447.  
  448.  
  449. function add_optionsextras_step () { 
  450. $this->_membership_tutorial->add_step( 
  451. $this->admin_url('admin.php?page=membershipoptions&tab=extras'), 'membership_page_membershipoptions',  
  452. '#icon-options-general',  
  453. __('Extra Options', 'membership'),  
  454. array( 
  455. 'content' => '<p>' . esc_js(__('This page allows you to specify, amongst other things, the global currency for your site and the period of time left until a subscription expires before they can renew.', 'membership')) . '</p>',  
  456. 'position' => array('edge' => 'top', 'align' => 'left'),  
  457. ); 
  458.  
  459.  
  460. function add_optionsadvanced_step () { 
  461. $this->_membership_tutorial->add_step( 
  462. $this->admin_url('admin.php?page=membershipoptions&tab=advanced'), 'membership_page_membershipoptions',  
  463. '#icon-tools',  
  464. __('Repair Membership', 'membership'),  
  465. array( 
  466. 'content' => '<p>' . esc_js(__('If you have any issues with the membership plugin then you can check your database integrity using the Verify button on this page, if any issues are reported then they can be fixed by pressing the Repair button.', 'membership')) . '</p>',  
  467. 'position' => array('edge' => 'top', 'align' => 'left'),  
  468. ); 
  469.  
  470.  
  471. function add_communications_step () { 
  472. $this->_membership_tutorial->add_step( 
  473. $this->admin_url('admin.php?page=membershipcommunication'), 'membership_page_membershipcommunication',  
  474. '#icon-edit-comments',  
  475. __('Communications', 'membership'),  
  476. array( 
  477. 'content' => '<p>' . esc_js(__('The communications system enables you to set up a series of messages that are sent to your members at set daily periods after they have signed up or at set days upto the date their subscriptions are due to expire.', 'membership')) . '</p>',  
  478. 'position' => array('edge' => 'top', 'align' => 'left'),  
  479. ); 
  480.  
  481. function add_communicationsadd_step () { 
  482. $this->_membership_tutorial->add_step( 
  483. $this->admin_url('admin.php?page=membershipcommunication'), 'membership_page_membershipcommunication',  
  484. 'a.add-new-h2',  
  485. __('Add Communication', 'membership'),  
  486. array( 
  487. 'content' => '<p>' . esc_js(__('To add a new communication, click on the Add New button at the top of the page.', 'membership')) . '</p>',  
  488. 'position' => array('edge' => 'top', 'align' => 'left'),  
  489. ); 
  490.  
  491. function add_communicationsaddform_step () { 
  492. $this->_membership_tutorial->add_step( 
  493. $this->admin_url('admin.php?page=membershipcommunication&action=edit&comm='), 'membership_page_membershipcommunication',  
  494. 'select[name=periodprepost]',  
  495. __('Set period', 'membership'),  
  496. array( 
  497. 'content' => '<p>' . esc_js(__('Specify a time period before or after a subscription starts or is due to end. Setting a period of 0 means that the message is sent immediately on signup.', 'membership')) . '</p>',  
  498. 'position' => array('edge' => 'left', 'align' => 'right'),  
  499. ); 
  500.  
  501. function add_communicationsaddformsubject_step () { 
  502. $this->_membership_tutorial->add_step( 
  503. $this->admin_url('admin.php?page=membershipcommunication&action=edit&comm='), 'membership_page_membershipcommunication',  
  504. 'input[name=subject]',  
  505. __('Set subject and message', 'membership'),  
  506. array( 
  507. 'content' => '<p>' . esc_js(__('You should enter the subject and content of the message in the areas provided. You can use the placeholders listed next to the message area to include details such as the member name, etc.', 'membership')) . '</p>',  
  508. 'position' => array('edge' => 'left', 'align' => 'right'),  
  509. ); 
  510.  
  511. function add_urlgroups_step () { 
  512. $this->_membership_tutorial->add_step( 
  513. $this->admin_url('admin.php?page=membershipurlgroups'), 'membership_page_membershipurlgroups',  
  514. '#icon-edit-pages',  
  515. __('URL Groups', 'membership'),  
  516. array( 
  517. 'content' => '<p>' . esc_js(__('URL Groups allow you to specify a group of URLs on your site that you want to protect and then allow / or prevent members to access them from within a level.', 'membership')) . '</p>',  
  518. 'position' => array('edge' => 'top', 'align' => 'left'),  
  519. ); 
  520.  
  521.  
  522. function add_pings_step () { 
  523. $this->_membership_tutorial->add_step( 
  524. $this->admin_url('admin.php?page=membershippings'), 'membership_page_membershippings',  
  525. '#icon-link-manager',  
  526. __('Remote Pings', 'membership'),  
  527. array( 
  528. 'content' => '<p>' . esc_js(__('A Ping is a method of sending a message to an external URL when something happens within the membership plugin (such as a member starts or ends a subscription). They are useful for things like registering users on external support forums.', 'membership')) . '</p>',  
  529. 'position' => array('edge' => 'top', 'align' => 'left'),  
  530. ); 
  531.  
  532. function add_enablemembership_step () { 
  533. $this->_membership_tutorial->add_step( 
  534. $this->admin_url('admin.php?page=membership'), 'toplevel_page_membership',  
  535. '#enablemembership',  
  536. __('Enable Membership', 'membership'),  
  537. array( 
  538. 'content' => '<p>' . esc_js(__('Once you have everything set up you should enable the membership plugins protection system.', 'membership')) . '</p>',  
  539. 'position' => array('edge' => 'top', 'align' => 'left'),  
  540. ); 
  541.  
  542. function admin_url( $extend = false ) { 
  543. // ready for if site has network interface 
  544. if( (function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('membership/membership.php')) && (defined('MEMBERSHIP_GLOBAL_TABLES') && MEMBERSHIP_GLOBAL_TABLES === true)) { 
  545. return network_admin_url( $extend ); 
  546. } else { 
  547. return admin_url( $extend ); 
  548.  
  549.