Avatar_Suggestions_Group

BP Avatar Suggestions group class.

Defined (1)

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

/includes/bp-avatar-suggestions-groups.php  
  1. class Avatar_Suggestions_Group extends BP_Group_Extension { 
  2.  
  3. public $screen = null; 
  4.  
  5. /** 
  6. * Constructor 
  7. * @package BP Avatar Suggestions 
  8. * @subpackage Groups 
  9. * @since 1.2.0 
  10. */ 
  11. public function __construct() { 
  12. /** 
  13. * Init the Group Extension vars 
  14. */ 
  15. $this->init_vars(); 
  16.  
  17. /** Group extension methods ***************************************************/ 
  18.  
  19. /** 
  20. * Registers the BP Avatar Suggestions extension 
  21. * @package BP Avatar Suggestions 
  22. * @subpackage Groups 
  23. * @since 1.2.0 
  24. */ 
  25. public function init_vars() { 
  26. $args = array( 
  27. 'slug' => 'avatar-suggestions',  
  28. 'name' => __( 'Photo', 'bp-avatar-suggestions' ),  
  29. 'visibility' => 'private',  
  30. 'enable_nav_item' => false,  
  31. 'screens' => array( 
  32. 'admin' => array( 
  33. 'enabled' => false,  
  34. ),  
  35. 'create' => array( 
  36. 'position' => 20,  
  37. 'enabled' => true,  
  38. ),  
  39. 'edit' => array( 
  40. 'position' => 20,  
  41. 'enabled' => true,  
  42. 'show_in_admin_bar' => true,  
  43. ),  
  44. ); 
  45.  
  46. parent::init( $args ); 
  47.  
  48. /** 
  49. * The create screen method 
  50. * @package BP Avatar Suggestions 
  51. * @subpackage Groups 
  52. * @since 1.2.0 
  53. */ 
  54. public function create_screen( $group_id = null ) { 
  55. ?> 
  56. <div class="left-menu"> 
  57.  
  58. <?php bp_new_group_avatar(); ?> 
  59.  
  60. </div><!-- .left-menu --> 
  61.  
  62. <div class="main-column"> 
  63.  
  64. <?php do_action( 'bp_after_group_avatar_creation_step' ); ?> 
  65.  
  66. </div><!-- .main-column --> 
  67. <?php 
  68.  
  69. /** 
  70. * The create screen save method 
  71. * Nothing to save all is done thanks to AJAX 
  72. * @package BP Avatar Suggestions 
  73. * @subpackage Groups 
  74. * @since 1.2.0 
  75. */ 
  76. public function create_screen_save( $group_id = null ) {} 
  77.  
  78. /** 
  79. * Group extension settings form 
  80. * BuddyPress is already adding the needed hook 
  81. * to load the suggestions editor, so no need to 
  82. * output anything. 
  83. * @package BP Avatar Suggestions 
  84. * @subpackage Groups 
  85. * @since 1.2.0 
  86. */ 
  87. public function edit_screen( $group_id = null ) {} 
  88.  
  89. /** 
  90. * We do not need any button on the edit screen 
  91. * @package BP Avatar Suggestions 
  92. * @subpackage Groups 
  93. * @since 1.2.0 
  94. * @return boolean false 
  95. */ 
  96. public static function has_submit_button( $screen = '' ) { 
  97. return true; 
  98.  
  99. /** 
  100. * Save the settings for the current the group 
  101. * Nothing to save all is done thanks to AJAX 
  102. * @package BP Avatar Suggestions 
  103. * @subpackage Groups 
  104. * @since 1.2.0 
  105. */ 
  106. public function edit_screen_save( $group_id = null ) {} 
  107.  
  108. /** 
  109. * Adds a Meta Box in Group's Administration screen 
  110. * Nothing to output 
  111. * @package BP Avatar Suggestions 
  112. * @subpackage Groups 
  113. * @since 1.2.0 
  114. */ 
  115. public function admin_screen( $group_id = null ) {} 
  116.  
  117. /** 
  118. * Saves the group settings (set in the Meta Box of the Group's Administration screen) 
  119. * Nothing to save 
  120. * @package BP Avatar Suggestions 
  121. * @subpackage Groups 
  122. * @since 1.2.0 
  123. */ 
  124. public function admin_screen_save( $group_id = null ) {} 
  125.  
  126. /** 
  127. * Nothing to display 
  128. * @package BP Avatar Suggestions 
  129. * @subpackage Groups 
  130. * @since 1.2.0 
  131. */ 
  132. public function display( $group_id = null ) {} 
  133.  
  134. /** 
  135. * We do not use group widgets 
  136. * @package BP Avatar Suggestions 
  137. * @subpackage Groups 
  138. * @since 1.2.0 
  139. * @return boolean false 
  140. */ 
  141. public function widget_display() {} 
  142.  
  143. /** 
  144. * Show group avatars if suggestions are enabled 
  145. * @package BP Avatar Suggestions 
  146. * @subpackage Groups 
  147. * @since 1.3.0 
  148. * @return boolean false to enable avatars true otherwise 
  149. */ 
  150. public static function display_avatars( $disable = false ) { 
  151. if ( true === (bool) $disable ) { 
  152. $disable = ! buddypress()->extend->avatar_suggestions->enable_groups; 
  153.  
  154. return $disable;