X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=mkdru.admin.inc;h=779cd5d786bb95af7bcbdcbc4ecd08a8f99e339b;hb=db5b797778922d50919364399c90411dfdfb712a;hp=c07ac31ec73a9085627145f9e6035baad5a9c8a3;hpb=e4a8cff5ea6f81be77a9431ac7e7aa98b20b0248;p=mkdru-moved-to-drupal.org.git diff --git a/mkdru.admin.inc b/mkdru.admin.inc index c07ac31..779cd5d 100644 --- a/mkdru.admin.inc +++ b/mkdru.admin.inc @@ -1,40 +1,54 @@ '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.')); - } -}