expand_checkboxes might allow at least one level of checkbox grouping.

In an attempt to get a checkbox selection on a filter form, I needed to handle an array of arrays which turned out to be a grouping of selections.
The top level array is, of course, the array of the box groups. And, each array element is a list of checkboxes.
This turns out to be a group originally targeted at a selection list (). But, there is sometimes a need to turn a single selection into a multiple one.
In this case, changing form API code by transforming '#type' => "select" into '#type' => 'checkboxes'.

So, I thought maybe the checkboxes could be grouped into field lists. (This works for one application.) Of course, there is perhaps a better way. I have been using OAT during the last few weeks. And, they can make a tree, or nested UL lists, into expandable and collapsible checkbox trees. So, now I am wondering how to make that work with this form API.

In the mean time, the following solved one problem and integrates well with the form api. This change is made in form.inc:

function expand_checkboxes($element) {
$value = is_array($element['#value']) ? $element['#value'] : array();
$element['#tree'] = TRUE;
if (count($element['#options']) > 0) {
if (!isset($element['#default_value']) || $element['#default_value'] == 0) {
$element['#default_value'] = array();
}

Blocks and Menues on Errorpages

Hi, I`ve just created my 403, 404 and 500 Error pages. The errorpages are up and running. When I open them directly with their link (like: domain.com/404) everything works fine. But when a 404 error happens, I get redirected to me errorpage...but the menue and boxes are gone. What can I do to prevent this from happening?!
Anybody any Ideas?!

Thanks.

Moving auto time zone to core

The Auto Time Zone module is pretty slim and mature now. What about moving it into drupal 6 core?
http://drupal.org/project/autotimezone

Question about "My Account Page"

Hi

I would like to add my own PHP form to the "MY Account " "Edit" page. Is this possible?

Regards

Old URL/ New URL 301 redirect (Apache/ htaccess)

Hi everybody.
I have a simple question, regarding the .htacces in Drupal. I want to redirect my users from my old URLs (from the time before I used drupal) to the new URLs in Drupal. Generally I use the following:

Redirect /old-url.php http://www.domain.com/new-url

But with my current settings, this does not work and redirects me to something like this:

Redirect /old-url.php http://www.domain.com/new-url?q=old-url.php

Module development job

I want someone to build a module for me to integrate an existing API into Drupal. Please contact me (editor@redbridgereview.co.uk) for details of this job and your experience with module development. This is not a job for novices. thanks

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x