You are here

function jammer_admin_settings in Jammer 5

Same name and namespace in other branches
  1. 6 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 56
Modify forms.

Code

function jammer_admin_settings() {
  $types = node_get_types();
  foreach ($types as $type) {

    // don't bother listing a content type in the configuration list if
    // it doesn't have a corresponding form since modules like usernode
    // sometimes manage nodes automatically in the background
    if (function_exists($type->module . '_form')) {
      $options[$type->type] = $type->name;
    }
  }
  asort($options);
  $form = array();
  $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['buttons'] = array(
    '#type' => 'fieldset',
    '#title' => t('Buttons'),
    '#collapsed' => FALSE,
    '#collapsible' => TRUE,
  );
  $form['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['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['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);
}