You are here

function node_expire_form_alter in Node expire 8

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

Implements hook_form_alter().

Adds expiration options to the node entry forms

File

./node_expire.module, line 64
Set a timer into your content, allowing you to perform customized actions.

Code

function node_expire_form_alter(&$form, \Drupal\Core\Form\FormStateInterface &$form_state, $form_id) {

  // @FIXME
  // Could not extract the default value because it is either indeterminate, or
  // not scalar. You'll need to provide a default value in
  // config/install/node_expire.settings.yml and config/schema/node_expire.schema.yml.
  if (isset($form['type']) && isset($form['type']['#value']) && $form['type']['#value'] . '_node_form' == $form_id && ($ntypes = \Drupal::config('node_expire.settings')
    ->get('node_expire_ntypes')) && isset($ntypes[$form['type']['#value']]) && ($ntype = $ntypes[$form['type']['#value']])) {
    module_load_include('nodeapi.inc', 'node_expire');
    _node_expire_form_alter_nodeform($ntype, $form, $form_state, $form_id);
  }
}