You are here

function mailing_list_forms in Mailing List 6

Same name and namespace in other branches
  1. 7 mailing_list.module \mailing_list_forms()

Implementation of hook_forms().

All subscription forms are build using mailing_list_subscription_form(). hook_forms() is required to provide unique form id for each one.

File

./mailing_list.module, line 174
Minimalistic mailing list module.

Code

function mailing_list_forms() {
  $query = db_query('SELECT * FROM {mailing_list}');
  while ($list = db_fetch_object($query)) {
    $forms['mailing_list_subscription_form_' . $list->mlid] = array(
      'callback' => 'mailing_list_subscription_form',
      'callback arguments' => array(
        $list,
      ),
    );
  }
  return $forms;
}