You are here

function simplify_get_fields in Simplify 7.3

Same name and namespace in other branches
  1. 8 simplify.module \simplify_get_fields()

Get an array of fields (by type) that can be hidden.

4 calls to simplify_get_fields()
simplify_form_node_type_form_alter in ./simplify.module
Implements hook_form_FORM_ID_alter() for node_type_form.
simplify_form_profile2_type_form_alter in ./simplify.module
Implements hook_form_FORM_ID_alter() for profile2_type_form.
simplify_form_taxonomy_form_vocabulary_alter in ./simplify.module
Implements hook_form_FORM_ID_alter() for taxonomy_form_vocabulary.
simplify_global_configuration_form in ./simplify.module
Simplify global configuration form.

File

./simplify.module, line 453
Simplifies the user interface by hiding particular fields.

Code

function simplify_get_fields($type) {
  $fields = array();
  switch ($type) {

    // Nodes
    case 'nodes':

      // Drupal core
      $fields['author'] = t('Authoring information');
      $fields['format'] = t('Text format selection');
      $fields['options'] = t('Publishing options');
      $fields['revision'] = t('Revision information');
      if (module_exists('book')) {
        $fields['book'] = t('Book outline');
      }
      if (module_exists('comment')) {
        $fields['comment'] = t('Comment settings');
      }
      if (module_exists('menu')) {
        $fields['menu'] = t('Menu settings');
      }
      if (module_exists('path')) {
        $fields['path'] = t('URL path settings');
      }

      // Third-party modules
      if (module_exists('domain')) {
        $fields['domain'] = t('Domain access');
      }
      if (module_exists('entity_translation') && entity_translation_enabled('node')) {
        $fields['entity_translation'] = t('Entity translation');
      }
      if (module_exists('metatag')) {
        $fields['metatag'] = t('Meta tags');
      }
      if (module_exists('node_noindex')) {
        $fields['node_noindex'] = t('Node noindex');
      }
      if (module_exists('redirect')) {
        $fields['redirect'] = t('URL redirects');
      }
      if (module_exists('xmlsitemap_node')) {
        $fields['xmlsitemap'] = t('XML sitemap');
      }
      break;

    // Users
    case 'users':

      // Drupal core
      $fields['format'] = t('Text format selection');
      $fields['status'] = t('Status (blocked/active)');
      if (module_exists('contact')) {
        $fields['contact'] = t('Contact settings');
      }
      if (module_exists('overlay')) {
        $fields['overlay'] = t('Administrative overlay');
      }

      // Third-party modules
      if (module_exists('metatag')) {
        $fields['metatag'] = t('Meta tags');
      }
      if (module_exists('redirect')) {
        $fields['redirect'] = t('URL redirects');
      }
      break;

    // Comments
    case 'comments':

      // Drupal core
      $fields['format'] = t('Text format selection');
      break;

    // Taxonomy
    case 'taxonomy':

      // Drupal core
      $fields['format'] = t('Text format selection');
      $fields['relations'] = t('Relations');
      if (module_exists('path')) {
        $fields['path'] = t('URL alias');
      }

      // Third-party modules
      if (module_exists('metatag')) {
        $fields['metatag'] = t('Meta tags');
      }
      if (module_exists('redirect')) {
        $fields['redirect'] = t('URL redirects');
      }
      if (module_exists('xmlsitemap_taxonomy')) {
        $fields['xmlsitemap'] = t('XML sitemap');
      }
      break;

    // Blocks
    case 'blocks':

      // Drupal core
      $fields['format'] = t('Text format selection');
      break;

    // Profiles
    case 'profiles':
      $fields['format'] = t('Text format selection');
      break;
  }

  // Allow other modules to alter the array of fields that can be hidden
  drupal_alter('simplify_get_fields', $fields, $type);
  return $fields;
}