MS_View_Addon

Renders Addons Page.

Defined (1)

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

/app/view/class-ms-view-addon.php  
  1. class MS_View_Addon extends MS_View { 
  2.  
  3. /** 
  4. * Overrides parent's to_html() method. 
  5. * Creates an output buffer, outputs the HTML and grabs the buffer content before releasing it. 
  6. * Creates a wrapper 'ms-wrap' HTML element to contain content and navigation. The content inside 
  7. * the navigation gets loaded with dynamic method calls. 
  8. * e.g. if key is 'settings' then render_settings() gets called, if 'bob' then render_bob(). 
  9. * @todo Could use callback functions to call dynamic methods from within the helper, thus 
  10. * creating the navigation with a single method call and passing method pointers in the $tabs array. 
  11. * @since 1.0.0 
  12. * @return object 
  13. */ 
  14. public function to_html() { 
  15. $this->check_simulation(); 
  16.  
  17. $items = $this->data['addon']->get_addon_list(); 
  18. $lang = (object) array( 
  19. 'active_badge' => __( 'ACTIVE', 'membership2' ),  
  20. 'show_details' => __( 'Details...', 'membership2' ),  
  21. 'close_details' => __( 'Close', 'membership2' ),  
  22. ); 
  23. $filters = array( 
  24. 'all' => __( 'All', 'membership2' ),  
  25. 'active' => __( 'Active', 'membership2' ),  
  26. 'inactive' => __( 'Inactive', 'membership2' ),  
  27. 'options' => __( 'With options', 'membership2' ),  
  28. ); 
  29.  
  30. ob_start(); 
  31. ?> 
  32. <div class="ms-wrap ms-addon-list"> 
  33. <h2 class="ms-settings-title"> 
  34. <i class="wpmui-fa wpmui-fa-puzzle-piece"></i> 
  35. <?php _e( 'Membership Add-ons', 'membership2' ); ?> 
  36. </h2> 
  37. <form action="" method="post"> 
  38. <?php lib3()->html->addon_list( $items, $lang, $filters ); ?> 
  39. </form> 
  40. </div> 
  41. <?php 
  42. $html = ob_get_clean(); 
  43. echo $html;