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

budhan - July 17, 2008 - 14:27
Project:Image» Helpers
Version:5.x-1.4» HEAD
Component:image_gallery» Documentation
Category:feature request» task
Priority:normal» minor
Assigned to:Anonymous» budhan
AttachmentSize
unarchive_f2.png 1.49 KB

#2

NancyDru - August 15, 2008 - 13:23
Status:active» postponed (maintainer needs more info)

Is this in the right the right queue? I don't see how this is for Helpers.

#3

NancyDru - August 28, 2008 - 15:47
Status:postponed (maintainer needs more info)» won't fix

No response.

 
 

Drupal is a registered trademark of Dries Buytaert.