You are here

function sharerich_form_node_type_form_alter in Sharerich 7.2

Same name and namespace in other branches
  1. 7.3 sharerich.module \sharerich_form_node_type_form_alter()
  2. 7 sharerich.module \sharerich_form_node_type_form_alter()

Implements hook_form_FORM_ID_alter().

File

./sharerich.module, line 342

Code

function sharerich_form_node_type_form_alter(&$form, &$form_state) {
  $form['sharerich'] = array(
    '#type' => 'fieldset',
    '#title' => t('Sharerich'),
    '#collapsible' => TRUE,
    '#group' => 'additional_settings',
    '#weight' => 20,
    '#attributes' => array(
      'class' => array(
        'sharerich-node-type-settings-form',
      ),
    ),
    '#access' => user_access('administer nodes'),
  );
  $entity_type = $form['#node_type']->type;
  $sharerich_show_options = drupal_map_assoc(array(
    0,
    1,
    2,
    3,
    4,
    5,
  ));
  $sharerich_show_options[0] = t('Disabled');
  $form['sharerich']['show'] = array(
    '#type' => 'select',
    '#options' => $sharerich_show_options,
    '#title' => t('Enable Sharerich for this content type.'),
    '#description' => t('Select desired number of sharerich extra fields.'),
    '#default_value' => variable_get('sharerich_node_' . $entity_type, 0),
    '#suffix' => t('After enabling Sharerich you need to configure each' . ' display on Manage display set.<br/>Sets are located ' . '<a href="@url">here</a>.', array(
      '@url' => url('admin/structure/sharerich/list'),
    )),
  );
  $form['#submit'][] = 'sharerich_node_type_callback';
}