You are here

function msnf_content_extra_fields in Multistep Nodeform 6

Implementation of hook_content_extra_fields().

Define extra fields, in case content module is not installed. This is almost a verbatim copy of content_content_extra_fields().

See also

content_content_extra_fields().

File

./msnf.module, line 726
Main functions for module "Multistep Nodeform".

Code

function msnf_content_extra_fields($type_name) {
  $extra = array();
  if (module_exists('content')) {

    // Let content.module handle the default extra fields.
    return array();
  }
  $type = node_get_types('type', $type_name);
  if ($type->has_title) {
    $extra['title'] = array(
      'label' => $type->title_label,
      'description' => t('Node module form.'),
      'weight' => -5,
    );
  }
  if ($type->has_body) {
    $extra['body_field'] = array(
      'label' => $type->body_label,
      'description' => t('Node module form.'),
      'weight' => 0,
      'view' => 'body',
    );
  }
  $extra['revision_information'] = array(
    'label' => t('Revision information'),
    'description' => t('Node module form.'),
    'weight' => 20,
  );
  $extra['author'] = array(
    'label' => t('Authoring information'),
    'description' => t('Node module form.'),
    'weight' => 20,
  );
  $extra['options'] = array(
    'label' => t('Publishing options'),
    'description' => t('Node module form.'),
    'weight' => 25,
  );
  if (module_exists('comment')) {
    $extra['comment_settings'] = array(
      'label' => t('Comment settings'),
      'description' => t('Comment module form.'),
      'weight' => 30,
    );
  }
  if (module_exists('locale') && variable_get("language_content_type_{$type_name}", 0)) {
    $extra['language'] = array(
      'label' => t('Language'),
      'description' => t('Locale module form.'),
      'weight' => 0,
    );
  }
  if (module_exists('translation') && translation_supported_type($type_name)) {
    $extra['translation'] = array(
      'label' => t('Translation settings'),
      'description' => t('Translation module form.'),
      'weight' => 30,
    );
  }
  if (module_exists('menu')) {
    $extra['menu'] = array(
      'label' => t('Menu settings'),
      'description' => t('Menu module form.'),
      'weight' => -2,
    );
  }
  if (module_exists('taxonomy') && taxonomy_get_vocabularies($type_name)) {
    $extra['taxonomy'] = array(
      'label' => t('Taxonomy'),
      'description' => t('Taxonomy module form.'),
      'weight' => -3,
    );
  }
  if (module_exists('book')) {
    $extra['book'] = array(
      'label' => t('Book'),
      'description' => t('Book module form.'),
      'weight' => 10,
    );
  }
  if (module_exists('path')) {
    $extra['path'] = array(
      'label' => t('Path settings'),
      'description' => t('Path module form.'),
      'weight' => 30,
    );
  }
  if ($type_name == 'poll' && module_exists('poll')) {
    $extra['title'] = array(
      'label' => t('Poll title'),
      'description' => t('Poll module title.'),
      'weight' => -5,
    );
    $extra['choice_wrapper'] = array(
      'label' => t('Poll choices'),
      'description' => t('Poll module choices.'),
      'weight' => -4,
    );
    $extra['settings'] = array(
      'label' => t('Poll settings'),
      'description' => t('Poll module settings.'),
      'weight' => -3,
    );
  }
  if (module_exists('upload') && variable_get("upload_{$type_name}", TRUE)) {
    $extra['attachments'] = array(
      'label' => t('File attachments'),
      'description' => t('Upload module form.'),
      'weight' => 30,
      'view' => 'files',
    );
  }
  return $extra;
}