/bp-templates/bp-legacy/buddypress/activity/post-form.php

  1. <?php 
  2. /** 
  3. * BuddyPress - Activity Post Form 
  4. * 
  5. * @package BuddyPress 
  6. * @subpackage bp-legacy 
  7. */ 
  8.  
  9. ?> 
  10.  
  11. <form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form"> 
  12.  
  13. <?php 
  14.  
  15. /** 
  16. * Fires before the activity post form. 
  17. * 
  18. * @since 1.2.0 
  19. */ 
  20. do_action( 'bp_before_activity_post_form' ); ?> 
  21.  
  22. <div id="whats-new-avatar"> 
  23. <a href="<?php echo bp_loggedin_user_domain(); ?>"> 
  24. <?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?> 
  25. </a> 
  26. </div> 
  27.  
  28. <p class="activity-greeting"><?php if ( bp_is_group() ) 
  29. printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) ); 
  30. else 
  31. printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) ); 
  32. ?></p> 
  33.  
  34. <div id="whats-new-content"> 
  35. <div id="whats-new-textarea"> 
  36. <label for="whats-new" class="bp-screen-reader-text"><?php 
  37. /** translators: accessibility text */ 
  38. _e( 'Post what\'s new', 'buddypress' ); 
  39. ?></label> 
  40. <textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10" 
  41. <?php if ( bp_is_group() ) : ?>data-suggestions-group-id="<?php echo esc_attr( (int) bp_get_current_group_id() ); ?>" <?php endif; ?> 
  42. ><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea> 
  43. </div> 
  44.  
  45. <div id="whats-new-options"> 
  46. <div id="whats-new-submit"> 
  47. <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" /> 
  48. </div> 
  49.  
  50. <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?> 
  51.  
  52. <div id="whats-new-post-in-box"> 
  53.  
  54. <?php _e( 'Post in', 'buddypress' ); ?>: 
  55.  
  56. <label for="whats-new-post-in" class="bp-screen-reader-text"><?php 
  57. /** translators: accessibility text */ 
  58. _e( 'Post in', 'buddypress' ); 
  59. ?></label> 
  60. <select id="whats-new-post-in" name="whats-new-post-in"> 
  61. <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option> 
  62.  
  63. <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0&update_meta_cache=0' ) ) : 
  64. while ( bp_groups() ) : bp_the_group(); ?> 
  65.  
  66. <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option> 
  67.  
  68. <?php endwhile; 
  69. endif; ?> 
  70.  
  71. </select> 
  72. </div> 
  73. <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> 
  74.  
  75. <?php elseif ( bp_is_group_activity() ) : ?> 
  76.  
  77. <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> 
  78. <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" /> 
  79.  
  80. <?php endif; ?> 
  81.  
  82. <?php 
  83.  
  84. /** 
  85. * Fires at the end of the activity post form markup. 
  86. * 
  87. * @since 1.2.0 
  88. */ 
  89. do_action( 'bp_activity_post_form_options' ); ?> 
  90.  
  91. </div><!-- #whats-new-options --> 
  92. </div><!-- #whats-new-content --> 
  93.  
  94. <?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?> 
  95. <?php 
  96.  
  97. /** 
  98. * Fires after the activity post form. 
  99. * 
  100. * @since 1.2.0 
  101. */ 
  102. do_action( 'bp_after_activity_post_form' ); ?> 
  103.  
  104. </form><!-- #whats-new-form --> 
.