ppound
3 years ago
8 changed files with 115 additions and 160 deletions
@ -1,24 +1,8 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* @file roblib-search-solr-site-results.tpl.php |
||||
* |
||||
* |
||||
* Variables available: |
||||
* - $variables: all array elements of $variables can be used as a variable. e.g. $base_url equals $variables['base_url'] |
||||
* |
||||
*/ |
||||
?> |
||||
<? |
||||
// Get rid of warnings in admin interface |
||||
if (!isset($type)){ |
||||
$type = 'results'; |
||||
} |
||||
?> |
||||
<div class ="roblib-search-more" id="roblib-search-solr-site-<?php echo $type;?>-more"></div> |
||||
<div class ="roblib-search-content solr-site-<?php echo $type;?>" id="roblib-search-content-solr-site-<?php echo $type;?>"> |
||||
<img src="<?php print (empty($spinner_path) ? ' ' : $spinner_path); ?>"/> |
||||
<div class ="roblib-search-more" id="roblib-search-solr-site-{{ solr_type }}-more"></div> |
||||
<div class ="roblib-search-content solr-site-{{ solr_type }}" id="roblib-search-content-solr-site-{{ solr_type }}"> |
||||
<img src="{{ spinner_path }}"/> |
||||
</div> |
||||
|
||||
<div id="roblib-solr-more-results-<?php print($type)?>" class="roblib-solr-more-button "></div> |
||||
<div id="roblib-solr-search-toc-<?php print($type)?>" class="roblib-bento-toc moveme-please"></div> |
||||
<div id="roblib-solr-more-results-{{ solr_type }}" class="roblib-solr-more-button "></div> |
||||
<div id="roblib-solr-search-toc-{{ solr_type }}" class="roblib-bento-toc moveme-please"></div> |
||||
|
@ -1,43 +0,0 @@
|
||||
<?php |
||||
|
||||
/* |
||||
* |
||||
*/ |
||||
|
||||
/** |
||||
* @param array $variables |
||||
* @param string $type |
||||
* |
||||
* @return string |
||||
*/ |
||||
function roblib_search_solr_site_preprocess_roblib_search_solr_site(&$variables){ |
||||
//function roblib_search_solr_site_preprocessor(&$variables, $type) { |
||||
global $base_url; |
||||
$type = $variables['type']; |
||||
if (!isset($query)) { |
||||
if (isset($_GET['roblib_query'])) { |
||||
$query = $_GET['roblib_query']; |
||||
} |
||||
else { |
||||
return ''; |
||||
} |
||||
} |
||||
$spinner_path = $base_url . '/' . drupal_get_path('module', 'roblib_search') . '/img/' . 'spinner.gif'; |
||||
$variables['spinner_path'] = $spinner_path; |
||||
$variables['type'] = $type; |
||||
$query = urlencode($query); |
||||
$search_url = $base_url . '/roblib_search/solr_site/' . $type . '/' . $query; |
||||
drupal_add_js(drupal_get_path('module', 'roblib_search_solr_site') . '/js/solr_site_' . $type . '.js'); |
||||
$key = 'roblib_search_solr_site_' . $type; |
||||
$default_module = variable_get('search_default_module', 'site') == 'apachesolr_search' |
||||
? 'site' : variable_get('search_default_module', 'site'); |
||||
|
||||
drupal_add_js(array( |
||||
$key => array( |
||||
'search_url' => $search_url, |
||||
'search_query' => $query, |
||||
'base_url' => $base_url, |
||||
'default_site_type' => $default_module |
||||
) |
||||
), array('type' => 'setting')); |
||||
} |
Loading…
Reference in new issue