You are here

function premium_node_import_global in Node import 5

Implementation of hook_node_import_global().

File

supported/premium.inc, line 42

Code

function premium_node_import_global($type, $global_values) {
  if (user_access('administer nodes')) {
    if (!isset($global_values['node_import_premium'])) {
      $defaults = variable_get('node_options_' . $type, array());
      $premium = in_array('premium', $defaults) ? 1 : 0;
    }
    else {
      $premium = $global_values['node_import_premium'];
    }
    $form = array();
    $form['node_import_premium'] = array(
      '#type' => 'checkbox',
      '#default_value' => $premium,
      '#title' => t('Access restricted for non-premium users'),
    );
    return $form;
  }
}