You are here

function simplenews_forms in Simplenews 7.2

Same name and namespace in other branches
  1. 5 simplenews.module \simplenews_forms()
  2. 6.2 simplenews.module \simplenews_forms()
  3. 6 simplenews.module \simplenews_forms()
  4. 7 simplenews.module \simplenews_forms()

Implements hook_forms().

All form blocks are build using simplenews_block_form(). hook_forms() is required to provide unique form id for each block form.

File

./simplenews.module, line 1422
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_forms($form_id, $args) {
  $forms = array();
  $match = preg_match('/simplenews_block_form_(\\d+)/', $form_id, $matches);
  if ($match) {
    module_load_include('inc', 'simplenews', 'includes/simplenews.subscription');
    $forms['simplenews_block_form_' . $matches[1]] = array(
      'callback' => 'simplenews_block_form',
      'callback arguments' => array(
        $matches[1],
      ),
    );
  }
  return $forms;
}