Could be useful an "Add new image in this gallery" link in any gallery like in official forum module.
I've added this:
/* we are arround row 168 in image_gallery.module ad in v 1.4 release */
.....
menu_set_location($breadcrumb);
$content .= '<ul>';
/* ADDED TO HAVE LINK TO ADD */
if (user_access('create images')) {
$content .= '<li>'. l(t('Add new image.'), "node/add/image/") .'</li>';
}
else if ($user->uid) {
$content .= '<li>'. t('You are not allowed to post a new image.') .'</li>';
}
else {
$content .= '<li>'. t('<a href="@login">Login</a> to post a new image.', array('@login' => url('user/login', drupal_get_destination()))) .'</li>';
}
$content .= '</ul>';
/* END */
$content .= theme('image_gallery', $galleries, $images); /* notice the .= */
....
This show "add new image" if user can add new image, login if anonymous and can't, or "you can't" if user logged but can't. This link point to a generic "add image node" page. I'd prefer a link witch select the exact gallery (discovered from the link).
To do this we can use:
$content .= '<li>'. l(t('Add new image.'), "node/add/image/$tid") .'</li>';
adding $tid to the url, but i can't make image.module recognize that information like forum do instead.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | unarchive_f2.png | 1.49 KB | budhan |
Comments
Comment #1
budhan commentedComment #2
nancydruIs this in the right the right queue? I don't see how this is for Helpers.
Comment #3
nancydruNo response.