summaryrefslogtreecommitdiff
path: root/settings.inc
blob: 90cbc0fb67e4cdf3f6858256b85e2fe03edf7379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
	function tbc_solr_search_settings_form($form, &$form_state) {

		$form['tbc_example_file_path'] = array(
			'#type' => 'textfield',
			'#title' => t('TBC Example File Path'),
			'#size' => 50,
			'#required' => TRUE,
			'#default_value' => variable_get('tbc_example_file_path', ''),
		);
		
		$form['tbc_solr_max_results'] = array(
			'#type' => 'textfield',
			'#title' => t('Solr max results'),
			'#size' => 50,
			'#required' => TRUE,
			'#default_value' => variable_get('tbc_solr_max_results', ''),
		);
		$form['tbc_r_cloud_url'] = array(
			'#type' => 'textfield',
			'#title' => t('R on Cloud URL for post request'),
			'#size' => 50,
			'#required' => TRUE,
			'#default_value' => variable_get('tbc_r_cloud_url', ''),
		);
		$form['submit'] = array(
			'#type' => 'submit',
			'#value' => t('Submit')
		);
		
		return $form;
	}
	
	function tbc_solr_search_settings_form_submit($form, &$form_state) {

		variable_set('tbc_example_file_path', $form_state['values']['tbc_example_file_path']);
		variable_set('tbc_solr_max_results', $form_state['values']['tbc_solr_max_results']);
		variable_set('tbc_r_cloud_url', $form_state['values']['tbc_r_cloud_url']);


		drupal_set_message(t('Settings Updated Successfully!'), 'status');
	}