You are here

function custom_search_admin in Custom Search 6

Same name and namespace in other branches
  1. 7 custom_search.admin.inc \custom_search_admin()

@file Admin settings for custom search

3 string references to 'custom_search_admin'
custom_search_i18n_form_alter in modules/custom_search_i18n/custom_search_i18n.module
Implementation of hook_form_alter().
custom_search_menu in ./custom_search.module
Implementation of hook_menu().
custom_search_taxonomy_form_alter in modules/custom_search_taxonomy/custom_search_taxonomy.module
Implementation of hook_form_alter().

File

./custom_search.admin.inc, line 8
Admin settings for custom search

Code

function custom_search_admin() {
  $directory_path = file_directory_path() . '/custom_search';
  file_check_directory($directory_path, FILE_CREATE_DIRECTORY);

  // Check for a new uploaded image.
  if ($file = file_save_upload('custom_search_image', array(
    'file_validate_is_image' => array(),
  ))) {
    if (file_copy($file, $directory_path)) {
      $_POST['custom_search_image_path'] = $file->filepath;
    }
  }

  // Basic settings.
  $form = _custom_search_default_admin_form();

  // Custom search paths.
  $form = array_merge($form, _custom_search_custom_paths_admin_form());

  // Ordering.
  $form = array_merge($form, _custom_search_ordering_admin_form());
  $form['#attributes'] = array(
    'enctype' => 'multipart/form-data',
  );
  $form['#submit'][] = 'custom_search_admin_submit';
  return system_settings_form($form);
}