I have hidden the “Choose gallery” select option and set it to the current user’s own, single gallery by hacking wp-content/plugins/nextgen-gallery/admin/addgallery.php. It would be better to do it without a hack but I don’t know how!
The idea is to serve a hidden field to Contributors with their gallery id drawn from the database as the value:
if (!current_user_can('publish_posts') ) {
global $current_user, $wpdb;
get_currentuserinfo();
$user_gallery = $wpdb->get_var( $wpdb->prepare( "SELECT gid FROM wp_ngg_gallery WHERE name = %s", $current_user->user_login ) ); ?>
<input name="galleryselect" id="galleryselect" type="hidden" value="<?php echo $user_gallery; ?>" />
… then Authors and above get the standard code – a select menu in a table row…
<?php } else { ?>
<tr valign="top">
<th scope="row"><?php _e('in to', 'nggallery') ;?></th>
<td><select name="galleryselect" id="galleryselect">
<option value="0" ><?php _e('Choose gallery', 'nggallery') ?></option>
<?php
foreach($this->gallerylist as $gallery) {
//special case : we check if a user has this cap, then we override the second cap check
if ( !current_user_can( 'NextGEN Upload in all galleries' ) )
if ( !nggAdmin::can_manage_this_gallery($gallery->author) )
continue;
$name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
echo '<option value="' . $gallery->gid . '" >' . $gallery->gid . ' - ' . esc_attr( $name ) . '</option>' . "\n";
} ?>
</select>
<br /><?php echo $this->maxsize; ?>
<br /><?php if ((is_multisite()) && wpmu_enable_function('wpmuQuotaCheck')) display_space_usage(); ?></td>
</tr>
<?php }
I have done a similar thing to the ‘Scale images to max width…” checkbox in order to reduce the number of choices for my Contributors.