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

Set default menu item

I working on module which extend user.module for three new user types (standart user, contributor and bookseller).

I want override or redirect user (or admin) which call standard path user/register (or admin/user/create) to my new default path - from user/register to user/register/1 (or for admin from admin/user/create to admin/user/create/1).

I experimenting with hook_menu() but i have no luck. How can i do this? Thank you very much for advice.

My actual hook_user:

/**
 * Implementation of hook_user().
 */
function enigma_profily_user($op, &$edit, &$account, $category = NULL) {
  global $user;

  switch ($op)
  {
    case 'register':
      return enigma_profily_form_type($edit, $user, $category);
      break;
    case 'form':
      return enigma_profily_form_type($edit, $user, $category);
      break;
    case 'categories':
      return enigma_profily_categories($account);
      break;
  }
}

and function enigma_profily_form_type() which extend default forms with my fields

<?php
/**
* hook_user callback; create aditional form fields for register user, admin user create
*/
function enigma_profily_form_type($edit, $user, $category) {
// path user/register/[profile_type]
if (arg(0) == 'user' && arg(1) == 'register' && is_numeric(arg(2))) {
$profile_type = arg(2);
}
// path admin/user/create/[profile_type]
else if (arg(0) == 'admin' && arg(1) == 'user' && arg(2) == 'create' && is_numeric(arg(3))) {

Asset Manager

My department is sponsoring my time to develop an Asset Manager plugin for Drupal this summer. I plan to integrate issue tracking and license management, possibly using existing modules for some functionality.

I've seen interest in the forums for such a system. Is anyone interested in working with me to develop it?

ereg_replace

Hi there.
I am trying to build a filter-module that enables you to collapse any part of your content.
Now my problem ist the following:
I want to replace all occurrence of my collapse tag with a corresponding div tag so it can be found by my javascript script.
my tags looks like this:
[collapsible] [/collapsible]
[collapsible onmouseover] [/collapsible]
[collapsible collapsed] [/collapsible]
[collapsible title="test"] [/collapsible]
or any combination of this. Like:
[collapsible onmouseover title="test"] [/collapsible]

Custom node links to non drupal page

Hi,

I am trying to create a new node type (1st time I have done this) by following the node_example.module. I have been able to have the node created and placed in the database. When the page reloads after I hit submit it goes to a blank page that just has the node title and the node_example_view information. If I click on the title then it displays just the node_example_view. Any ideas on what is going on? Am I not formatting properly.

HTTPPost + Firefox - ?

Hi all,
can anybody help me?

I make some requests using HTTPPost. All right - all is working in IE,FireFox,Mozilla.
But some of my requests go after I close a child window (it was opened by window.open :)) ) - and here my Firefox doesn`t want to work properly - this request failes. Under IE all is good.
Does anybody know the reason of such Firefox trouble?

Thanks...

Group users using taxonomy?

I can assign terms to my nodes. Can I assign terms to my users? Are there any standart approaches? I don't want to develop a new module with a copy-paste from taxonomy functionality. Maybe some port is implemented already. Give me a hint, please.

Pages

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