Changeset 512333
- Timestamp:
- 02/29/2012 01:24:13 PM (14 years ago)
- Location:
- buddypress-courseware/trunk
- Files:
-
- 2 edited
-
groups/groups.class.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
buddypress-courseware/trunk/groups/groups.class.php
r498795 r512333 31 31 add_action( 'groups_admin_tabs', array( &$this, 'group_admin_tab' ), 10, 2 ); 32 32 add_action( 'wp', array( &$this, 'group_admin_screen' ), 4 ); 33 add_filter( 'media_upload_form_url', array( __CLASS__, ' bpsp_media_library_tab' ) );33 add_filter( 'media_upload_form_url', array( __CLASS__, 'media_library_tab' ) ); 34 34 } 35 35 … … 304 304 * and will add to the current query currently logged in author ID 305 305 */ 306 function bpsp_restrict_uploads( $wp_the_query ) {306 function restrict_uploads( $wp_the_query ) { 307 307 // Check if current user is admin or sort of 308 308 if ( !current_user_can( 'manage_options' ) ) … … 313 313 /** 314 314 * Media library displays all the uploads, 315 * bpsp_media_library_tab() will do some checks and try to hide315 * media_library_tab() will do some checks and try to hide 316 316 * attachments that are not owned by current user 317 317 */ 318 function bpsp_media_library_tab( $action_url ) { 319 // Try to catch Courseware uploads page 320 if ( isset( $_REQUEST['bpsp-upload'] ) && isset( $_REQUEST['tab'] ) ) 321 // Check if the user is on the current tab 322 if ( $_REQUEST['tab'] == 'library' ) 323 // Do some checks before displaying attachments 324 add_action( 'pre_get_posts', array( __CLASS__, 'bpsp_restrict_uploads' ) ); 318 function media_library_tab( $action_url ) { 319 // Check if private uploads are disabled 320 if ( defined( 'COURSEWARE_PRIVATE_UPLOADS' ) && !COURSEWARE_PRIVATE_UPLOADS ) 321 return; 322 323 // Check if the user is on the current tab 324 if ( $_REQUEST['tab'] == 'library' ) 325 // Do some checks before displaying attachments 326 add_action( 'pre_get_posts', array( __CLASS__, 'restrict_uploads' ) ); 325 327 326 328 return $action_url; -
buddypress-courseware/trunk/readme.txt
r511842 r512333 65 65 66 66 == Changelog == 67 68 = 0.9.6 = 69 67 70 68 71 = 0.9.5 =
Note: See TracChangeset
for help on using the changeset viewer.