/** * Create view output. * * @since 1.0.1.0 * @return string */ public function to_html() { $this->check_simulation(); // Setup navigation tabs. $tabs = $this->data['tabs']; $membership = $this->data['membership']; $desc = array(); ob_start(); // Render tabbed interface. ?> <div class="ms-wrap wrap"> <?php MS_Helper_Html::settings_header(array('title' => $membership->get_name_tag(), 'title_icon_class' => '', 'desc' => __('Edit Memberhip details and define Membership specific settings.', MS_TEXT_DOMAIN))); $active_tab = MS_Helper_Html::html_admin_vertical_tabs($tabs); // Call the appropriate form to render. $tab_name = str_replace('-', '_', $active_tab); $callback_name = 'render_tab_' . $tab_name; $render_callback = apply_filters('ms_view_membership_edit_render_callback', array($this, $callback_name), $active_tab, $this->data); ?> <div class="ms-settings ms-settings-<?php echo esc_attr($tab_name); ?> "> <?php $html = call_user_func($render_callback); $html = apply_filters('ms_view_settings_' . $callback_name, $html); echo $html; ?> </div> </div> <?php $html = ob_get_clean(); return $html; }
/** * Overrides parent's to_html() method. * * Creates an output buffer, outputs the HTML and grabs the buffer content before releasing it. * Creates a wrapper 'ms-wrap' HTML element to contain content and navigation. The content inside * the navigation gets loaded with dynamic method calls. * e.g. if key is 'settings' then render_settings() gets called, if 'bob' then render_bob(). * * @todo Could use callback functions to call dynamic methods from within the helper, thus * creating the navigation with a single method call and passing method pointers in the $tabs array. * * @since 1.0.0 * * @return object */ public function to_html() { $this->check_simulation(); // Setup navigation tabs. $tabs = $this->data['tabs']; $desc = array(); ob_start(); // Render tabbed interface. ?> <div class="ms-wrap wrap"> <?php $desc = $this->advanced_forms($desc); MS_Helper_Html::settings_header(array('title' => __('Membership 2 Settings', 'membership2'), 'title_icon_class' => 'wpmui-fa wpmui-fa-cog', 'desc' => $desc)); $active_tab = MS_Helper_Html::html_admin_vertical_tabs($tabs); // Call the appropriate form to render. $tab_name = str_replace('-', '_', $active_tab); $callback_name = 'render_tab_' . $tab_name; $render_callback = apply_filters('ms_view_settings_edit_render_callback', array($this, $callback_name), $active_tab, $this->data); ?> <div class="ms-settings ms-settings-<?php echo esc_attr($tab_name); ?> "> <?php $html = call_user_func($render_callback); $html = apply_filters('ms_view_settings_' . $callback_name, $html); echo $html; ?> </div> </div> <?php $this->render_settings_footer($tab_name); $html = ob_get_clean(); return $html; }
/** * Overrides parent's to_html() method. * * Creates an output buffer, outputs the HTML and grabs the buffer content before releasing it. * Creates a wrapper 'ms-wrap' HTML element to contain content and navigation. The content inside * the navigation gets loaded with dynamic method calls. * e.g. if key is 'settings' then render_settings() gets called, if 'bob' then render_bob(). * * @since 1.0.0 * * @return object */ public function to_html() { $this->check_simulation(); // Setup navigation tabs. $tabs = $this->data['tabs']; ob_start(); // Render tabbed interface. ?> <div class="ms-wrap wrap"> <?php MS_Helper_Html::settings_header(array('title' => __('Help and documentation', MS_TEXT_DOMAIN), 'title_icon_class' => 'wpmui-fa wpmui-fa-info-circle')); $active_tab = MS_Helper_Html::html_admin_vertical_tabs($tabs); // Call the appropriate form to render. $callback_name = 'render_tab_' . str_replace('-', '_', $active_tab); $render_callback = apply_filters('ms_view_help_render_callback', array($this, $callback_name), $active_tab, $this->data); ?> <div class="ms-settings ms-help-content"> <?php $html = call_user_func($render_callback); $html = apply_filters('ms_view_help_' . $callback_name, $html); echo $html; ?> </div> </div> <?php return ob_get_clean(); }
/** * Create view output. * * @since 1.0.0 * @return string */ public function to_html() { $this->check_simulation(); $this->check_network(); $desc = array(__('Choose Pages, Categories etc. that you want to make <strong>unavailable</strong> to visitors, and non-members.', 'membership2')); ob_start(); // Render tabbed interface. ?> <div class="ms-wrap wrap ms-wrap-membership2"> <?php MS_Helper_Html::settings_header(array('title' => __('Set-up Protection Rules', 'membership2'), 'desc' => $desc)); // Display a filter to switch between individual memberships. $this->membership_filter(); // In network-wide protection mode allow user to select a site. $this->site_filter(); $active_tab = $this->data['active_tab']; MS_Helper_Html::html_admin_vertical_tabs($this->data['tabs'], $active_tab); // Call the appropriate form to render. $callback_name = 'render_tab_' . str_replace('-', '_', $active_tab); $render_callback = array($this, $callback_name); $render_callback = apply_filters('ms_view_protectedcontent_define-' . $active_tab, $render_callback, $this->data); if (is_callable($render_callback)) { $html = call_user_func($render_callback); } else { // This is to notify devs that a file/hook is missing or wrong. $html = '<div class="ms-settings">' . '<div class="error below-h2"><p>' . '<em>No View defined by hook "ms_view_protectedcontent_define-' . $active_tab . '"</em>' . '</p></div>' . '</div>'; } $html = apply_filters('ms_view_membership_protected_' . $active_tab, $html); echo $html; ?> </div> <?php $html = ob_get_clean(); return apply_filters('ms_view_membership_protectedcontent_to_html', $html, $this); }