See the Mailing lists or Drupal Issue queue. There are also various working groups on groups.drupal.org

Module "ping.module" extended, reorganised and partly recoded !

I have extended, reorganised and partly recoded the optional core-module "ping.module". Since I am not a Drupal-master, could someone please tell me, if I should make this an ISSUE (feature-proposal) ? I Or can/should I append this new "ping.module" somewhere? AND Would anyone with good backend-development-skills extend this module to make it more dynamical in the backend/admin-interface of Drupal?


<?php
// ======================================================================
// PING.module from / by PS (PHILIPP-SCHAFFNER.CH) | v1.0
// ======================================================================
# 1.) function "ping_cron()" is activated by CRON-functionality (CRON = time-based automatism) due to the function-suffix "_cron"
# 2.) function "ping_cron()" now initializes function "ping_ping()" via command "module_invoke('ping','ping')"
# 3.) function "ping_ping()" goes through a user-generated list of XML-RPC-Service-Providers / directories.
# For every new URL to such a service this function calls the function "_PS__pingit()", which does the REAL job
# (including a detailed watchdog-information).
# 4.) The order of the code / functions below is based on a functional logic, NOT on a chronological one !

how can develop login page

hi i have install drupal 5.3 but i dont know how can create login page

$node data in a sub-object/array member?

I don't really know what to search for so I thought I'd ask.

I'm making a module for a custom node-type (yeah yeah CCK, sure, but I want my own module mmmkay? ;)) and I really really hate "name space pollution" or anything that might lead to it. So, I would like to somehow get all my data in the $node object to be in one member, array or object, rather than "flat".

Example:

Module conversion from 5.x to 6x

Hi,

I am converting drupal 5.x module to 6.x. I read all conversion list and have a doubt in mind for .install file.

In 6.x we need to write schema for creating table while installing module. It's ok.

But what about inserting records at the time of installation?

For example :

At the time of installation if someone wants to create table and also wants to add some recoreds to that table ( e.g. default setting for module).

How to handle this situation in hook_install for 6.x?

How to programmatically set the input format to a particular type?

Hello.

Does anybody know how to programmatically set the input format when creating Drupal nodes?
Is there an attribute to the node object representing the input format?

Thanks.
Pol

Forms API MultiStep w/ Checkboxes: can't set default values

Ready to chuck my laptop out the window. I MUST be doing something wrong . . . or this is a bug in the Forms API.

Here's the problem.

It's somewhat straight forward: I try to set default values for a checkboxes field in a multistep form and the default values don't get applied.

This only happens when:

1) The checkboxes field in NOT in the first form presented (i.e. not switch case 1), AND (I think)
2) The checkboxes field is also introduced in that subsequent case.

Here's a complete sample testform module that exhibits the behavior (apologies for the longish, and, likely ugly, sample - newbie programmer):


function testform_form($form_values=NULL) {

  $form['#multistep'] = TRUE;
  $form['#redirect'] = FALSE;

  if (isset($form_values['step'])) {
        $current_step = ++$form_values['step'];
  } else {
        $current_step = 1;
  }

  $form['step'] = array(
        '#type' => 'hidden',
        '#value' => $current_step,
  );
  switch($current_step) {

    case 1:
      $form['name'] = array(
        '#type' => 'textfield',
        '#title' => t('Name'),
        '#description' => t('test field');
      );

      $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
    break;

    case 2:
      $options = array('10' => t('Bobby'), '12' => t('Ralph'), '20' => t('George'));
      $defaults['test'][] = '12';

      $form['details'] = array (
        '#type' => 'fieldset',
        '#title' => t('Details'),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
      );

      $form['details']['admin'] = array (
        '#type' => 'checkboxes',
        '#title' => t('Only admin can view'),
        '#default_value' => $defaults['test'],
        '#options'  => $options,
      );

      $form['name'] = array(
        '#type' => 'textfield',
        '#title' => t('Name'),
        '#size' => 30,
        '#maxlength' => 64,
        '#description' => t('Enter the name for this group of settings'),
      );

      $form['submit'] = array('#type' => 'submit', '#value' => t('Continue'));
    break;
  }
  
return $form;

}

function testform_page() {
  return drupal_get_form('testform_form');
}

function testform_submit($form_id, $form_values) {
  switch($form_values['step']) {
    case 1:
      break;

    case 2:
      break;
  }
}

function testform_menu() {
  global $user;
  $items = array();
  $items[] = array('path' => 'testform',
                   'title' => t('Test Form'),
                   'callback' => t('testform_page'),
                   'access' => user_access('access content') && ($user->uid > 0),
                   'type' => MENU_CALLBACK
  );
  return $items;
}

If I use this same method of setting the default values WITHOUT putting it in a multistep form . . . NO PROBLEM; it sets the values in what I believe is the correct fashion (cue: bang forehead against wall):


function testform_form($form_values=NULL) {

  $options = array('10' => t('James'), '12' => t('Bobby'), '20' => t('George'));
  $defaults['test'][] = '12';

  $form['details'] = array (
    '#type' => 'fieldset',
    '#title' => t('Details'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

  $form['details']['admin'] = array (
    '#type' => 'checkboxes',
    '#title' => t('Only admin can view'),
    '#default_value' => $defaults['test'],
    '#options'  => $options,
  );

  $form['submit'] = array('#type' => 'submit', '#value' => t('Continue'));

  return $form;

}

function testform_page() {
  return drupal_get_form('testform_form');
}

function testform_submit($form_id, $form_values) {

}

function testform_menu() {
  global $user;
  $items = array();
  $items[] = array('path' => 'testform',
                   'title' => t('Test Form'),
                   'callback' => t('testform_page'),
                   'access' => user_access('access content') && ($user->uid > 0),
                   'type' => MENU_CALLBACK
  );
  return $items;
}

Somebody please, please, please tell me where I've gone wrong. Save my laptop.

Pages

Subscribe with RSS Subscribe to RSS - Deprecated - Drupal core