Minor cleanup.
[mkdru-moved-to-drupal.org.git] / mkdru.admin.inc
index c07ac31..f7a1138 100644 (file)
@@ -1,40 +1,15 @@
 <?php
-function jsdemo2_admin_settings() {
-  $form['jsdemo2_author_max']=array(
+/**
+ * @file
+ * Module config.
+ */
+function mkdru_admin_settings() {
+  $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(
-    '#type' => 'textfield',
-    '#title' => t('Maximum sources to display'),
-    '#default_value' => variable_get('jsdemo2_source_max', 16),
-    '#size' => 3,
-    '#maxlength' => 3,
-  );
-
-  $form['jsdemo2_subject_max']=array(
-    '#type' => 'textfield',
-    '#title' => t('Maximum subjects to display'),
-    '#default_value' => variable_get('jsdemo2_subject_max', 10),
-    '#size' => 3,
-    '#maxlength' => 3,
-  );
-
   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.'));
-  }
-}