X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=mkdru.install;h=1792f227ef6b2d7ffa38ed4934eec9dfb42c3c59;hb=86d594983bbb678adc76ca885f8c21cc4485f448;hp=594fd018851748437340878a50e26a6fd770bef8;hpb=859520d0edf2494a96e7ec128ee85ef95d41b3da;p=mkdru-moved-to-drupal.org.git diff --git a/mkdru.install b/mkdru.install index 594fd01..1792f22 100644 --- a/mkdru.install +++ b/mkdru.install @@ -26,44 +26,10 @@ function mkdru_schema() { 'not null' => 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'), @@ -81,6 +47,31 @@ function mkdru_install() { 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'] = TRUE; + $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'] = FALSE; + $settings['facets']['author']['max'] = 10; + $settings['facets']['author']['orderWeight'] = 3; + variable_set('mkdru_defaults', $settings); + variable_set('mkdru_ding', $settings); } /** @@ -91,11 +82,6 @@ function mkdru_uninstall() { 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'); + variable_del('mkdru_ding'); +} \ No newline at end of file