Re: [development] hook_node_*()

2011-02-05 Thread Eric Schaefer
Hi, OK. There are access checks that prevent that user with the right privilege will see or can edit schedulers values. There were also checks in hook_nodeapi (except for $op=='load') when I inherited the module. I always wondered if they were necessary. I guess not. Thanks, Eric

[development] How can I make Drupal DOM elements accessible within a javascript function without having to do an ajax request to a page?

2011-02-05 Thread John Mitchell
I have a javascript timer set to fire every 2.5 seconds so that I can set the current values for the items and total for the shopping cart summary. I would like to be able to get these values from client side cookies or javascript global variables so that I don't have to make an ajax call to the s

[development] How can I tell from the returned value (i.e. drupal_add_js('shoppingCartInfo()', 'inline')) whether this javascript has been successful called so that I can stop the call to this javascr

2011-02-05 Thread John Mitchell
I am using the hook_cart_item in order to perform some javascript after an item has been added to the shopping cart. It appears to be called multiple times for just one "add to cart" click (i.e. if have 1 item in the shopping cart then hook is called 5 times and 2 items it is called 10 times) and

Re: [development] hook_node_*()

2011-02-05 Thread nan wich
Scheduler uses a hook_form_alter to add the scheduling dates to the node form. That's where the access check belongs. In that function, either create the fields (authorized) or not (not authorized) to the form. Then scheduler_node_update can check the presence of the field. BTW, it should proba

[development] Processing an image when a node is saved (D7)

2011-02-05 Thread Steve Yelvington
I have a content type with an image field. I want to pull some metadata from the image file when the node is created or updated. I thought this would be pretty straightforward, but I'm baffled by some things that are going on in D7. I thought I'd implement hook_node_presave(). Apparently the

Re: [development] Processing an image when a node is saved (D7)

2011-02-05 Thread Steve Yelvington
Sorry, T-bird fired before ready. As I was saying: Krumo shows: * filename(/String,*12 characters*/)*P138.JPG* * uri(/String,*33 characters*/)*public://field/image/P138.JPG* ... but I really need this to work when the node is being created OR updated. What hook should I

Re: [development] hook_node_*()

2011-02-05 Thread Pierre Rineau
On Sat, 2011-02-05 at 20:31 +0100, Eric Schaefer wrote: > Hi List, > > I was just wondering. Now that there are separate hooks for the node > API, is it necessary to check for permissions in every hook? E.g. The > scheduler module has a permission for scheduling nodes. Do I need to > check for tha

Re: [development] hook_node_*()

2011-02-05 Thread Ken Rickard
Technically, yes. But I would urge you not to check user_access() during such an operation. Doing so can break automated calls to node hooks. See Dave Cohen's bug report last week regarding comment form submission. It's related. Better to set a conditional form value to pass to your operation

[development] hook_node_*()

2011-02-05 Thread Eric Schaefer
Hi List, I was just wondering. Now that there are separate hooks for the node API, is it necessary to check for permissions in every hook? E.g. The scheduler module has a permission for scheduling nodes. Do I need to check for that permission in lets say scheduler_node_update()? Regards, Eric

[development] Theming views output in Drupal 7

2011-02-05 Thread Balazs Dianiska
Hi, I have tried to use the old Drupal 6 approach to theme views output, such as rows and fields, that is creating the suggested template file in my theme and adding the appropriate THEME_preprocess function to template.php. In Drupal 7 this doesn't seem to work. Although my template file is picke