You are here

function _simplenews_node_form in Simplenews 7.2

Same name and namespace in other branches
  1. 7 simplenews.module \_simplenews_node_form()

@todo

1 call to _simplenews_node_form()
simplenews_form_alter in ./simplenews.module
Implements hook_form_alter().

File

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

Code

function _simplenews_node_form(&$form, $form_state) {

  // Display warning if the node is currently being sent.
  if (!empty($form['#node']->nid)) {
    if (simplenews_issue_status(node_load($form['#node']->nid)) == SIMPLENEWS_STATUS_SEND_PENDING) {
      drupal_set_message(t('This newsletter issue is currently being sent. Any changes will be reflected in the e-mails which have not been sent yet.'), 'warning');
    }
  }
  if (module_exists('token')) {
    $form['simplenews_token_help'] = array(
      '#title' => t('Replacement patterns'),
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#description' => t('These tokens can be used in all text fields except subject and will be replaced on-screen and in the email.'),
    );
    $form['simplenews_token_help']['browser'] = array(
      '#theme' => 'token_tree',
      '#token_types' => array(
        'simplenews-newsletter',
        'simplenews-subscriber',
        'node',
      ),
    );
  }
}