domain_advanced_form

Definition

domain_advanced_form($node_types)
domain_admin.inc, line 669

Description

FormsAPI

Parameters

$node_types A list of active node types taken from node_get_types().

Code

function domain_advanced_form($node_types) {
  $form = array();
  // Some editors will not have full node editing permissions.  This allows us
  // to give selected permissions for nodes within the editor's domain.
  if (variable_get('domain_editors', DOMAIN_EDITOR_RULE) == 1) {
    $form['domain_form'] = array(
      '#type' => 'fieldset',
      '#title' => t('Domain node editing'),
      '#collapsible' => TRUE
    );
    $form['domain_form']['intro'] = array('#value' => t('<p>When editors view domain-access restricted nodes, which form elements should be exposed?</p>'));
    $options = array(
      'log' => t('Log messages'),
      'author' => t('Authoring information'),
      'options' => t('Publishing options'),
      'delete' => t('Delete node'),
      'comment_settings' => t('Comment settings'),
      'path' => t('Path aliasing'),
      'menu' => t('Menu settings'),
      'attachments' => t('File attachments')
    );
    ksort($options);
    $form['domain_form']['domain_form_elements'] = array(
      '#type' => 'checkboxes',
      '#default_value' => variable_get('domain_form_elements', array('options', 'delete', 'comment_settings', 'path')),
      '#options' => $options,
      '#description' => t('Some elements may not be editable for all users due to permission restrictions, specifically <em>authoring</a> and menu</em> settings.'),
    );
  }
  $default = variable_get('domain_behavior', DOMAIN_INSTALL_RULE);
  $form['domain_node'] = array(
    '#type' => 'fieldset',
    '#title' => t('Domain node types'),
    '#collapsible' => TRUE
  );
  $form['domain_node']['intro'] = array('#value' => t('<p>Check the content types that should be published to all affiliates when new content is created.  <br /><em>NOTE: These settings only apply if the "New content settings" option is set to "Only show on selected sites."</em></p>'));
  foreach ($node_types as $key => $value) {
    $form['domain_node']['domain_node_'. $key] = array(
      '#type' => 'checkbox',
      '#title' => check_plain($value),
      '#default_value' => variable_get('domain_node_'. $key, $default),
    );
  }
  return system_settings_form($form);
}