You are here

function mailing_list_forms in Mailing List 7

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

Implement 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 202
Minimalistic mailing list module.

Code

function mailing_list_forms() {
  $forms = array();
  $lists = mailing_list_get();
  foreach ($lists as $mlid => $list) {
    $forms['mailing_list_subscription_form_' . $mlid] = array(
      'callback' => 'mailing_list_subscription_form',
      'callback arguments' => array(
        $list,
      ),
    );
  }
  return $forms;
}