public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Rule_CptItem::RULE_ID); $rule_listtable = new MS_Rule_CptItem_ListTable($rule); $rule_listtable->prepare_items(); $header_data = apply_filters('ms_view_membership_protectedcontent_header', array('title' => __('Choose Custom Post Types you want to protect', MS_TEXT_DOMAIN), 'desc' => ''), MS_Rule_CptItem::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); $rule_listtable->views(); $rule_listtable->search_box(__('Posts', MS_TEXT_DOMAIN)); ?> <form action="" method="post"> <?php $rule_listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_CptItem::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Rule_Page::RULE_ID); $rule_listtable = new MS_Rule_Page_ListTable($rule); $rule_listtable->prepare_items(); $header_data = apply_filters('ms_view_membership_protectedcontent_header', array('title' => __('Apply protection to Pages and and grant access to members', 'membership2'), 'desc' => __('All pages that do not have Content Protection applied are visible to Everyone', 'membership2')), MS_Rule_Page::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); $rule_listtable->views(); $rule_listtable->search_box(__('Pages', 'membership2')); ?> <form action="" method="post"> <?php $rule_listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_Page::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Rule_ReplaceMenu::RULE_ID); // This fixes the list-title generated by MS_Helper_ListTable_Rule. unset($_GET['status']); $listtable = new MS_Rule_ReplaceMenu_ListTable($rule); $listtable->prepare_items(); $header_data = apply_filters('ms_view_membership_protectedcontent_header', array('title' => __('Replace Menus', 'membership2'), 'desc' => __('Replace or protect WordPress menus.', 'membership2')), MS_Rule_ReplaceMenu::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); $listtable->views(); $listtable->search_box(); ?> <form action="" method="post"> <?php $listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_ReplaceMenu::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Rule_Content::RULE_ID); // This fixes the list-title generated by MS_Helper_ListTable_Rule. unset($_GET['status']); $rule_listtable = new MS_Rule_Content_ListTable($rule); $rule_listtable->prepare_items(); $header_data = apply_filters('ms_view_membership_protectedcontent_header', array('title' => __('Comments & More Tag', MS_TEXT_DOMAIN), 'desc' => __('Decide how to protect Comments and More Tag contents.', MS_TEXT_DOMAIN)), MS_Rule_Content::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); $rule_listtable->views(); $rule_listtable->search_box(__('Pages', MS_TEXT_DOMAIN)); ?> <form action="" method="post"> <?php $rule_listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_Content::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Rule_Adminside::RULE_ID); $rule_listtable = new MS_Rule_Adminside_ListTable($rule); $rule_listtable->prepare_items(); $header_data = apply_filters('ms_view_membership_protectedcontent_header', array('title' => __('Protect Admin Side pages', 'membership2'), 'desc' => array(__('Note that WordPress also restricts access to pages before Content Protection is applied.', 'membership2'), __('Tip: Combine with the <b>User Role</b> rules to grant your members additional permission if required!', 'membership2'))), MS_Rule_Adminside::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); $rule_listtable->views(); $rule_listtable->search_box(); ?> <form action="" method="post"> <?php $rule_listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_Adminside::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Rule_MemberRoles::RULE_ID); $rule_listtable = new MS_Rule_MemberRoles_ListTable($rule); $rule_listtable->prepare_items(); $header_data['title'] = __('Assign WordPress User Roles to your Members', MS_TEXT_DOMAIN); $header_data['desc'] = array(__('When assigning a Membership to any role, then this role will be added to all members of that Membership. You can even assign multiple roles to a single Membership.', MS_TEXT_DOMAIN), __('For security reasons the Administrator role cannot be assigned to a Membership.', MS_TEXT_DOMAIN)); $header_data = apply_filters('ms_view_membership_protectedcontent_header', $header_data, MS_Rule_MemberRoles::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); $rule_listtable->views(); $rule_listtable->search_box(__('Capability', MS_TEXT_DOMAIN)); ?> <form action="" method="post"> <?php $rule_listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_MemberRoles::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Rule_Category::RULE_ID); $rule_listtable = new MS_Rule_Category_ListTable($rule); $rule_listtable->prepare_items(); $header_data = array(); $header_data['title'] = __('Choose which Categories you want to protect', 'membership2'); $header_data['desc'] = ''; $header_data = apply_filters('ms_view_membership_protectedcontent_header', $header_data, MS_Rule_Category::RULE_ID, $this); ob_start(); ?> <div class="ms-settings "> <?php MS_Helper_Html::settings_tab_header($header_data); $rule_listtable->views(); $rule_listtable->search_box(__('Categories', 'membership2'), 'search-cat'); ?> <form action="" method="post"> <?php $rule_listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_Category::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
/** * Create view output. * * @since 1.0.0 * @return string */ public function to_html() { $fields = $this->get_fields(); $wrapper_class = $this->data['is_global_payments_set'] ? '' : 'wide'; ob_start(); ?> <div class="wrap ms-wrap"> <?php MS_Helper_Html::settings_header(array('title' => __('Payment', MS_TEXT_DOMAIN), 'title_icon_class' => 'wpmui-fa wpmui-fa-money', 'desc' => __('Set up your payment gateways and Membership Price'))); ?> <div class="ms-settings ms-wrapper-center ms-membership-payment cf <?php echo esc_attr($wrapper_class); ?> "> <?php $this->global_payment_settings(); $this->specific_payment_settings(); MS_Helper_Html::settings_footer($this->fields['control_fields'], $this->data['show_next_button']); ?> </div> </div> <?php $html = ob_get_clean(); echo $html; }
public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Rule_MemberCaps::RULE_ID); $rule_listtable = new MS_Rule_MemberCaps_ListTable($rule); $rule_listtable->prepare_items(); $header_data = array(); $header_data['title'] = __('Assign WordPress Capabilities to your Members', 'membership2'); $header_data['desc'] = array(__('Fine-tune member permissions by assigning certain Capabilities to each Membership. All Members of that Membership are granted the specified Capabilities.', 'membership2'), __('Important: All users that are not inside these Memberships will be striped of any Protected Capability!', 'membership2'), __('You should only use these rules if you know what you are doing! Granting the wrong capabilities makes your website prone to abuse. For a bit of security we already removed the most critical Capabilities from this list.', 'membership2')); $header_data = apply_filters('ms_view_membership_protectedcontent_header', $header_data, MS_Rule_MemberCaps::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); $rule_listtable->views(); $rule_listtable->search_box(__('Capability', 'membership2')); ?> <form action="" method="post"> <?php $rule_listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_MemberCaps::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
/** * Overrides parent's to_html() method. * * Creates an output buffer, outputs the HTML and grabs the buffer content before releasing it. * HTML contains the list of available payment gateways. * * @since 1.0.0 * * @return string */ public function to_html() { $fields = $this->get_global_payment_fields(); ob_start(); ?> <div id="ms-payment-settings-wrapper"> <div class="ms-global-payment-wrapper"> <div class="ms-list-table-wrapper"> <?php MS_Helper_Html::settings_tab_header(array('title' => __('Global Payment Settings', MS_TEXT_DOMAIN), 'desc' => __('These are shared across all memberships.', MS_TEXT_DOMAIN))); ?> <div class="ms-half space"> <?php MS_Helper_Html::html_element($fields['currency']); ?> </div> <div class="ms-half"> <?php MS_Helper_Html::html_element($fields['invoice_sender_name']); ?> </div> <div class="ms-group-head"> <div class="ms-bold"><?php _e('Payment Gateways', MS_TEXT_DOMAIN); ?> </div> <div class="ms-description"><?php _e('You need to set-up at least one Payment Gateway to be able to process payments.', MS_TEXT_DOMAIN); ?> </div> </div> <div class="gateways"> <?php $this->gateway_settings(); ?> </div> </div> <?php MS_Helper_Html::settings_footer(); ?> </div> </div> <?php $html = ob_get_clean(); return $html; }
public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Rule_Url::RULE_ID); $listtable = new MS_Rule_Url_ListTable($rule); $listtable->prepare_items(); if ($listtable->list_shows_base_items()) { $add_fields = array('url' => array('id' => 'url_value', 'title' => __('Add new URL Address', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'class' => 'ms-text-medium'), 'url_add' => array('id' => 'url_add', 'type' => MS_Helper_Html::INPUT_TYPE_SUBMIT, 'value' => __('Protect this URL', 'membership2'), 'button_type' => 'button'), 'url_action' => array('name' => 'rule_action', 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'value' => MS_Rule_Url::ACTION_ADD), 'url_nonce' => array('name' => '_wpnonce', 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'value' => wp_create_nonce(MS_Rule_Url::ACTION_ADD))); } $header_data = apply_filters('ms_view_membership_protectedcontent_header', array('title' => __('URL Restriction', 'membership2'), 'desc' => array(__('Specify URLs that you want to protect.', 'membership2'), __('e.g. <b>example.com/protectme/</b> will protect all URLs that contain <b>example.com/protectme/</b>, including any child page.', 'membership2')), 'class' => ''), MS_Rule_Url::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); ?> <form action="" method="post"> <?php if ($listtable->list_shows_base_items()) { foreach ($add_fields as $field) { MS_Helper_Html::html_element($field); } } ?> </form> <?php $listtable->views(); $listtable->search_box(); ?> <form action="" method="post"> <?php $listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_Url::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
public function to_html() { $membership = MS_Model_Membership::get_base(); $menus = $membership->get_rule(MS_Rule_MenuItem::RULE_ID)->get_menu_array(); $menu_ids = array_keys($menus); $menu_id = reset($menu_ids); if (isset($_REQUEST['menu_id'])) { $menu_id = $_REQUEST['menu_id']; } // This fixes the list-title generated by MS_Helper_ListTable_Rule. unset($_GET['status']); $rule_menu = $membership->get_rule(MS_Rule_MenuItem::RULE_ID); $rule_listtable = new MS_Rule_MenuItem_ListTable($rule_menu, $menus, $menu_id); $fields['rule_menu'] = array('id' => 'rule_menu', 'name' => 'rule', 'value' => 'menu', 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN); $menu_url = esc_url_raw(add_query_arg(array('menu_id' => $menu_id))); $rule_listtable->prepare_items(); $header_data = apply_filters('ms_view_membership_protectedcontent_header', array('title' => __('Menu Items', MS_TEXT_DOMAIN), 'desc' => __('Protect individual menu items.', MS_TEXT_DOMAIN)), MS_Rule_MenuItem::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); ?> <form id="ms-menu-form" method="post" action="<?php echo '' . $menu_url; ?> "> <?php MS_Helper_Html::html_element($fields['rule_menu']); $rule_listtable->views(); $rule_listtable->display(); do_action('ms_view_membership_protectedcontent_footer', MS_Rule_MenuItem::RULE_ID, $this); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }
public function to_html() { $membership = MS_Model_Membership::get_base(); $rule = $membership->get_rule(MS_Addon_Bbpress_Rule::RULE_ID); $listtable = new MS_Addon_Bbpress_Rule_Listtable($rule); $listtable->prepare_items(); $header_data = apply_filters('ms_view_membership_protectedcontent_header', array('title' => __('bbPress', MS_TEXT_DOMAIN), 'desc' => __('Protect the following bbPress content to members only.', MS_TEXT_DOMAIN)), MS_Addon_Bbpress_Rule::RULE_ID, $this); ob_start(); ?> <div class="ms-settings"> <?php MS_Helper_Html::settings_tab_header($header_data); $listtable->views(); ?> <form action="" method="post"> <?php $listtable->display(); ?> </form> </div> <?php MS_Helper_Html::settings_footer(); return ob_get_clean(); }