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

Off-site redirects during login

Hello,

I am writing a module to link Drupal with an ASP I use to do mass mailings and advocacy campaigns (i.e. letters to elected officials).

The ASP provides an API over HTTP to log users into their system. On login, a cookie is returned to the user. When the user browses to the ASPs websites, forms are pre-populated with their data.

The API specifies the following arguments:

dates before 1970

Minor issue:

The function node_validate in node.module doesn't allow nodes to have a negative 'created' field.
It's very limiting for my project, and I don't understand the motivation.

Couldn't the following line...

if (strtotime($node->date) <= 0) {ù

... be changed to

$created = strtotime($node->date);
if ($created === -1 || $created === FALSE) {

Not sure I should have posted here... but thank you!
Ciao. Mic

how to put image field in new module?

What is the best way to add an image field to a new node type module I am making? Should I use img_assist.module? Or just a form input field of
'#type' => 'file'
? Or what? Thanks!
dado

Mirroring user and profile db functions in external db

I'd like to attach a db to my drupal site. I am hoping to be able to somehow mirror drupal's user and profile insert/update/delete db on this external db so that they are in synch. In otherwords, a user registering on the site is automatically registered on the external db: same username, password and any profile info collected. Of course, any updates and deletes also need to be reflected.

Sunrise: my new module

I just finished my new module for Drupal 4.6: Sunrise. It displays a block where users can see the sunrise and sunset times for a predefined geographical location. Please post feedback and guidelines for the next version. :)

form api: return $form vs. $output

Hi!

I already read the handbook pages about 4.7's new form api, but I still dont understand how to use it
correctly. I wrote a simple test module to play with the api:

function formtest_settings() {

  $form['global'] = array(
    '#type' => 'fieldset',
    '#title' => t('form_group'),
  );

  $form['global']['formtest_enable'] = array(
    '#type' => 'radios',
    '#title' => t('Test Radios'),
    '#default_value' => variable_get('formtest_enable', 0),
    '#options' => array(t('Off'), t('On')),
  );  
  
  $options = array();
  $options[0] = "Choose Option";
  $options[1] = "Option A";
  $options[2] = "Option B";
  
  $form['global']['formtest_method'] = array(
    '#type' => 'select',
    '#title' => t('Test Select'),
    '#default_value' => 1,
    '#options' => $options,
    '#description' => t('Sample Desciption'),
  );
  
  //$output = form_render($form);
  //$output = drupal_get_form('testform', $form);
  //return $output;
  return $form;
  
}

The code works nicely with return $form, but when I try one of the other lines and return $output
I receive "Fatal error: Cannot use string offset as an array in ...\system.module on line 728"
Whats wrong with my code? What function should I use form_render or drupal_get_form?

As long I must use return $form, I'm unable to apply special format to my output,
e.g. $output = theme('table', $header, $rows) is not possible then.

Hoping for help, Thilo

Pages

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