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

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 =/

is it possible to call the function within the form in the module?

am new to drupal,plz anybody solve my prob,i need to display some textfield,button,fieldset.....as the formated output what i need,but in drupal5 we have to pass everything as a form.how can i design the form using table,and how can i pass through the form ,for my new page in my module.

Relative to absolute paths

I've just written a simple input filter module called "absolute_urls.module" that translates relative paths into absolute paths within URLs, e.g., "node/1234" becomes "http://mysite.com/node/1234". I think it will be useful for two reasons:

(1) Our site is currently running Drupal 4.6, and we want to be able to repurpose some node content into an HTML-formatted email in a situation where using the BASE HREF tag is impractical.

Creating CCK content types programmatically?

I'm working on a module that will depend on a couple of content types created by CCK. I can create the nodes programmatically and save or update them, but I was thinking about the module installation process. I was hoping I could create the content type at module installation and not force the administrtor to do it. Seeing what the cck import/export module was doing I tried this:

Pages

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