You are here

function modr8_node_import_defaults in Node import 6

Implementation of hook_node_import_defaults().

File

supported/modr8/modr8.inc, line 34
Support file for the Moderate module (modr8).

Code

function modr8_node_import_defaults($type, $defaults, $fields, $map) {
  $form = array();
  if (($node_type = node_import_type_is_node($type)) !== FALSE) {
    $node_options = variable_get('node_options_' . $node_type, array(
      'status',
      'promote',
    ));
    $form['moderate'] = array(
      '#title' => t('In moderation queue'),
      '#type' => 'radios',
      '#options' => array(
        0 => t('No'),
        1 => t('Yes'),
      ),
      '#default_value' => isset($defaults['moderate']) ? $defaults['moderate'] : (in_array('moderate', $node_options) ? 1 : 0),
    );
  }
  return $form;
}