You are here

function domain_form_node_type_form_alter in Domain Access 7.3

Implements hook_form_FORM_ID_alter().

Adds configurable default settings to the node type edit form.

File

./domain.module, line 2713
Core module functions for the Domain Access suite.

Code

function domain_form_node_type_form_alter(&$form, &$form_state, $form_id) {
  $options = array(
    DOMAIN_ALL => t('All domains'),
    DOMAIN_ACTIVE => t('Author\'s currently active domain'),
  );
  foreach (domain_domains() as $key => $value) {
    $options[$value['machine_name']] = $value['sitename'];
  }
  $default_values = domain_default_node_access_settings($form['#node_type']->type);
  $form['domain'] = array(
    '#type' => 'fieldset',
    '#title' => t('Domain access settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#group' => 'additional_settings',
    '#access' => user_access('set domain access'),
  );
  $form['domain']['domain_node'] = array(
    '#title' => t('Publish to'),
    '#description' => t('You may set default domain publishing options when new content of this type will be created. When you publish to <em>All domains</em>, you can additionally define domain memberships.'),
    '#type' => 'checkboxes',
    '#tree' => TRUE,
    '#options' => $options,
    '#default_value' => $default_values,
  );
}