You are here

function jammer_admin_settings in Jammer 7

Same name and namespace in other branches
  1. 5 jammer.module \jammer_admin_settings()
  2. 6 jammer.module \jammer_admin_settings()

Administrative form for setting Jammer settings.

1 string reference to 'jammer_admin_settings'
jammer_menu in ./jammer.module
Implements hook_menu().

File

./jammer.module, line 183
Modify forms.

Code

function jammer_admin_settings($form, &$form_state) {
  $options = array();
  $types = node_type_get_types();
  foreach ($types as $type) {
    $options[$type->type] = $type->name;
  }
  asort($options);
  array_unshift($options, "none");
  $form = array();

  // Remove the menu settings
  $form['jammer_menu_options'] = array(
    '#type' => 'select',
    '#title' => t('Remove the menu options on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_menu_options', array()),
    '#description' => t('The selected node types will no longer have a menu options listed when creating or editing a node of that type.'),
  );

  // Remove the authoring settings
  $form['jammer_author_options'] = array(
    '#type' => 'select',
    '#title' => t('Remove the author options on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_author_options', array()),
    '#description' => t('The selected node types will no longer have an author details options listed when creating or editing a node of that type.'),
  );

  // Remove the path settings.
  $form['jammer_path_options'] = array(
    '#type' => 'select',
    '#title' => t('Remove the path options on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_path_options', array()),
    '#description' => t('The selected node types will no longer have the url options listed when creating or editing a node of that type.'),
  );

  // Remove publishing settings
  $form['jammer_publishing_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Publishing options'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['jammer_publishing_options']['jammer_node_promoted'] = array(
    '#type' => 'checkbox',
    '#title' => t('Remove promoted checkbox on Publishing options'),
    '#default_value' => variable_get('jammer_node_promoted', 0),
    '#description' => t("Nodes won't have the option for publishing to the front page by enabling this option."),
  );
  $form['jammer_publishing_options']['jammer_node_sticky'] = array(
    '#type' => 'checkbox',
    '#title' => t('Remove sticky checkbox on Publishing options'),
    '#default_value' => variable_get('jammer_node_sticky', 0),
    '#description' => t("Nodes won't have the option for setting sticky at top of lists by enabling this option."),
  );

  // Remove the body settings.
  $form['jammer_body_options'] = array(
    '#type' => 'select',
    '#title' => t('Remove the body options on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_body_options', array()),
    '#description' => t('The selected node types will no longer have the body field options listed when creating or editing a node of that type.'),
  );

  // Remove the comment settings.
  $form['jammer_comment_settings'] = array(
    '#type' => 'select',
    '#title' => t('Remove the comment options on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_comment_settings', array()),
    '#description' => t('The selected node types will no longer have the comment options listed when creating or editing a node of that type.'),
  );

  // Remove the revision settings.
  $form['jammer_revision_information'] = array(
    '#type' => 'select',
    '#title' => t('Remove the revision options on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_revision_information', array()),
    '#description' => t('The selected node types will no longer have the revision options listed when creating or editing a node of that type.'),
  );

  // Remove teaser controls.
  $form['jammer_teaser_controls_unset_node_types'] = array(
    '#type' => 'select',
    '#title' => t('Remove teaser controls on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_teaser_controls_unset_node_types', array()),
    '#description' => t("The selected node types will no longer have the 'split summary at cursor' and/or 'include summary in full view' controls when creating or editing a node of that type - except for existing nodes that already have 'include summary in full view' turned off."),
  );
  $form['jammer_revision_log_textarea_unset_node_types'] = array(
    '#type' => 'select',
    '#title' => t('Remove revision log textarea on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_revision_log_textarea_unset_node_types', array()),
    '#description' => t('The selected node types will no longer have a log textarea listed when creating or editing a node of that type.'),
  );

  // There is no current version of Workflow for D7.
  //  $form['jammer_workflow_form_unset_node_types'] = array(
  //    '#type' => 'select',
  //    '#title' => t('Remove workflow form from workflow tab on content types'),
  //    '#options' => $options,
  //    '#size' => count($options) < 6 ? count($options) : 6,
  //    '#multiple' => TRUE,
  //    '#default_value' => variable_get('jammer_workflow_form_unset_node_types', array()),
  //    '#description' => t('The selected node types will no longer have a workflow form on the workflow tab which will require workflow transitions to occur from the node edit screen.'),
  //  );
  $form['user_buttons'] = array(
    '#type' => 'fieldset',
    '#title' => t('User buttons'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['user_buttons']['jammer_user_delete_hide_button'] = array(
    '#type' => 'checkbox',
    '#title' => t('Remove delete button on user profile pages'),
    '#description' => t('Selecting this will remove the delete button from all user profile pages'),
    '#default_value' => variable_get('jammer_user_delete_hide_button', 0),
  );
  $form['content_buttons'] = array(
    '#type' => 'fieldset',
    '#title' => t('Content buttons'),
    '#collapsed' => FALSE,
    '#collapsible' => TRUE,
  );
  $form['content_buttons']['jammer_preview_button_unset_node_types'] = array(
    '#type' => 'select',
    '#title' => t('Remove preview button on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_preview_button_unset_node_types', array()),
    '#description' => t('The selected node types will no longer have a preview button listed when creating or editing a node of that type.'),
  );
  $form['content_buttons']['jammer_submit_button_unset_node_types'] = array(
    '#type' => 'select',
    '#title' => t('Remove submit button on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_submit_button_unset_node_types', array()),
    '#description' => t('The selected node types will no longer have a submit button listed when creating or editing a node of that type.'),
  );
  $form['content_buttons']['jammer_delete_button_unset_node_types'] = array(
    '#type' => 'select',
    '#title' => t('Remove delete button on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_delete_button_unset_node_types', array()),
    '#description' => t('The selected node types will no longer have a delete button listed when creating or editing a node of that type.'),
  );
  return system_settings_form($form);
}