imagepicker module enhancement

mraj_28 - August 16, 2009 - 20:22

Hi,

Imagepicker is a very good module using which we can insert images into the nodes. But the only thing is, it does not show the images associated with a node at one particular place. It shows all the images in the "Browse" tab. The problem here is in future if we edit the nodes, it is very difficult to find out the images from the thumbnails that are associated with that particular node.

I am trying to enhance this by providing another tab called "Current" which shows the images associated with the current node. I am doing it the following way.

1) a new column "nid" is added to the imagepicker table.
2) a new tab "current" is added to the imagepicker frame.
3) when we upload an image, the image id and name are captured in a session.(this is an array)
4) when we click on save node, the node id is updated for all the images in the imagepicker table for the newly added "nid" column.
5) when the node is edited the the image ids and names are read from the table and the session is generated again.

But the problem I am facing is, when we click on "save" button. I am using "hook_nodeapi" function and case "insert". Under that if the session is set, I am trying to read the image ids from the session, but it looks like the session is not working there. It is working everywhere else but only in hook_nodeapi it is not working. Do you have any idea about sessions not working in hook_nodeapi?

Thank you.

 
 

Drupal is a registered trademark of Dries Buytaert.