Form API Help: Checkboxes

Hi-

I'm working on an action to send an email to everyone in a role group (e.g. "Send an email to editors when new content is in the draft state").

I need to set up a check box of roles. Here is the code:

$roles = user_roles();
$form['recipients'] = array(
        '#type' => 'checkboxes', 
        '#title' => t('Recipient Role Groups'), 
        '#options' => $roles,
        '#description' => t('Select which roles should receive this email.'),
    );

The creates an #options field with the form:

array( rid1 => 'role name 1', rid2 => 'role name 2' ...)

This works well at first, and I can properly save the form, but if I return to the edit screen later, the form isn't properly populated because I have an $edit array that looks like:

[recipients] => Array ( [3] => 3 [1] => 0 [2] => 0 [4] => 0 [5] => 0 [6] => 0 )

All the other fields (subject, message body, etc) are nicely filled in. I suspect this is because the options I supply in the code, don't match the options in the $edit array.

Any thoughts on how I can get these to mesh?

Thanks
-Mark

Do I need to have a mail server to install Drupal?

The installation of Drupal at first wasn't as difficcult as I thought it would be but now after configuring my database and getting the 1st page to create the admin account I am asked for an email address to send the new user info. I am developing my sandbox drupal site in a localhost using xampp 1.5.1 and do not have an email server here. I also tried loging in with the generated password Drupal gave me but if I try to change it in the 'user account' I get this error message:

Dynamic Primary and Secondary Links

I'm interested in building my navigation with the primary and secondary links, but I want it to be dynamically displayed and controlled via javascript. For instance, I want to show my primary links, and then when I scroll over each link the "secondary links" for that menu item would show up via javascript. I have all the JS to do it, but how do I get the children of each primary link through Drupal?

Reference: the example of the functionality on the site I'm trying to convert.

URL alias string format

My site is creating breadcrumbs that look like:

<a href="/Section Title">Section Title</a> &raquo; <a href="/Subsection Title">Subsection Title</a>

This is perfect. However, one of my subsections is titled 'Bars and Clubs'. The breadcrumb entry looks like this:

<a href="/Bars+and+Clubs">Bars and Clubs</a>

I have a URL alias set up to forward 'Bars+and+Clubs' to the appropriate taxonomy term listing, but all I get is a page not found. Any ideas?

drill down... a block to show which categories are most used, then narrow search results with Taxonomy Browser?

My idea is to have it like del.icio.us pages. The taxonomy page will show you the most recent nodes tagged with that category, and an optional block will have the common taxonomies of that taxonomy.

Separating the node links into separate items.

I am using the forward module which includes a URL link at the bottom of a node that is 'email this page'.

I would like to separate out the 'email this page' link and place it elsewhere on the site whilst still having the link with the others in the $links at the bottom of the node. Where can I do this? How can I show just the email this page link without the others appearing also.

Thanks

Pages

Subscribe with RSS Subscribe to RSS - Drupal 4.7.x