You are here

function _custom_search_custom_paths_admin_form in Custom Search 7

Same name and namespace in other branches
  1. 6 includes/forms.inc \_custom_search_custom_paths_admin_form()

Custom paths admin form.

2 calls to _custom_search_custom_paths_admin_form()
custom_search_admin in ./custom_search.admin.inc
General settings.
custom_search_blocks_block_configure in modules/custom_search_blocks/custom_search_blocks.module
Implements hook_block_configure().

File

includes/forms.inc, line 300
Search forms

Code

function _custom_search_custom_paths_admin_form($delta = '') {
  if ($delta != '') {
    $delta = 'blocks_' . $delta . '_';
  }
  $form['custom_search_paths_admin'] = array(
    '#type' => 'fieldset',
    '#title' => t('Custom search paths'),
    '#collapsed' => TRUE,
    '#collapsible' => TRUE,
  );
  $form['custom_search_paths_admin']['custom_search_' . $delta . 'paths_selector'] = array(
    '#type' => 'select',
    '#title' => t('Selector type'),
    '#options' => array(
      'select' => t('Drop-down list'),
      'radios' => t('Radio buttons'),
    ),
    '#description' => t('Choose which selector type to use.'),
    '#default_value' => variable_get('custom_search_' . $delta . 'paths_selector', 'select'),
  );
  $form['custom_search_paths_admin']['custom_search_' . $delta . 'paths_selector_label_visibility'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display label'),
    '#default_value' => variable_get('custom_search_' . $delta . 'paths_selector_label_visibility', TRUE),
  );
  $form['custom_search_paths_admin']['custom_search_' . $delta . 'paths_selector_label'] = array(
    '#type' => 'textfield',
    '#title' => t('Label text'),
    '#default_value' => variable_get('custom_search_' . $delta . 'paths_selector_label', CUSTOM_SEARCH_PATHS_SELECTOR_LABEL_DEFAULT),
    '#description' => t('Enter the label text for the selector. The default value is "!default".', array(
      '!default' => CUSTOM_SEARCH_PATHS_SELECTOR_LABEL_DEFAULT,
    )),
  );
  $form['custom_search_paths_admin']['custom_search_' . $delta . 'paths'] = array(
    '#type' => 'textarea',
    '#title' => t('Paths'),
    '#default_value' => variable_get('custom_search_' . $delta . 'paths', ''),
    '#rows' => 3,
    '#description' => t('If you want to use custom search paths, enter them here in the form <em>path</em>|<em>label</em>, one per line (if only one path is specified, the selector will be hidden). The [key] token will be replaced by what is entered in the search box. Ie: mysearch/[key]|My custom search label. The [current_path] token can be used to use the current URL path of the page beeing viewed.'),
  );
  return $form;
}