If you have no galleries added, the output of the media gallery module is a text and a link to add a new gallery.
It would be nice to see no link, if the current user do not have access to it.
File: media_gallery.pages.inc
Line: 66-70
$build['no_content'] = array(
'#prefix' => '<p>',
'#markup' => t('No galleries have been set up yet. <a href="@link">Add a gallery.</a>', array('@link' => url('node/add/media-gallery'))),
'#suffix' => '</p>',
);
A possible solution may be the following replacement code:
$no_content_text_arg = array();
$no_content_text = 'No galleries have been set up yet.';
if( node_access('create', 'media-gallery') ) {
$no_content_text .= ' <a href="@link">Add a gallery.</a>';
$no_content_text_arg['@link'] = url('node/add/media-gallery');
}
$build['no_content'] = array(
'#prefix' => '<p>',
'#markup' => t($no_content_text, $no_content_text_arg),
'#suffix' => '</p>',
);
Comments
Comment #1
awasson commentedSubscribing... I have the exact same need.
I think it would be helpful to be able to customize the message with the option to include a link to create a gallery depending on the need of the end user.
Other than that, I sure do like this module!
Comment #2
moloc commentedThis patch removes the Add a gallery link, if the current user has no permission to create a gallery.
Comment #3
lsolesen commentedawasson. could you review
Comment #4
lsolesen commented