This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

JS added to headers twice on user form

Morning!

Here's today's weirdness.

I'm writing a module that extends the user form. Within the form is a line:

  drupal_add_js($js,'inline');

So, in a normal, standard, regular form, this works fine. It's absolutely perfect, and the script I've included in $js is added once, and it works. However, when I extend the user form and try to do the same thing, it's added twice.

JSCalendar multiple date troubles

Hi all,

i'm trying to incorporate the JSCalendar into my module, which works fine btw.

But now i'm having trouble implementing the setting for 'multiple' dates per calendar.

Can anyone show me where and how to do it ?

I figured it should be in this part somewhere, but i could very well be wrong:

multiple registration

i want 2 make module that when new user register in drupal so on another spot register to.
i use hook_user $op=='insert' for hook to new register user.

but i hav a problem for knowing the password variable for my second registration.
how can i get the passwordl??

if i use $account->password then the password was encrypt.

any solution or example for multiple registration???

Doing validation before a delete

I have a node which provides a 'lookup' for another type of node.

I want to validate when the administrator tries to delete that node if it has been used as a lookup. I have no problem with the routine for this but where to put it.

The only $op's used in the nodeapi used are load and delete. If I put it in delete how do I cancel the delete when I need to.

best wishes Ed.

Creating variables (like !site in core's User Settings) in 'global' scope - which hook?

I posted a question to this effect before (http://drupal.org/node/163390), but didn't get a response; I've since learned more, and I'm hoping that my being more specific might yield an answer this time around. I'm trying to figure out how to set up variables that are:

  1. Similar in nature to those that are configured within the Site Information (by default, www.example.com/admin/settings/site+information) - e.g., things like an acronym for the website, a noun that describes users of the website (on drupal.org, such a word might be 'Drupalers'), and other things), etc.
  2. Similar in utility to those variables that are available for use in places like Organic Groups email configuration, or in the built-in User Settings admin section (by default, www.example.com/user/settings). That is, using only a simple syntax like !site, the variables are available for use in forms handling configuration and settings.

How to intercept the "submit" action?

Hi there,

I am coding a module that needs to perform some operations when a node is submitted, but before the content is saved in the database.
Right now, in hook_nodeapi, I can add some code *after* an insert or update, but how do I perform some action before?

For information, I am adding a "Save as draft" button on the node form. What I want to do is check when that button is pressed, and then perform some action. (I will save the node content in a separate table, and don't want it to be saved as it normally is)

Thanks for you help!

Hubert.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions