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

JavaScript onSubmit causes troubles with my_modele_submit() function

Hi,

I'm new to Drupal and I am developing my first module. In the module I've created a admin form witch is validated by JavaScript. But doing a validation by an 'onSubmit' causes the regular my_modele_submit() function not to work at all. Can anybody tell me how to solve this?

Hacking User Module to check date-expires on login....

I am creating subscription based site using drupal 5.0. The administrator registers each user and grants them access to the site for a period of time (1 year).

I modified the user module by adding a date-expires column to users table. I have made the appropriate changes to admin create/edit forms so the data is stored in the db.

I modified function user_load to check date-expires, if date expires < system date, the date is valid, if not the $user = False. It works correctly.

Javascript and drupal

Hello,

I have a problem, I developed a my module and I have inserted it in
drupal system. Inside of drupal module I would like to insert
the Javascript code in order to open an external file like a popup.

help me, how to make?

thanks
ro

How do to this in a module...

This is probably so simple, that I've looked right past it...

On one of the sites that I run, I want the ability to force my users to look (and agree to) a set of policies.

The part that handles the agreements is working OK - there's a button at the bottom of the node view that says "I agree"... this in turn is reflected in the user's account page, showing what agreements they've agreed to, and which ones they have not.

Overriding core's User module menu behaviour

Hello everybody.
I am kinda new to Drupal, so I appologize in advance if my question seems stupid, but I have not found any other post which helped, nor succeeded in solving this problem myself by hacking the core module.

The thing is I am developing a new where I need to change the way the User module displays it's data. I am using the hook_form_alter() and hook_user() hooks to catch the events I need and change the way forms are displayed (i.e add/remove fields to them), but I also need to change the menu hierarchy...!

I want to change the menus so that the View tab (local task) would not appear, since I have no need for it, and to add other tabs which I do need.

I looked for a hook_menu_alter(), but there is no such function. The closest I found was hook_link_alter() but that didn't solve my problem. Thinking about it, I decided to create such a hook, and added the following code to the user.module file just before thereturn $items; at end of the user_menu() hook function:

// allow altering the module's menus
foreach (module_implements('menu_alter') as $module) {
  $function = $module .'_menu_alter';
  $function( 'user', $items );
}

Then, I created the following function in my code to try changing the menu:
<?php
/**
* Catch User's menus and alter them.

Beyond node_example module

So, im interested in creating my own custom module for drupal for my intranet based needs. So far i have followed the node_example module tutorial in the HEAD documentation and was very happy to see that everything worked fine. Another good source (if not a little outdated for drupal 5) is http://www-128.ibm.com/developerworks/ibm/osource/index.html - Written by employee's of IBM, this is a great tutorial that explains some more advanced module / theme ect development for drupal. With these tutorials and the drupal API documentation you would think it is going to be pretty smooth sailing but alas this is not the case.

I have been browsing the web looking for some kind of comprehensive tutorials on module devlopment but not had much joy. Ive seen all the great modules developed by the drupal community and i cant help but wonder, where did they go after completing the node_example tutorial? how did they get to the stage of creating such powerful modules? where did they get their information?

Im a pretty confident with PHP and MYSQL so writing custom code for my own, non-drupal applications is pretty straight forward but when it comes to writing modules for drupal i cant seem to create basic functions for my custom module =/

Pages

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