'#required' => TRUE,
'#default_value' => isset($node->mkdru->pz2_path) ? $node->mkdru->pz2_path : '/pazpar2/search.pz2',
);
- $form['search_settings']['sp_user'] = array(
+ $form['search_settings']['use_sessions'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Session handling'),
+ '#description' => t('Disable for use with Service Proxy'),
+ '#default_value' => isset($node->mkdru->use_sessions) ? $node->mkdru->use_sessions : 1,
+ );
+
+ $form['sp_settings'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Service Proxy specific settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE
+ );
+ $form['sp_settings']['sp_user'] = array(
'#type' => 'textfield',
- '#title' => t('Service Proxy username (optional)'),
- '#description' => t('Service-Proxy username'),
+ '#title' => t('Service Proxy username'),
+ '#description' => t('Service Proxy username'),
'#required' => FALSE,
'#default_value' => isset($node->mkdru->sp_user) ?
$node->mkdru->sp_user : '',
);
- $form['search_settings']['sp_pass'] = array(
+ $form['sp_settings']['sp_pass'] = array(
'#type' => 'textfield',
- '#title' => t('Service Proxy password (optional)'),
- '#description' => t('Service-Proxy password'),
+ '#title' => t('Service Proxy password'),
+ '#description' => t('Service Proxy password'),
'#required' => FALSE,
'#default_value' => isset($node->mkdru->sp_pass) ?
$node->mkdru->sp_pass : '',
);
- $form['search_settings']['use_sessions'] = array(
- '#type' => 'checkbox',
- '#title' => t('Session handling'),
- '#description' => t('Disable for use with Service Proxy'),
- '#default_value' => isset($node->mkdru->use_sessions) ? $node->mkdru->use_sessions : 1,
- );
$form['display_settings'] = array(
'#type' => 'fieldset',
* Implementation of hook_insert().
*/
function mkdru_insert($node) {
- db_query("INSERT INTO {mkdru} (nid, vid, pz2_path, use_sessions, source_max, author_max, subject_max, sp_user, sp_pass) ".
- "VALUES (%d, %d, '%s', %d, %d, %d, %d, '%s', '%s')",
- $node->nid, $node->vid, $node->pz2_path, $node->use_sessions, $node->source_max, $node->author_max, $node->subject_max, $node->sp_user, $node->sp_pass);
+ drupal_write_record('mkdru', $node);
}
/**
mkdru_insert($node);
}
else {
- db_query("UPDATE {mkdru} SET pz2_path = '%s', use_sessions = %d, source_max = %d, author_max = %d, subject_max = %d, sp_user = '%s', sp_pass = '%s' WHERE vid = %d", $node->pz2_path, $node->use_sessions, $node->source_max, $node->author_max, $node->subject_max, $node->vid);
+ drupal_write_record('mkdru', $node, 'vid');
}
}