Add a new image link (image_gallery.module)
comick - August 4, 2007 - 10:33
| Project: | Helpers |
| Version: | HEAD |
| Component: | Documentation |
| Category: | task |
| Priority: | minor |
| Assigned: | budhan |
| Status: | won't fix |
Description
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.

#1
#2
Is this in the right the right queue? I don't see how this is for Helpers.
#3
No response.