You are here

function publishcontent_config_form in Publish Content 7

Same name and namespace in other branches
  1. 6 publishcontent.admin.inc \publishcontent_config_form()

Administration settings form.

1 string reference to 'publishcontent_config_form'
publishcontent_menu in ./publishcontent.module
Implements hook_menu().

File

./publishcontent.admin.inc, line 11
Contains page callbacks for publishcontent

Code

function publishcontent_config_form($form, &$form_state) {
  $form['publishcontent_method'] = array(
    '#type' => 'radios',
    '#title' => t('Quick publish method'),
    '#default_value' => variable_get('publishcontent_method', PUBLISHCONTENT_METHOD_TABS),
    '#description' => t('Choose the quick links method. With no quick links, the published checkbox will still appear on the node edit form. Note that a Drupal cache clear occurs after changing this.'),
    '#options' => array(
      PUBLISHCONTENT_METHOD_NONE => t('None.'),
      PUBLISHCONTENT_METHOD_ACTION_LINKS => t('Action links on node view.'),
      PUBLISHCONTENT_METHOD_BUTTON => t('Button.'),
      PUBLISHCONTENT_METHOD_TABS => t('Tabs.'),
    ),
  );

  // Provide a central place to select which content types are supported.
  $node_types = node_type_get_names();
  $form['content_types_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => t('Content Types'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#description' => t('Choose the content types to support.'),
  );
  foreach ($node_types as $machine_name => $human_name) {
    $form['content_types_fieldset']['publishcontent_' . $machine_name] = array(
      '#type' => 'checkbox',
      '#title' => $human_name,
      '#default_value' => variable_get('publishcontent_' . $machine_name, FALSE),
    );
  }
  $form['#submit'][] = 'publishcontent_config_form_pre_submit';
  $form = system_settings_form($form);
  $form['#submit'][] = 'publishcontent_config_form_post_submit';
  return $form;
}