You are here

function promote_disable_form in Promote Disable 7

Page callback: Promote Disable settings.

See also

promote_disable_menu()

1 string reference to 'promote_disable_form'
promote_disable_menu in ./promote_disable.module
Implements hook_menu().

File

./promote_disable.module, line 33
Primarily Drupal hooks and helper functions. This is the main module file for Promote Disable.

Code

function promote_disable_form($form, &$form_state) {
  $node_types = _promote_disable_node_types();
  $form['promote_to_front_page'] = array(
    '#type' => 'fieldset',
    '#title' => t('Promote to front page'),
  );
  $form['promote_to_front_page']['promote_disable_node_types'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#size' => count($node_types),
    '#title' => t('Content types'),
    '#default_value' => variable_get('promote_disable_node_types', array()),
    '#options' => $node_types,
    '#description' => t('Select the content types on which you would like to disable the "Promoted to front page" option.'),
  );
  $form['sticky'] = array(
    '#type' => 'fieldset',
    '#title' => t('Make content sticky'),
  );
  $form['sticky']['promote_disable_sticky_node_types'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#size' => count($node_types),
    '#title' => t('Content types'),
    '#default_value' => variable_get('promote_disable_sticky_node_types', array()),
    '#options' => $node_types,
    '#description' => t('Select the content types on which you would like to disable the "Sticky option.'),
  );
  $form['promote_disabled_node_admin_content'] = array(
    '#type' => 'checkbox',
    '#default_value' => variable_get('promote_disabled_node_admin_content', FALSE),
    '#title' => t('Remove options.'),
    '#description' => t('Remove the "Promote selected content to the front page" and "Demote selected content from the front page" options from the !content_overview_page.', array(
      '!content_overview_page' => l(t('content overview page'), 'admin/content', array(
        'attributes' => array(
          'target' => '_blank',
        ),
      )),
    )),
  );
  return system_settings_form($form);
}