/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php

  1. <?php 
  2. /** 
  3. * BuddyPress - Members Messages Loop 
  4. * 
  5. * @package BuddyPress 
  6. * @subpackage bp-legacy 
  7. */ 
  8.  
  9. /** 
  10. * Fires before the members messages loop. 
  11. * 
  12. * @since 1.2.0 
  13. */ 
  14. do_action( 'bp_before_member_messages_loop' ); ?> 
  15.  
  16. <?php if ( bp_has_message_threads( bp_ajax_querystring( 'messages' ) ) ) : ?> 
  17.  
  18. <h2 class="bp-screen-reader-text"><?php 
  19. /** translators: accessibility text */ 
  20. _e( 'Starred messages', 'buddypress' ); 
  21. ?></h2> 
  22.  
  23. <div class="pagination no-ajax" id="user-pag"> 
  24.  
  25. <div class="pag-count" id="messages-dir-count"> 
  26. <?php bp_messages_pagination_count(); ?> 
  27. </div> 
  28.  
  29. <div class="pagination-links" id="messages-dir-pag"> 
  30. <?php bp_messages_pagination(); ?> 
  31. </div> 
  32.  
  33. </div><!-- .pagination --> 
  34.  
  35. <?php 
  36.  
  37. /** 
  38. * Fires after the members messages pagination display. 
  39. * 
  40. * @since 1.2.0 
  41. */ 
  42. do_action( 'bp_after_member_messages_pagination' ); ?> 
  43.  
  44. <?php 
  45.  
  46. /** 
  47. * Fires before the members messages threads. 
  48. * 
  49. * @since 1.2.0 
  50. */ 
  51. do_action( 'bp_before_member_messages_threads' ); ?> 
  52.  
  53. <form action="<?php echo bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ?>/bulk-manage/" method="post" id="messages-bulk-management"> 
  54.  
  55. <table id="message-threads" class="messages-notices"> 
  56.  
  57. <thead> 
  58. <tr> 
  59. <th scope="col" class="thread-checkbox bulk-select-all"><input id="select-all-messages" type="checkbox"><label class="bp-screen-reader-text" for="select-all-messages"><?php 
  60. /** translators: accessibility text */ 
  61. _e( 'Select all', 'buddypress' ); 
  62. ?></label></th> 
  63. <th scope="col" class="thread-from"><?php _e( 'From', 'buddypress' ); ?></th> 
  64. <th scope="col" class="thread-info"><?php _e( 'Subject', 'buddypress' ); ?></th> 
  65.  
  66. <?php 
  67.  
  68. /** 
  69. * Fires inside the messages box table header to add a new column. 
  70. * 
  71. * This is to primarily add a <th> cell to the messages box table header. Use 
  72. * the related 'bp_messages_inbox_list_item' hook to add a <td> cell. 
  73. * 
  74. * @since 2.3.0 
  75. */ 
  76. do_action( 'bp_messages_inbox_list_header' ); ?> 
  77.  
  78. <?php if ( bp_is_active( 'messages', 'star' ) ) : ?> 
  79. <th scope="col" class="thread-star"><span class="message-action-star"><span class="icon"></span> <span class="screen-reader-text"><?php 
  80. /** translators: accessibility text */ 
  81. _e( 'Star', 'buddypress' ); 
  82. ?></span></span></th> 
  83. <?php endif; ?> 
  84.  
  85. <th scope="col" class="thread-options"><?php _e( 'Actions', 'buddypress' ); ?></th> 
  86. </tr> 
  87. </thead> 
  88.  
  89. <tbody> 
  90.  
  91. <?php while ( bp_message_threads() ) : bp_message_thread(); ?> 
  92.  
  93. <tr id="m-<?php bp_message_thread_id(); ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread<?php else: ?> read<?php endif; ?>"> 
  94. <td class="bulk-select-check"> 
  95. <label for="bp-message-thread-<?php bp_message_thread_id(); ?>"><input type="checkbox" name="message_ids[]" id="bp-message-thread-<?php bp_message_thread_id(); ?>" class="message-check" value="<?php bp_message_thread_id(); ?>" /><span class="bp-screen-reader-text"><?php 
  96. /** translators: accessibility text */ 
  97. _e( 'Select this message', 'buddypress' ); 
  98. ?></span></label> 
  99. </td> 
  100.  
  101. <?php if ( 'sentbox' != bp_current_action() ) : ?> 
  102. <td class="thread-from"> 
  103. <?php bp_message_thread_avatar( array( 'width' => 25, 'height' => 25 ) ); ?> 
  104. <span class="from"><?php _e( 'From:', 'buddypress' ); ?></span> <?php bp_message_thread_from(); ?> 
  105. <?php bp_message_thread_total_and_unread_count(); ?> 
  106. <span class="activity"><?php bp_message_thread_last_post_date(); ?></span> 
  107. </td> 
  108. <?php else: ?> 
  109. <td class="thread-from"> 
  110. <?php bp_message_thread_avatar( array( 'width' => 25, 'height' => 25 ) ); ?> 
  111. <span class="to"><?php _e( 'To:', 'buddypress' ); ?></span> <?php bp_message_thread_to(); ?> 
  112. <?php bp_message_thread_total_and_unread_count(); ?> 
  113. <span class="activity"><?php bp_message_thread_last_post_date(); ?></span> 
  114. </td> 
  115. <?php endif; ?> 
  116.  
  117. <td class="thread-info"> 
  118. <p><a href="<?php bp_message_thread_view_link(); ?>" title="<?php esc_attr_e( "View Message", 'buddypress' ); ?>"><?php bp_message_thread_subject(); ?></a></p> 
  119. <p class="thread-excerpt"><?php bp_message_thread_excerpt(); ?></p> 
  120. </td> 
  121.  
  122. <?php 
  123.  
  124. /** 
  125. * Fires inside the messages box table row to add a new column. 
  126. * 
  127. * This is to primarily add a <td> cell to the message box table. Use the 
  128. * related 'bp_messages_inbox_list_header' hook to add a <th> header cell. 
  129. * 
  130. * @since 1.1.0 
  131. */ 
  132. do_action( 'bp_messages_inbox_list_item' ); ?> 
  133.  
  134. <?php if ( bp_is_active( 'messages', 'star' ) ) : ?> 
  135. <td class="thread-star"> 
  136. <?php bp_the_message_star_action_link( array( 'thread_id' => bp_get_message_thread_id() ) ); ?> 
  137. </td> 
  138. <?php endif; ?> 
  139.  
  140. <td class="thread-options"> 
  141. <?php if ( bp_message_thread_has_unread() ) : ?> 
  142. <a class="read" href="<?php bp_the_message_thread_mark_read_url();?>"><?php _e( 'Read', 'buddypress' ); ?></a> 
  143. <?php else : ?> 
  144. <a class="unread" href="<?php bp_the_message_thread_mark_unread_url();?>"><?php _e( 'Unread', 'buddypress' ); ?></a> 
  145. <?php endif; ?> 
  146. <a class="delete" href="<?php bp_message_thread_delete_link(); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> 
  147.  
  148. <?php 
  149.  
  150. /** 
  151. * Fires after the thread options links for each message in the messages loop list. 
  152. * 
  153. * @since 2.5.0 
  154. */ 
  155. do_action( 'bp_messages_thread_options' ); ?> 
  156. </td> 
  157. </tr> 
  158.  
  159. <?php endwhile; ?> 
  160.  
  161. </tbody> 
  162.  
  163. </table><!-- #message-threads --> 
  164.  
  165. <div class="messages-options-nav"> 
  166. <?php bp_messages_bulk_management_dropdown(); ?> 
  167. </div><!-- .messages-options-nav --> 
  168.  
  169. <?php wp_nonce_field( 'messages_bulk_nonce', 'messages_bulk_nonce' ); ?> 
  170. </form> 
  171.  
  172. <?php 
  173.  
  174. /** 
  175. * Fires after the members messages threads. 
  176. * 
  177. * @since 1.2.0 
  178. */ 
  179. do_action( 'bp_after_member_messages_threads' ); ?> 
  180.  
  181. <?php 
  182.  
  183. /** 
  184. * Fires and displays member messages options. 
  185. * 
  186. * @since 1.2.0 
  187. */ 
  188. do_action( 'bp_after_member_messages_options' ); ?> 
  189.  
  190. <?php else: ?> 
  191.  
  192. <div id="message" class="info"> 
  193. <p><?php _e( 'Sorry, no messages were found.', 'buddypress' ); ?></p> 
  194. </div> 
  195.  
  196. <?php endif;?> 
  197.  
  198. <?php 
  199.  
  200. /** 
  201. * Fires after the members messages loop. 
  202. * 
  203. * @since 1.2.0 
  204. */ 
  205. do_action( 'bp_after_member_messages_loop' ); ?> 
.