You are here

function trigger_example_form in Examples for Developers 6

Same name and namespace in other branches
  1. 7 trigger_example/trigger_example.module \trigger_example_form()

A form to help fire our triggers.

Related topics

1 string reference to 'trigger_example_form'
trigger_example_menu in trigger_example/trigger_example.module
Implementation of hook_menu().

File

trigger_example/trigger_example.module, line 138

Code

function trigger_example_form(&$form_state) {
  $form['help'] = array(
    '#type' => 'item',
    '#value' => format_plural(variable_get('trigger_example_pings', 0), 'There is only @count ping out there.', 'There are @count pings out there. Come on pong them back.'),
  );
  $form['ping'] = array(
    '#type' => 'submit',
    '#value' => t('Ping'),
  );
  if (variable_get('trigger_example_pings', 0)) {
    $form['pong'] = array(
      '#type' => 'submit',
      '#value' => t('Pong'),
    );
  }
  return $form;
}