From 2919bcb535f7de18bb8d653bedcb66095e9a65ad Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Mon, 4 Nov 2019 11:47:03 +0530 Subject: fixed issues --- README.md | 3 +-- settings.inc | 12 ++++++++++-- solr_search.module | 5 ++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index afdb537..8443b77 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # r_solr_search + This is used in R code search feature on R TBC website. ##### Requirements: @@ -7,5 +8,3 @@ This is used in R code search feature on R TBC website. ##### Author: > Prashant Sinalkar > FOSSEE, IIT Bombay - - diff --git a/settings.inc b/settings.inc index cd02e2c..90cbc0f 100755 --- a/settings.inc +++ b/settings.inc @@ -1,5 +1,5 @@ 'textfield', @@ -16,7 +16,13 @@ '#required' => TRUE, '#default_value' => variable_get('tbc_solr_max_results', ''), ); - + $form['tbc_r_cloud_url'] = array( + '#type' => 'textfield', + '#title' => t('R on Cloud URL for post request'), + '#size' => 50, + '#required' => TRUE, + '#default_value' => variable_get('tbc_r_cloud_url', ''), + ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Submit') @@ -29,6 +35,8 @@ variable_set('tbc_example_file_path', $form_state['values']['tbc_example_file_path']); variable_set('tbc_solr_max_results', $form_state['values']['tbc_solr_max_results']); + variable_set('tbc_r_cloud_url', $form_state['values']['tbc_r_cloud_url']); + drupal_set_message(t('Settings Updated Successfully!'), 'status'); } diff --git a/solr_search.module b/solr_search.module index 7574924..b945786 100755 --- a/solr_search.module +++ b/solr_search.module @@ -165,9 +165,8 @@ function add_all_books_to_solr_form_submit($form, &$form_state) function ajax_solr_search_result_callback($form, $form_state) { + $cloud_url = variable_get('tbc_r_cloud_url', ''); $output = ''; - //$key = ''; - //var_dump($form_state['values']['tbc_search_key']);die; $path = drupal_get_path('module', 'solr_search'); drupal_add_css($path . '/solr_search.css', 'module'); drupal_add_js($path . '/solr_search.js', 'module'); @@ -210,7 +209,7 @@ function ajax_solr_search_result_callback($form, $form_state) $output .= '
Book: ' . $doc->title . ' (' . $doc->author . ')
'; $output .= 'Chapter: ' . $doc->chapter[0] . '
'; $output .= 'Example: ' . $doc->example[0] . '
'; - $output .= 'Links: ⤵ Download entire book » View this example
'; + $output .= 'Links: ⤵ Download entire book » View this example
'; $output .= ''; } $output .= '