X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=mkdru.install;h=29b5b954a7dd00fd72b2070eef9005db4dc279cd;hb=refs%2Fheads%2Fmaster;hp=e136c59e91669c48462387c1ba37f9872dffa157;hpb=89996d58c6ef47fdba1944a4d4c6fde026f07d63;p=mkdru-moved-to-drupal.org.git diff --git a/mkdru.install b/mkdru.install index e136c59..29b5b95 100644 --- a/mkdru.install +++ b/mkdru.install @@ -1,12 +1,11 @@ TRUE, 'default' => 0 ), - 'pz2_path' => array( + 'settings' => array( 'type' => 'text', 'not null' => TRUE, - 'description' => t('Path to Pazpar2 or Service Proxy.') - ), - 'use_sessions' => array( - 'description' => t('Session handling toggle.'), - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'source_max' => array( - 'description' => t('Number of sources to display'), - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'author_max' => array( - 'description' => t('Number of authors to display'), - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'subject_max' => array( - 'description' => t('Number of subjects to display'), - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'sp_user' => array( - 'type' => 'text', - 'not null' => FALSE, - 'description' => t('Service Proxy username') - ), - 'sp_pass' => array( - 'type' => 'text', - 'not null' => FALSE, - 'description' => t('Service Proxy password') + 'description' => 'Metasearch settings', ), ), 'primary key' => array('nid', 'vid'), @@ -74,28 +39,46 @@ function mkdru_schema() { } /** -* Implementation of hook_install(). +* Implements hook_install(). */ function mkdru_install() { // Disable comments by default variable_set('comment_mkdru', COMMENT_NODE_DISABLED); // Create table. drupal_install_schema('mkdru'); + // Default settings + $settings['pz2_path'] = "/pazpar2/search.pz2"; + $settings['use_sessions'] = 1; + $settings['sp']['user'] = ""; + $settings['sp']['pass'] = ""; + $settings['facets']['source']['displayName'] = "Source"; + $settings['facets']['source']['pz2Name'] = "xtargets"; + $settings['facets']['source']['limiter'] = NULL; + $settings['facets']['source']['multiLimit'] = NULL; + $settings['facets']['source']['max'] = 10; + $settings['facets']['source']['orderWeight'] = 1; + $settings['facets']['subject']['displayName'] = "Subject"; + $settings['facets']['subject']['pz2Name'] = "subject"; + $settings['facets']['subject']['limiter'] = "su"; + $settings['facets']['subject']['multiLimit'] = 1; + $settings['facets']['subject']['max'] = 10; + $settings['facets']['subject']['orderWeight'] = 2; + $settings['facets']['author']['displayName'] = "Author"; + $settings['facets']['author']['pz2Name'] = "author"; + $settings['facets']['author']['limiter'] = "au"; + $settings['facets']['author']['multiLimit'] = 0; + $settings['facets']['author']['max'] = 10; + $settings['facets']['author']['orderWeight'] = 3; + variable_set('mkdru_defaults', $settings); } /** -* Implementation of hook_uninstall(). +* Implements hook_uninstall(). */ function mkdru_uninstall() { // Drop table. drupal_uninstall_schema('mkdru'); // Delete variables variable_del('pz2_js_path'); -} - -function mkdru_update_6100() { - $ret = array(); - db_add_field($ret, 'mkdru', 'sp_user', array('type' => 'varchar', 'length' => 32, 'not null' => FALSE, 'default' => '') ); - db_add_field($ret, 'mkdru', 'sp_pass', array('type' => 'varchar', 'length' => 32, 'not null' => FALSE, 'default' => '') ); - return $ret; -} + variable_del('mkdru_defaults'); +} \ No newline at end of file