Skip to content

Commit

Permalink
Revert "Update custom_search 6.x-1.4 ==> 6.x-1.12"
Browse files Browse the repository at this point in the history
This reverts commit 21a8dc5.
  • Loading branch information
kwcoffman committed Apr 22, 2014
1 parent dfce7fe commit 7f488cb
Show file tree
Hide file tree
Showing 32 changed files with 2,475 additions and 1,823 deletions.
601 changes: 268 additions & 333 deletions sites/all/modules/custom_search/LICENSE.txt 100755 → 100644

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sites/all/modules/custom_search/README.txt
@@ -1,3 +1,4 @@
$Id: README.txt,v 1.1.2.1 2010/03/26 16:05:47 jdanthinne Exp $

Custom search 6.x-1.x
--------------------------
Expand Down
219 changes: 184 additions & 35 deletions sites/all/modules/custom_search/custom_search.admin.inc
@@ -1,10 +1,23 @@
<?php
// $Id: custom_search.admin.inc,v 1.1.2.17 2010/06/01 09:46:16 jdanthinne Exp $

/**
* @file
* Admin settings for custom search
*/

/**
* Implementation of hook_help().
*/
function custom_search_help($path, $arg) {
switch ($path) {
case 'admin/settings/custom_search/content':
$output = t('Select the search types to present as search options in the search block. If none is selected, no selector will be displayed. <strong>Note</strong>: if there\'s only one type checked, the selector won\'t be displayed BUT only this type will be searched.');
break;
}
return $output;
}

function custom_search_admin() {
$directory_path = file_directory_path() . '/custom_search';
file_check_directory($directory_path, FILE_CREATE_DIRECTORY);
Expand All @@ -15,12 +28,158 @@ function custom_search_admin() {
}
}

// Basic settings.
$form = _custom_search_default_admin_form();
// Custom search paths.
$form = array_merge($form, _custom_search_custom_paths_admin_form());
// Labels & default text.
$form['search_box'] = array(
'#type' => 'fieldset',
'#title' => t('Search box'),
);
$form['search_box']['custom_search_label_visibility'] = array(
'#type' => 'checkbox',
'#title' => t('Display label'),
'#default_value' => variable_get('custom_search_label_visibility', TRUE),
);
$form['search_box']['custom_search_label'] = array(
'#type' => 'textfield',
'#title' => t('Search box label'),
'#default_value' => variable_get('custom_search_label', CUSTOM_SEARCH_LABEL_DEFAULT),
'#description' => t('Enter the label text for the search box. The default value is "!default".', array('!default' => CUSTOM_SEARCH_LABEL_DEFAULT)),
);
$form['search_box']['custom_search_text'] = array(
'#type' => 'textfield',
'#title' => t('Search box default text'),
'#default_value' => variable_get('custom_search_text', ''),
'#description' => t('This will change the default text inside the search form. Leave blank for no text. This field is blank by default.'),
);

// Submit button.
$form['submit_button'] = array(
'#type' => 'fieldset',
'#title' => t('Submit button'),
);
$form['submit_button']['custom_search_submit_text'] = array(
'#type' => 'textfield',
'#title' => t('Submit button text'),
'#default_value' => variable_get('custom_search_submit_text', CUSTOM_SEARCH_SUBMIT_TEXT_DEFAULT),
'#description' => t('Enter the text for the submit button. Leave blank to hide it. The default value is "!default".', array('!default' => CUSTOM_SEARCH_SUBMIT_TEXT_DEFAULT)),
);
$form['submit_button']['custom_search_image_path'] = array(
'#type' => 'textfield',
'#title' => t('Submit image path'),
'#description' => t('The path to the file you would like to use as submit button instead of the default text button.'),
'#default_value' => variable_get('custom_search_image_path', ''),
);
$form['submit_button']['custom_search_image'] = array(
'#type' => 'file',
'#title' => t('Submit image'),
'#description' => t('If you don\'t have direct file access to the server, use this field to upload your image.'),
);

// Criteria.
$form['criteria'] = array(
'#type' => 'fieldset',
'#title' => t('Advanced search criteria'),
);
$form['criteria']['or'] = array(
'#type' => 'fieldset',
'#title' => t('Or'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['criteria']['or']['custom_search_criteria_or_display'] = array(
'#type' => 'checkbox',
'#title' => t('Display'),
'#default_value' => variable_get('custom_search_criteria_or_display', FALSE),
);
$form['criteria']['or']['custom_search_criteria_or_label'] = array(
'#type' => 'textfield',
'#title' => t('Label'),
'#default_value' => variable_get('custom_search_criteria_or_label', CUSTOM_SEARCH_CRITERIA_OR_LABEL_DEFAULT),
'#description' => t('Enter the label text for this field. The default value is "!default".', array('!default' => CUSTOM_SEARCH_CRITERIA_OR_LABEL_DEFAULT)),
);
$form['criteria']['phrase'] = array(
'#type' => 'fieldset',
'#title' => t('Phrase'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['criteria']['phrase']['custom_search_criteria_phrase_display'] = array(
'#type' => 'checkbox',
'#title' => t('Display'),
'#default_value' => variable_get('custom_search_criteria_phrase_display', FALSE),
);
$form['criteria']['phrase']['custom_search_criteria_phrase_label'] = array(
'#type' => 'textfield',
'#title' => t('Label'),
'#default_value' => variable_get('custom_search_criteria_phrase_label', CUSTOM_SEARCH_CRITERIA_PHRASE_LABEL_DEFAULT),
'#description' => t('Enter the label text for this field. The default value is "!default".', array('!default' => CUSTOM_SEARCH_CRITERIA_PHRASE_LABEL_DEFAULT)),
);
$form['criteria']['negative'] = array(
'#type' => 'fieldset',
'#title' => t('Negative'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['criteria']['negative']['custom_search_criteria_negative_display'] = array(
'#type' => 'checkbox',
'#title' => t('Display'),
'#default_value' => variable_get('custom_search_criteria_negative_display', FALSE),
);
$form['criteria']['negative']['custom_search_criteria_negative_label'] = array(
'#type' => 'textfield',
'#title' => t('Label'),
'#default_value' => variable_get('custom_search_criteria_negative_label', CUSTOM_SEARCH_CRITERIA_NEGATIVE_LABEL_DEFAULT),
'#description' => t('Enter the label text for this field. The default value is "!default".', array('!default' => CUSTOM_SEARCH_CRITERIA_NEGATIVE_LABEL_DEFAULT)),
);

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

// Ordering.
$form = array_merge($form, _custom_search_ordering_admin_form());
$form['order'] = array(
'#type' => 'fieldset',
'#title' => t('Elements ordering'),
);
$form['order']['custom_search_order'] = array(
'#tree' => TRUE,
'#theme' => 'custom_search_sort_form',
);
$form['order']['custom_search_order']['search_box'] = array(
'#title' => t('Search Box'),
'sort' => array('#type' => 'weight', '#default_value' => variable_get('custom_search_search_box_weight', -1)),
'#weight' => variable_get('custom_search_search_box_weight', -1),
);
if (count(array_filter(array_merge(variable_get('custom_search_node_types', array()), variable_get('custom_search_other', array()))))) {
$form['order']['custom_search_order']['content_types'] = array(
'#title' => t('Content Types'),
'sort' => array('#type' => 'weight', '#default_value' => variable_get('custom_search_content_types_weight', 0)),
'#weight' => variable_get('custom_search_content_types_weight', 0),
);
}
$form['order']['custom_search_order']['criteria_or'] = array(
'#title' => t('Advanced search criterion: Or'),
'sort' => array('#type' => 'weight', '#default_value' => variable_get('custom_search_criteria_or_weight', 6)),
'#weight' => variable_get('custom_search_criteria_or_weight', 6),
);
$form['order']['custom_search_order']['criteria_phrase'] = array(
'#title' => t('Advanced search criterion: Phrase'),
'sort' => array('#type' => 'weight', '#default_value' => variable_get('custom_search_criteria_phrase_weight', 7)),
'#weight' => variable_get('custom_search_criteria_phrase_weight', 7),
);
$form['order']['custom_search_order']['criteria_negative'] = array(
'#title' => t('Advanced search criterion: Negative'),
'sort' => array('#type' => 'weight', '#default_value' => variable_get('custom_search_criteria_negative_weight', 8)),
'#weight' => variable_get('custom_search_criteria_negative_weight', 8),
);
$form['order']['custom_search_order']['custom_paths'] = array(
'#title' => t('Custom search paths'),
'sort' => array('#type' => 'weight', '#default_value' => variable_get('custom_search_custom_paths_weight', 9)),
'#weight' => variable_get('custom_search_custom_paths_weight', 9),
);
$form['order']['custom_search_order']['submit_button'] = array(
'#title' => t('Submit button'),
'sort' => array('#type' => 'weight', '#default_value' => variable_get('custom_search_submit_button_weight', 10)),
'#weight' => variable_get('custom_search_submit_button_weight', 10),
);

$form['#attributes'] = array('enctype' => 'multipart/form-data');
$form['#submit'][] = 'custom_search_admin_submit';
Expand All @@ -33,12 +192,30 @@ function custom_search_admin() {
function custom_search_admin_submit($form, &$form_state) {
foreach ($form_state['values']['custom_search_order'] as $key => $data) {
variable_set('custom_search_' . $key . '_weight', $data['sort']);
variable_set('custom_search_' . $key . '_region', $data['region']);
}
}

/**
* Theme the re-ordering form.
*/
function theme_custom_search_sort_form($form) {
drupal_add_tabledrag('custom-search-sort', 'order', 'sibling', 'sort');
$header = array(t('Elements'), 'sort');
foreach (element_children($form) as $key) {
// Add class to group weight fields for drag and drop.
$form[$key]['sort']['#attributes']['class'] = 'sort';
$row = array();
$row[] = $form[$key]['#title'];
$row[] = drupal_render($form[$key]['sort']);
$rows[] = array('data' => $row, 'class' => 'draggable');
}
$output = theme('table', $header, $rows, array('id' => 'custom-search-sort'));
$output .= drupal_render($form);
return $output;
}

function custom_search_content_admin() {
return system_settings_form(_custom_search_content_admin_form());
return system_settings_form(custom_search_content_admin_form());
}

function custom_search_results_admin() {
Expand Down Expand Up @@ -72,16 +249,6 @@ function custom_search_results_admin() {
'#title' => t('Display advanced search'),
'#default_value' => variable_get('custom_search_results_advanced_search', TRUE),
);
$form['search_form']['advanced']['custom_search_results_advanced_search_collapsible'] = array(
'#type' => 'checkbox',
'#title' => t('Collapsible'),
'#default_value' => variable_get('custom_search_results_advanced_search_collapsible', TRUE),
);
$form['search_form']['advanced']['custom_search_results_advanced_search_collapsed'] = array(
'#type' => 'checkbox',
'#title' => t('Collapsed'),
'#default_value' => variable_get('custom_search_results_advanced_search_collapsed', TRUE),
);
$form['search_form']['advanced']['criteria'] = array(
'#type' => 'fieldset',
'#title' => t('Criteria'),
Expand Down Expand Up @@ -120,24 +287,6 @@ function custom_search_results_admin() {
);
}

if (module_exists('taxonomy')) {
$form['search_form']['advanced']['taxonomy'] = array(
'#type' => 'fieldset',
'#title' => t('Taxonomy'),
'#description' => t('Select the vocabularies to display on the advanced search form.'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$vocabularies = taxonomy_get_vocabularies();
foreach ($vocabularies as $voc) {
$form['search_form']['advanced']['taxonomy']['custom_search_advanced_voc' . $voc->vid . '_display'] = array(
'#type' => 'checkbox',
'#title' => $voc->name,
'#default_value' => variable_get('custom_search_advanced_voc' . $voc->vid . '_display', TRUE),
);
}
}

$form['results'] = array(
'#type' => 'fieldset',
'#title' => t('Results'),
Expand Down
14 changes: 1 addition & 13 deletions sites/all/modules/custom_search/custom_search.css
@@ -1,16 +1,4 @@

#elements tr.region-message {
font-weight: normal;
color: #999;
}
#elements tr.region-populated {
display: none;
}

fieldset.custom_search-popup {
display: none;
position: absolute;
}
/* $Id: custom_search.css,v 1.1 2010/03/03 11:01:05 jdanthinne Exp $ */

input.custom-search-default-value { color:#999;}
.element-invisible {
Expand Down
29 changes: 26 additions & 3 deletions sites/all/modules/custom_search/custom_search.info
@@ -1,11 +1,34 @@
; $Id: custom_search.info,v 1.1.2.9 2010/05/04 17:04:48 jdanthinne Exp $
name = Custom Search
description = Customize the default search, change labels, default texts, ordering, and display content types and taxonomy selectors.
core = 6.x
package = Custom Search
dependencies[] = search
; Information added by Drupal.org packaging script on 2014-04-02
version = "6.x-1.12"

; Information added by drupal.org packaging script on 2010-04-30
version = "6.x-1.x-dev"
core = "6.x"
project = "custom_search"
datestamp = "1272629076"


; Information added by drupal.org packaging script on 2010-05-02
version = "6.x-1.x-dev"
core = "6.x"
project = "custom_search"
datestamp = "1272758640"


; Information added by drupal.org packaging script on 2010-05-03
version = "6.x-1.x-dev"
core = "6.x"
project = "custom_search"
datestamp = "1272845023"


; Information added by drupal.org packaging script on 2010-06-07
version = "6.x-1.4"
core = "6.x"
project = "custom_search"
datestamp = "1396449571"
datestamp = "1275894013"

20 changes: 3 additions & 17 deletions sites/all/modules/custom_search/custom_search.install
@@ -1,4 +1,5 @@
<?php
// $Id: custom_search.install,v 1.1.2.8 2010/06/01 10:33:04 jdanthinne Exp $

/**
* @file
Expand All @@ -10,6 +11,7 @@
*/
function custom_search_install() {
db_query("UPDATE {system} SET weight = 100 WHERE name = 'custom_search'");
drupal_set_message(st('Custom Search enabled. Don\'t forget to <a href="@link">set permissions</a>.', array('@link' => url('admin/user/permissions#module-custom_search'))));
}

/**
Expand All @@ -19,8 +21,6 @@ function custom_search_uninstall() {
variable_del('custom_search_label_visibility');
variable_del('custom_search_label');
variable_del('custom_search_text');
variable_del('custom_search_size');
variable_del('custom_search_max_length');
variable_del('custom_search_submit_text');
variable_del('custom_search_image_path');
variable_del('custom_search_criteria_or_display');
Expand All @@ -30,37 +30,23 @@ function custom_search_uninstall() {
variable_del('custom_search_criteria_negative_display');
variable_del('custom_search_criteria_negative_label');
variable_del('custom_search_paths');
variable_del('custom_search_paths_selector');
variable_del('custom_search_paths_selector_label');
variable_del('custom_search_paths_selector_label_visibility');
variable_del('custom_search_search_box_weight');
variable_del('custom_search_content_types_weight');
variable_del('custom_search_criteria_or_weight');
variable_del('custom_search_criteria_phrase_weight');
variable_del('custom_search_criteria_negative_weight');
variable_del('custom_search_custom_paths_weight');
variable_del('custom_search_submit_button_weight');
variable_del('custom_search_search_box_region');
variable_del('custom_search_content_types_region');
variable_del('custom_search_criteria_or_region');
variable_del('custom_search_criteria_phrase_region');
variable_del('custom_search_criteria_negative_region');
variable_del('custom_search_custom_paths_region');
variable_del('custom_search_submit_button_region');
variable_del('custom_search_target');
variable_del('custom_search_node_types');
variable_del('custom_search_node_types_excluded');
variable_del('custom_search_other');
variable_del('custom_search_type_selector');
variable_del('custom_search_type_selector_label');
variable_del('custom_search_type_selector_label_visibility');
variable_del('custom_search_type_selector_all');
variable_del('custom_search_any_restricts');
variable_del('custom_search_any_force');
variable_del('custom_search_results_search');
variable_del('custom_search_results_advanced_search');
variable_del('custom_search_results_advanced_search_collapsible');
variable_del('custom_search_results_advanced_search_collapsed');
variable_del('custom_search_advanced_or_display');
variable_del('custom_search_advanced_phrase_display');
variable_del('custom_search_advanced_negative_display');
Expand All @@ -79,7 +65,7 @@ function custom_search_uninstall() {
* Implementation of hook_enable().
*/
function custom_search_enable() {
drupal_set_message(t('Custom Search enabled. Don\'t forget to <a href="@link">set permissions</a>.', array('@link' => url('admin/user/permissions', array('fragment' => 'module-custom_search')))));
drupal_set_message(t('Custom Search enabled. Don\'t forget to <a href="@link">set permissions</a>.', array('@link' => url('admin/user/permissions#module-custom_search'))));
}

/**
Expand Down

0 comments on commit 7f488cb

Please sign in to comment.