function mkdru_admin_settings() {
$form['pz2_js_path']=array(
'#type' => 'textfield',
- '#title' => t('Path to Pazpar2 client library, pz2.js'),
- '#default_value' => variable_get('pz2_js_path', '/pazpar2/pz2.js'),
+ '#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
);
return system_settings_form($form);
// UI functions:
mkdru.submitQuery = function () {
mkdru.submitted = true;
-// mkdru.resetPage();
+ mkdru.resetPage();
// mkdru.pollDropDowns();
mkdru.search();
return false;
mkdru.recPerPage = $('#mkdru-perpage').value;
mkdru.curSort = $('#mkdru-sort').value;
if (!mkdru.submitted) return false;
- mkdru.resetPage();
- mkdru.pz2.show(0, mkdru.recPerPage, mkdru.curSort);
+// mkdru.resetPage();
+// mkdru.pz2.show(0, mkdru.recPerPage, mkdru.curSort);
};
mkdru.limitQuery = function (field, value) {
navi.innerHTML += '<hr/>';
mkdru.curFilter = 'pz:id=' + id;
mkdru.resetPage();
- mkdru.pollDropDowns();
+// mkdru.pollDropDowns();
mkdru.search();
return false;
};
// Module metainfo
/**
-* Implementation of hook_node_info().
+* Implementation of hook_node_info()
*/
function mkdru_node_info() {
return array(
}
/**
-* Implementation of hook_perm().
+* Implementation of hook_perm()
*/
function mkdru_perm() {
return array('create metasearch interface', 'edit any metasearch interface', 'edit own metasearch interface');
}
/**
-* Implementation of hook_access().
+* Implementation of hook_access()
*/
function mkdru_access($op, $node, $account) {
}
}
+/**
+* Implementation of hook_menu()
+*/
+function mkdru_menu() {
+ $items['admin/settings/mkdru'] = array(
+ 'title' => 'mkdru Settings',
+ 'description' => 'Settings for mkdru.',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('mkdru_admin_settings'),
+ 'access arguments' => array('administer site configuration'),
+ 'type' => MENU_NORMAL_ITEM,
+ 'file' => 'mkdru.admin.inc',
+ );
+ return $items;
+}
// Node config
/**
-* Implementation of hook_form().
+* Implementation of hook_form()
*/
function mkdru_form(&$node, $form_state) {
$type = node_get_types('type', $node);
* 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) VALUES (%d, %d, '%s', %d, %d, %d)",
+ db_query("INSERT INTO {mkdru} (nid, vid, pz2_path, use_sessions, source_max, author_max, subject_max) VALUES (%d, %d, '%s', %d, %d, %d, %d)",
$node->nid, $node->vid, $node->pz2_path, $node->use_sessions, $node->source_max, $node->author_max, $node->subject_max);
}
*/
function theme_mkdru_page_js($node) {
$path = drupal_get_path('module', 'mkdru');
- drupal_add_js('pazpar2/js/pz2.js', 'module', 'footer');
+ // Include client library.
+ drupal_add_js(variable_get('pz2_js_path', 'pazpar2/js') . '/pz2.js', 'module', 'footer');
drupal_add_js($path . '/mkdru.theme.js', 'module', 'footer');
drupal_add_js($path . '/mkdru.client.js', 'module', 'footer');
drupal_add_js(array('mkdru' => $node->mkdru), 'setting');