You are here

function om_search in OM Tools 8.2

Same name and namespace in other branches
  1. 8 tools/search/search.inc \om_search()
  2. 6.2 tools/search/search.inc \om_search()
  3. 6 tools/search/search.inc \om_search()
  4. 7.2 tools/search/search.inc \om_search()
  5. 7 tools/search/search.inc \om_search()

Search Form

1 call to om_search()
om_search_tools in tools/search/search.inc
Search Tools Form

File

tools/search/search.inc, line 243
Search Tools

Code

function om_search($search_defaults = array()) {

  // Search
  $out = array();

  // Reset Search Page
  if (!isset($search_defaults['search_label']) || $search_defaults['search_reset'] == 1) {
    $search_defaults['search_title'] = 'Search';
    $search_defaults['search_label'] = 1;
    $search_defaults['search_label_text'] = 'Enter your keywords';
    $search_defaults['search_size'] = 30;
    $search_defaults['search_hover'] = 'Enter the terms you wish to search for.';
    $search_defaults['search_button'] = 'Go';
    $search_defaults['search_reset'] = 0;
  }
  $out['search_switch'] = array(
    '#type' => 'checkbox',
    '#title' => t('Change Search Page Form'),
    '#default_value' => isset($search_defaults['search_switch']) ? $search_defaults['search_switch'] : 0,
  );
  $out['search_settings'] = array(
    '#type' => 'fieldset',
    '#attributes' => array(
      'id' => 'om-group-search-settings',
    ),
    '#title' => t('Search Settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $out['search_settings']['search_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Search page title'),
    '#default_value' => isset($search_defaults['search_title']) ? $search_defaults['search_title'] : '',
  );
  $out['search_settings']['search_label'] = array(
    '#type' => 'checkbox',
    '#title' => t('Put label inside the search box.'),
    '#default_value' => isset($search_defaults['search_label']) ? $search_defaults['search_label'] : '',
  );
  $out['search_settings']['search_label_text'] = array(
    '#type' => 'textfield',
    '#title' => t('Label Text'),
    '#default_value' => isset($search_defaults['search_label_text']) ? $search_defaults['search_label_text'] : '',
  );
  $out['search_settings']['search_size'] = array(
    '#type' => 'textfield',
    '#title' => t('Search box size'),
    '#default_value' => isset($search_defaults['search_size']) ? $search_defaults['search_size'] : 30,
  );
  $out['search_settings']['search_hover'] = array(
    '#type' => 'textfield',
    '#title' => t('Rollover Text'),
    '#default_value' => isset($search_defaults['search_hover']) ? $search_defaults['search_hover'] : '',
  );
  $out['search_settings']['search_button'] = array(
    '#type' => 'textfield',
    '#title' => t('Button Text'),
    '#default_value' => isset($search_defaults['search_button']) ? $search_defaults['search_button'] : 'Go',
  );
  $out['search_reset'] = array(
    '#type' => 'checkbox',
    '#title' => t('Reset to default values.'),
    '#default_value' => isset($search_defaults['search_reset']) ? $search_defaults['search_reset'] : 0,
  );
  return $out;
}