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

menu question

Hi,

I'm having trouble trying to figure out how to set up the menu for my custom module. What I'm doing is basically a contact directory with the info coming from our department ldap server. What I want it to do, menu wise, is have two distinct types of pages. First is a listing page, for the paths:

/people - lists a welcome page
/people/all - lists everyone
/people/faculty - lists only faculty
/people/staff - lists staff
/people/ta - lists grads/ta

No problems here, this all works fine, the above are all local tasks to appear as tabs. The problem is that I also want to do the following paths:

/people/uid/view - views information for the user with given uid
/people/uid/edit - edit information for the user with given uid

I want these to be tabs as well. The problem I'm running into here is that when I do this, the view & edit tabs show up on the other list pages, and it seems the actions for view/edit don't actually get called because the menu system doesn't seem to match the action anyway.

Here is my trial menu code...

<?php
$items[] = array(
'path' => 'people',
'callback' => 'contact_list',
'title' => 'People',
'access' => user_access('view people'),
);
$items[] = array(
'path' => 'people/' . arg(1) . '/view',
'callback' => 'person_display',
'access' => user_access('view people'),

Mail problems with activeMailLib

I tried the two modules

- mail
- simplenews (latest 4.6-Branch)

which both use activeMailLib for delivering mails. Unfortunately both dont work for me, whereas the standard drupal mail delivery works flawlessly. Does anybody made the same experience? Until now I couldnt find the reason in my log files ... :/

Btw. Im wondering why both modules dont use the drupal API for delivering mails ... Does anybody know why? Doesnt it make things more complicated?

Statistics not logging

Not sure if this is an installation problem, an upgrade problem or a module problem . . .

Registration to the event

Is there a simple way to implement a registration forms to the events? In contrast to RSVPs I'd like not to invite people to my event, but, first, let them find my event and by filling in the registration form, which would collect additional to user's profile data, apply for the invitation to the event. Then I, based on their submitted data, could send them RSVP.

Help Requested Debugging Error Message ....

If anyone could help be debug this situation, I would greatly appreciate it. I'm getting 3 error messages any time I go to a page with node/add in the path. I've modified some existing modules ... adding an additional node_load call or two, and I think it stems from that, but I can't track down the root cause of this problem. Is there any way to identify the code that was calling these functions? Any help would be GREATLY appreciated.

http://connect.educause.edu/node/add
http://connect.educause.edu/node/add/flexinode-1


details
Type php
Date Wednesday, August 17, 2005 - 9:16am
User drupal
Location /index.php?q=node/add
Message implode() [function.implode]: Bad arguments. in c:\Inetpub\wwwroot\modules\node.module on line 353.

How to use ajax for your modules (with Xajax)

xajax is an open source PHP class library that allows you to easily create powerful, web-based, Ajax applications using HTML, CSS, JavaScript, and PHP. (from http://xajax.sourceforge.net/)

It has a nice and straightforward implementation. It's still in alpha but that should be enough for most purposes.

So, here's a short howto for your own modules, f you like to implement some ajax stuff.

1. Download the class and place it into your module directory

2. Include it into your module file

 require_once('inc/xajax.inc.php' ); 

3. Write the code
Your website should do something when the user clicks the button ;)
We just take the function 'my_function'.

// place this into your php code
function my_function() {
  // code comes later
}

4. Register your functions
Place the following code into your [module_name]_menu() function ( What's this?)

    // initialise xajax
    $xajax = new xajax();
    
    // register functions for ajax
    $xajax->registerFunction("my_function");
    
    // include javascript in html header
    drupal_set_html_head($xajax->getJavascript()); 

    // let xajax process ajax requests
    $xajax->processRequests();

5. Write your javacript code
Wrong ;). We are not required to write any javascript code. Xajax is doing the dirty work for us.

Pages

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