X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=mkdru.install;h=280e7c816be0fe6440c2ff255f63a8c08fbee06c;hb=refs%2Fheads%2F7.x;hp=23d4de39050a1591d8ffffb6b0c4bcfa4cf1aef1;hpb=71f905d869983f2162082de22d8849732e5d3efa;p=mkdru-moved-to-drupal.org.git diff --git a/mkdru.install b/mkdru.install index 23d4de3..280e7c8 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' => 'Path to Pazpar2 or Service Proxy.', - ), - 'use_sessions' => array( - 'description' => 'Session handling toggle.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'source_max' => array( - 'description' => 'Number of sources to display', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'author_max' => array( - 'description' => 'Number of authors to display', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'subject_max' => array( - 'description' => 'Number of subjects to display', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'sp_user' => array( - 'type' => 'text', - 'not null' => FALSE, - 'description' => 'Service Proxy username' - ), - 'sp_pass' => array( - 'type' => 'text', - 'not null' => FALSE, - 'description' => 'Service Proxy password' + 'description' => 'Metasearch settings', ), ), 'primary key' => array('nid', 'vid'), @@ -78,7 +44,35 @@ function mkdru_schema() { */ function mkdru_install() { // Disable comments by default - variable_set('comment_mkdru', COMMENT_NODE_DISABLED); + variable_set('comment_mkdru', defined('COMMENT_NODE_HIDDEN') ? COMMENT_NODE_HIDDEN : NULL); + + + // Default settings + $settings['title'] = ""; + $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); + variable_set('mkdru_ding', $settings); } /** @@ -87,4 +81,8 @@ function mkdru_install() { function mkdru_uninstall() { // Delete variables variable_del('pz2_js_path'); -} \ No newline at end of file + variable_del('mkdru_defaults'); + variable_del('mkdru_ding'); + // Clear block visibility + db_delete('block_node_type')->condition('module', 'mkdru')->execute(); +}