<?php
-function jsdemo2_admin_settings() {
- $form['jsdemo2_author_max']=array(
+function mkdru_admin_settings($form, &$form_state) {
+ $form['pz2_js_path']=array(
'#type' => 'textfield',
- '#title' => t('Maximum authors to display'),
- '#default_value' => variable_get('jsdemo2_author_max', 10),
- '#size' => 3,
- '#maxlength' => 3,
+ '#title' => t('Path to Pazpar2 client library'),
+ '#description' => t('Absolute path to the directory containing pz2.js within the current domain. Do not include leading slash.'),
+ '#default_value' => variable_get('pz2_js_path', 'pazpar2/js'),
+ '#required' => TRUE
);
-
- $form['jsdemo2_source_max']=array(
+ $form['search_settings'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Pazpar2/Service Proxy search settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => FALSE
+ );
+ $form['search_settings']['pz2_path'] = array(
'#type' => 'textfield',
- '#title' => t('Maximum sources to display'),
- '#default_value' => variable_get('jsdemo2_source_max', 16),
- '#size' => 3,
- '#maxlength' => 3,
+ '#title' => t('Pazpar2/Service Proxy path'),
+ '#description' => t('Path that takes Pazpar2 commands via HTTP'),
+ '#required' => TRUE,
+ '#default_value' => variable_get('pz2_path','/pazpar2/search.pz2')
+ );
+ $form['search_settings']['use_sessions'] = array(
+ '#type' => 'checkbox', '#title' => t('Session handling'),
+ '#description' => t('Disable for use with Service Proxy'),
+ '#default_value' => variable_get('use_sessions', '1')
);
- $form['jsdemo2_subject_max']=array(
+ $form['sp_settings'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Service Proxy specific settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => FALSE
+ );
+ $form['sp_settings']['sp_user'] = array(
'#type' => 'textfield',
- '#title' => t('Maximum subjects to display'),
- '#default_value' => variable_get('jsdemo2_subject_max', 10),
- '#size' => 3,
- '#maxlength' => 3,
+ '#title' => t('Service Proxy username'),
+ '#description' => t('Service Proxy username'),
+ '#required' => FALSE,
+ '#default_value' => variable_get('sp_user','')
+ );
+ $form['sp_settings']['sp_pass'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Service Proxy password'),
+ '#description' => t('Service Proxy password'),
+ '#required' => FALSE,
+ '#default_value' => variable_get('sp_pass','')
);
return system_settings_form($form);
}
-
-function jsdemo2_admin_settings_validate($form, $form_state) {
- if (!is_numeric($form_state['values']['jsdemo2_source_max'])) {
- form_set_error('jsdemo2_source_max', t('Please enter a number.'));
- }
- if (!is_numeric($form_state['values']['jsdemo2_author_max'])) {
- form_set_error('jsdemo2_author_max', t('Please enter a number.'));
- }
- if (!is_numeric($form_state['values']['jsdemo2_subject_max'])) {
- form_set_error('jsdemo2_subject_max', t('Please enter a number.'));
- }
-}