You are here

function scheduler_node_import_fields in Node import 6

Implementation of hook_node_import_fields().

File

supported/scheduler/scheduler.inc, line 10
Support file for the contrib scheduler module.

Code

function scheduler_node_import_fields($type) {
  $fields = array();
  if (($node_type = node_import_type_is_node($type)) !== FALSE) {
    if (variable_get('scheduler_publish_enable_' . $node_type, 0) == 1) {
      $fields['publish_on'] = array(
        'title' => t('Publish on'),
        'group' => t('Scheduling options'),
        'module' => 'scheduler',
        'weight' => 35,
        'map_required' => variable_get('scheduler_publish_required_' . $node_type, 0),
        'is_mappable' => user_access('schedule (un)publishing of nodes'),
        'input_format' => 'date',
        'default_value' => '',
      );
    }
    if (variable_get('scheduler_unpublish_enable_' . $node_type, 0) == 1) {
      $fields['unpublish_on'] = array(
        'title' => t('Unpublish on'),
        'group' => t('Scheduling options'),
        'module' => 'scheduler',
        'weight' => 35,
        'map_required' => variable_get('scheduler_unpublish_required_' . $node_type, 0),
        'is_mappable' => user_access('schedule (un)publishing of nodes'),
        'input_format' => 'date',
        'default_value' => '',
      );
    }
  }
  return $fields;
}