MS_View_Frontend_Activities

The Membership 2 MS View Frontend Activities class.

Defined (1)

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

/app/view/frontend/class-ms-view-frontend-activities.php  
  1. class MS_View_Frontend_Activities extends MS_View { 
  2.  
  3. public function to_html() { 
  4. ob_start(); 
  5. ?> 
  6. <div class="ms-account-wrapper"> 
  7. <?php if ( MS_Model_Member::is_logged_in() ) : ?> 
  8. <h2> 
  9. <?php _e( 'Activity', 'membership2' ); ?> 
  10. </h2> 
  11. <table> 
  12. <thead> 
  13. <tr> 
  14. <th class="ms-col-activity-date"><?php 
  15. _e( 'Date', 'membership2' ); 
  16. ?></th> 
  17. <th class="ms-col-activity-title"><?php 
  18. _e( 'Activity', 'membership2' ); 
  19. ?></th> 
  20. </tr> 
  21. </thead> 
  22. <tbody> 
  23. <?php foreach ( $this->data['events'] as $event ) : 
  24. $ev_classes = array( 
  25. 'ms-activity-topic-' . $event->topic,  
  26. 'ms-activity-type-' . $event->type,  
  27. 'ms-membership-' . $event->membership_id,  
  28. ); 
  29. ?> 
  30. <tr class="<?php echo esc_attr( implode( ' ', $ev_classes ) ); ?>"> 
  31. <td class="ms-col-activity-date"><?php 
  32. echo esc_html( 
  33. MS_Helper_Period::format_date( 
  34. $event->post_modified,  
  35. __( 'F j (H:i)', 'membership2' ) 
  36. ); 
  37. ?></td> 
  38. <td class="ms-col-activity-title"><?php 
  39. echo esc_html( $event->description ); 
  40. ?></td> 
  41. </tr> 
  42. <?php endforeach; ?> 
  43. </tbody> 
  44. </table> 
  45. <?php 
  46. else : 
  47. $redirect = esc_url_raw( add_query_arg( array() ) ); 
  48. $title = __( 'Your account', 'membership2' ); 
  49. echo do_shortcode( "[ms-membership-login redirect='$redirect' title='$title']" ); 
  50. endif; 
  51. ?> 
  52. </div> 
  53. <?php 
  54. $html = ob_get_clean(); 
  55. $html = apply_filters( 'ms_compact_code', $html ); 
  56.  
  57. return $html; 
  58.