You are here

function jammer_admin_settings in Jammer 6

Same name and namespace in other branches
  1. 5 jammer.module \jammer_admin_settings()
  2. 7 jammer.module \jammer_admin_settings()
1 string reference to 'jammer_admin_settings'
jammer_menu in ./jammer.module
Implementation of hook_menu().

File

./jammer.module, line 143
Modify forms.

Code

function jammer_admin_settings() {
  $options = array();
  $types = node_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 the body field.
  $form['jammer_bodyfield_form_unset_node_types'] = array(
    '#type' => 'select',
    '#title' => t('Remove body field on content types'),
    '#options' => $options,
    '#size' => count($options) < 6 ? count($options) : 6,
    '#multiple' => TRUE,
    '#default_value' => variable_get('jammer_bodyfield_form_unset_node_types', array()),
    '#description' => t('The selected node types will no longer have a body field 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.'),
  );
  $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);
}