From dea01bd1025c5367ed59b013e581a21f0d7d6bf4 Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Thu, 30 May 2019 20:14:53 +0000 Subject: [PATCH 01/11] Add RSS limit option --- islandora_solr_config/includes/admin.inc | 11 +++++++++-- islandora_solr_config/includes/rss_results.inc | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/islandora_solr_config/includes/admin.inc b/islandora_solr_config/includes/admin.inc index b3a990aa..89288394 100644 --- a/islandora_solr_config/includes/admin.inc +++ b/islandora_solr_config/includes/admin.inc @@ -31,6 +31,7 @@ function islandora_solr_config_admin_rss_settings($form, &$form_state) { 'managingEditor' => '', 'webMaster' => '', )); + $rss_limit = variable_get('islandora_solr_config_rss_limit', 50); $form = array( '#tree' => TRUE, @@ -110,6 +111,12 @@ function islandora_solr_config_admin_rss_settings($form, &$form_state) { '#description' => t('Email address for person responsible for technical issues relating to channel.'), '#default_value' => $rss_channel['webMaster'] ? $rss_channel['webMaster'] : '', ); + $form['rss_limit'] = array( + '#type' => 'textfield', + '#title' => 'RSS results limit', + '#description' => 'Maximum number of results via RSS.', + '#default_value' => $rss_limit, + ); $form['buttons']['submit'] = array( '#type' => 'submit', '#value' => t('Save'), @@ -120,7 +127,6 @@ function islandora_solr_config_admin_rss_settings($form, &$form_state) { '#value' => t('Reset to defaults'), '#weight' => 51, ); - return $form; } @@ -135,10 +141,11 @@ function islandora_solr_config_admin_rss_settings_submit($form, &$form_state) { // Get values. $rss_item = $form_state['values']['rss_item']; $rss_channel = $form_state['values']['rss_channel']; - + $rss_limit = $form_state['values']['rss_limit']; // Set variable. variable_set('islandora_solr_config_rss_item', $rss_item); variable_set('islandora_solr_config_rss_channel', $rss_channel); + variable_set('islandora_solr_config_rss_limit', $rss_limit); } // On reset. diff --git a/islandora_solr_config/includes/rss_results.inc b/islandora_solr_config/includes/rss_results.inc index e2c52b26..df45a163 100644 --- a/islandora_solr_config/includes/rss_results.inc +++ b/islandora_solr_config/includes/rss_results.inc @@ -31,6 +31,8 @@ class IslandoraSolrResultsRSS extends IslandoraSolrResults { global $base_url; drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8'); + $islandora_solr_query->solrLimit = variable_get('islandora_solr_config_rss_limit', 50); + $islandora_solr_query->executeQuery(); // Get raw results. $solr_result = $islandora_solr_query->islandoraSolrResult; From 03613bd734a9219eac88bf70d025d228cb3c59e4 Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Thu, 30 May 2019 20:52:34 +0000 Subject: [PATCH 02/11] Add variable to install file --- islandora_solr_config/islandora_solr_config.install | 1 + 1 file changed, 1 insertion(+) diff --git a/islandora_solr_config/islandora_solr_config.install b/islandora_solr_config/islandora_solr_config.install index 30889cfd..45095d27 100644 --- a/islandora_solr_config/islandora_solr_config.install +++ b/islandora_solr_config/islandora_solr_config.install @@ -14,6 +14,7 @@ function islandora_solr_config_uninstall() { $variables = array( 'islandora_solr_table_profile_display_row_no', 'islandora_solr_table_profile_table_class', + 'islandora_solr_config_rss_limit', ); foreach ($variables as $variable) { variable_del($variable); From d0ced9f636883891bbe8164f2227f2c31443c27c Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Fri, 7 Jun 2019 18:57:34 +0000 Subject: [PATCH 03/11] Add atom feed --- .../includes/atom_results.inc | 236 ++++++++++++++++++ .../islandora_solr_config.module | 9 + 2 files changed, 245 insertions(+) create mode 100644 islandora_solr_config/includes/atom_results.inc diff --git a/islandora_solr_config/includes/atom_results.inc b/islandora_solr_config/includes/atom_results.inc new file mode 100644 index 00000000..311e0c7b --- /dev/null +++ b/islandora_solr_config/includes/atom_results.inc @@ -0,0 +1,236 @@ +solrLimit = variable_get('islandora_solr_config_rss_limit', 50); + $islandora_solr_query->executeQuery(); + + // Get raw results. + $solr_result = $islandora_solr_query->islandoraSolrResult; + + // All results. + $docs = $solr_result['response']['objects']; + + // Loop over results. + $items = NULL; + foreach ($docs as $doc) { + // Turn arrays into strings. + foreach ($doc['solr_doc'] as $key => $value) { + if (is_array($value)) { + // Turn array into comma separated string and trim. + $doc[$key] = trim(implode(', ', $value)); + } + else { + // Give it a trim. + $doc[$key] = trim($value); + } + } + // Get the variables for the element. + $item = $this->rssItem($doc); + + // Hook alter to change the rssItem before formatting. + drupal_alter('islandora_solr_search_rss_item', $item, $doc); + + // Render rss item. + $rendered_item = format_rss_item($item['title'], $item['link'], $item['description'], $item['items']); + + // ... allow it to be altered... + drupal_alter('islandora_solr_config_rss_item_post_render', $rendered_item, $doc); + + // ... and add to items string. + $items .= "$rendered_item\n"; + } + + // Query search terms: + $query = $islandora_solr_query->solrQuery; + + // Get the variables for the element. + $channel = $this->rssChannel($query); + drupal_alter('islandora_solr_config_rss_root_element_attributes', $channel, $items); + + // Give the results clean variable names. + $title = $channel['title']; + $url = $channel['url']; + $feed_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; + if (strpos($feed_url, '&page') == false) { + $page_number = '1'; + } + else { + $arr = explode('&page=', $feed_url); + $page_number = $arr[1]; + } + + $link_self = $feed_url; + if (isset($arr)) { + $link_first = $arr[0]; + } + else { + $link_first = $feed_url; + } + $page_next = $page_number + 1; + if ($page_number > 1) { + $page_prev = $page_number - 1; + } + $link_next = $link_first . '&page=' . $page_next; + if (isset($page_prev)) { + $link_prev = $link_first . '&page=' . $page_prev; + } + $description = $channel['description']; + $langcode = $channel['langcode']; + $args = $channel['args']; + + $output = "\n"; + $output .= '' . "\n"; + $output .= '' . "\n"; + $output .= '' . "\n"; + $output .= '' . "\n"; + if (isset($link_prev)) { + $output .= '' . "\n"; + } + $output .= format_rss_channel($title, $url, $description, $items, $langcode, $args); + $output .= "\n"; + + print $output; + exit; + } + + + /** + * Function for setting the values of the elements for the RSS display. + * + * @tutorial http://feed2.w3.org/docs/rss2.html#hrelementsOfLtitemgt + * + * @return array + * variable that holds all values to be rendered into elements + */ + public function rssItem($doc) { + // Set variables. + global $base_url; + + // Get variables. + $rss_item = variable_get('islandora_solr_config_rss_item', array( + 'title' => 'fgs_label_s', + 'description' => '', + 'author' => '', + 'category' => '', + 'pubDate' => 'fgs_createdDate_s', + 'enclosure_dsid' => 'TN', + )); + + // Object url. + $object_url = url('islandora/object/' . htmlspecialchars($doc['PID'], ENT_QUOTES, 'utf-8'), array('absolute' => TRUE)); + // Enclosure file url (thumbnail by default). + $dsid = ($rss_item['enclosure_dsid'] && isset($rss_item['enclosure_dsid'])) ? $rss_item['enclosure_dsid'] : 'TN'; + $doc['datastreams'] = isset($doc['datastreams']) ? $doc['datastreams'] : array(); + $is_datastream = in_array($dsid, $doc['datastreams']); + + if ($is_datastream) { + $enclosure_url = $object_url . '/datastream/' . $dsid; + } + + $rss_source = variable_get('site_name', "Default site name"); + + // Set the variables to be rendered as elements in the element. + $result = array(); + $result['title'] = ($rss_item['title'] && isset($doc[$rss_item['title']])) ? $doc[$rss_item['title']] : ''; + $result['link'] = $object_url; + $result['description'] = ($rss_item['description'] && isset($doc[$rss_item['description']])) ? $doc[$rss_item['description']] : ''; + $result['items'] = array( + array( + 'key' => 'author', + 'value' => ($rss_item['author'] && isset($doc[$rss_item['author']])) ? $doc[$rss_item['author']] : ''), + array( + 'key' => 'guid', + 'value' => $doc['PID'], + 'attributes' => array('isPermaLink' => 'false')), + array( + 'key' => 'pubDate', + 'value' => ($rss_item['pubDate'] && isset($doc[$rss_item['pubDate']])) ? $doc[$rss_item['pubDate']] : ''), + array( + 'key' => 'category', + 'value' => ($rss_item['category'] && isset($doc[$rss_item['category']])) ? $doc[$rss_item['category']] : ''), + array( + 'key' => 'comments', + 'value' => ''), + array( + 'key' => 'source', + 'value' => $rss_source, 'attributes' => array('url' => $base_url)), + ); + + if ($is_datastream) { + $result['items'][] = array( + 'key' => 'enclosure', + 'value' => '', 'attributes' => array( + 'url' => $enclosure_url, 'length' => '', + 'type' => '')); + } + + return $result; + } + + /** + * Function to set values of the elements for the RSS display. + * + * @tutorial http://feed2.w3.org/docs/rss2.html#requiredChannelElements + * + * @return array + * variable that holds all values to be rendered into elements + */ + public function rssChannel($query) { + // Set variables. + global $base_url; + $rss_channel = variable_get('islandora_solr_config_rss_channel', array( + 'copyright' => '', + 'managingEditor' => '', + 'webMaster' => '', + )); + + // Set the variables to be rendered as elements in the element. + $result = array(); + $result['title'] = t('@site_name aggregator', array('@site_name' => variable_get('site_name', 'Drupal'))); + $result['url'] = $base_url; + $result['description'] = t('Aggregated search results of: @query', array('@query' => $query)); + $result['langcode'] = NULL; + $result['args'] = array( + array( + 'key' => 'copyright', + 'value' => $rss_channel['copyright']), + array( + 'key' => 'managingEditor', + 'value' => $rss_channel['managingEditor']), + array( + 'key' => 'webMaster', + 'value' => $rss_channel['webMaster']), + ); + return $result; + } +} diff --git a/islandora_solr_config/islandora_solr_config.module b/islandora_solr_config/islandora_solr_config.module index fbe5ef5b..43dd7260 100644 --- a/islandora_solr_config/islandora_solr_config.module +++ b/islandora_solr_config/islandora_solr_config.module @@ -55,6 +55,15 @@ function islandora_solr_config_islandora_solr_secondary_display() { 'description' => t("Show search results as RSS feed"), 'logo' => '' . t(', ), + 'atom' => array( + 'name' => t('Atom'), + 'module' => 'islandora_solr_config', + 'file' => 'includes/atom_results.inc', + 'class' => 'IslandoraSolrResultsAtom', + 'function' => 'printAtom', + 'description' => t("Show search results as an Atom feed"), + 'logo' => '' . t(', + ), ); } From d4f61929cbb50cdf9f5ab17fddf70f60c29b7644 Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Mon, 10 Jun 2019 14:43:15 +0000 Subject: [PATCH 04/11] Hack to turn RSS to Atom --- .../includes/atom_results.inc | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/islandora_solr_config/includes/atom_results.inc b/islandora_solr_config/includes/atom_results.inc index 311e0c7b..aba2e8cf 100644 --- a/islandora_solr_config/includes/atom_results.inc +++ b/islandora_solr_config/includes/atom_results.inc @@ -62,6 +62,10 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { // Render rss item. $rendered_item = format_rss_item($item['title'], $item['link'], $item['description'], $item['items']); + $open_tag = ""; + $close_tag = ""; + $rendered_item = str_replace($open_tag, "", $rendered_item); + $rendered_item = str_replace($close_tag, "", $rendered_item); // ... allow it to be altered... drupal_alter('islandora_solr_config_rss_item_post_render', $rendered_item, $doc); @@ -110,13 +114,18 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { $output = "\n"; $output .= '' . "\n"; - $output .= '' . "\n"; - $output .= '' . "\n"; - $output .= '' . "\n"; + $output .= ' ' . "\n"; + $output .= ' ' . "\n"; if (isset($link_prev)) { - $output .= '' . "\n"; + $output .= ' ' . "\n"; } - $output .= format_rss_channel($title, $url, $description, $items, $langcode, $args); + $output .= ' '; + $strip_channel = format_rss_channel($title, $url, $description, $items, $langcode, $args); + $tags = array( + "", + "", + ); + $output .= str_replace($tags, "", $strip_channel); $output .= "\n"; print $output; @@ -172,6 +181,9 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { 'key' => 'guid', 'value' => $doc['PID'], 'attributes' => array('isPermaLink' => 'false')), + array( + 'key' => 'id', + 'value' => $doc['PID']), array( 'key' => 'pubDate', 'value' => ($rss_item['pubDate'] && isset($doc[$rss_item['pubDate']])) ? $doc[$rss_item['pubDate']] : ''), @@ -184,6 +196,9 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { array( 'key' => 'source', 'value' => $rss_source, 'attributes' => array('url' => $base_url)), + array( + 'key' => 'updated', + 'value' => $doc['fgs_lastModifiedDate_dt']), ); if ($is_datastream) { From db2efa993c865fb3f0ed9d038a481a1d1a9850f8 Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Mon, 10 Jun 2019 14:45:58 +0000 Subject: [PATCH 05/11] Remove updated because broken --- islandora_solr_config/includes/atom_results.inc | 3 --- 1 file changed, 3 deletions(-) diff --git a/islandora_solr_config/includes/atom_results.inc b/islandora_solr_config/includes/atom_results.inc index aba2e8cf..27cad97a 100644 --- a/islandora_solr_config/includes/atom_results.inc +++ b/islandora_solr_config/includes/atom_results.inc @@ -196,9 +196,6 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { array( 'key' => 'source', 'value' => $rss_source, 'attributes' => array('url' => $base_url)), - array( - 'key' => 'updated', - 'value' => $doc['fgs_lastModifiedDate_dt']), ); if ($is_datastream) { From 1744113d46551b8d5e57366929e029a8137b5955 Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Mon, 10 Jun 2019 17:19:58 +0000 Subject: [PATCH 06/11] Coding standards --- islandora_solr_config/includes/atom_results.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/islandora_solr_config/includes/atom_results.inc b/islandora_solr_config/includes/atom_results.inc index 27cad97a..1f5f0419 100644 --- a/islandora_solr_config/includes/atom_results.inc +++ b/islandora_solr_config/includes/atom_results.inc @@ -85,7 +85,7 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { $title = $channel['title']; $url = $channel['url']; $feed_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; - if (strpos($feed_url, '&page') == false) { + if (strpos($feed_url, '&page') == FALSE) { $page_number = '1'; } else { From f231e98ffa7886c6fd4d4223a7f26b98ca3b4bfc Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Tue, 11 Jun 2019 15:45:09 +0000 Subject: [PATCH 07/11] Documentation --- islandora_solr_config/includes/admin.inc | 2 +- islandora_solr_config/includes/atom_results.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/islandora_solr_config/includes/admin.inc b/islandora_solr_config/includes/admin.inc index 89288394..6f2d9403 100644 --- a/islandora_solr_config/includes/admin.inc +++ b/islandora_solr_config/includes/admin.inc @@ -114,7 +114,7 @@ function islandora_solr_config_admin_rss_settings($form, &$form_state) { $form['rss_limit'] = array( '#type' => 'textfield', '#title' => 'RSS results limit', - '#description' => 'Maximum number of results via RSS.', + '#description' => 'Maximum number of results via RSS or Atom.', '#default_value' => $rss_limit, ); $form['buttons']['submit'] = array( diff --git a/islandora_solr_config/includes/atom_results.inc b/islandora_solr_config/includes/atom_results.inc index 1f5f0419..f2fe1622 100644 --- a/islandora_solr_config/includes/atom_results.inc +++ b/islandora_solr_config/includes/atom_results.inc @@ -23,7 +23,7 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { * A solr query object. * * @return string - * html output for the resultset. Note: we currently create this + * XML output for the resultset. Note: we currently create this * output manually, should refactor to use drupal forms api. */ public function printAtom($islandora_solr_query, $title = "Search Results") { From 66bb148f8d724a56d282ef41559db87a3e70a06c Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Tue, 11 Jun 2019 17:17:31 +0000 Subject: [PATCH 08/11] add link to channel (not quite working) --- islandora_solr_config/includes/atom_results.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/islandora_solr_config/includes/atom_results.inc b/islandora_solr_config/includes/atom_results.inc index f2fe1622..930f2789 100644 --- a/islandora_solr_config/includes/atom_results.inc +++ b/islandora_solr_config/includes/atom_results.inc @@ -111,6 +111,14 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { $description = $channel['description']; $langcode = $channel['langcode']; $args = $channel['args']; + $args[] = array( + 'key' => 'link', + 'attributes' => array( + 'rel' => 'next', + 'href' => $link_next, + ), + ); +dd($args); $output = "\n"; $output .= '' . "\n"; @@ -132,7 +140,6 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { exit; } - /** * Function for setting the values of the elements for the RSS display. * From d3f09fb8b825a971836791558c3584648c2cfe66 Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Wed, 12 Jun 2019 19:34:22 +0000 Subject: [PATCH 09/11] Add custom Atom functions --- .../includes/atom_results.inc | 74 ++++++++++--------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/islandora_solr_config/includes/atom_results.inc b/islandora_solr_config/includes/atom_results.inc index e932c4db..86816b07 100644 --- a/islandora_solr_config/includes/atom_results.inc +++ b/islandora_solr_config/includes/atom_results.inc @@ -6,6 +6,42 @@ * Apache_Solr_Php client. */ +/** + * Formats a single atom item. + * + * Arbitrary elements may be added using the $args associative array. + */ +function format_atom_item($title, $link, $description, $args = array()) { + $output = "\n"; + $output .= ' ' . check_plain($title) . "\n"; + $output .= ' ' . check_url($link) . "\n"; + $output .= ' ' . check_plain($description) . "\n"; + $output .= format_xml_elements($args); + $output .= "\n"; + + return $output; +} + +/** + * Formats the feed header. + */ +function format_atom_channel($title, $link, $description, $items, $langcode = NULL, $args = array()) { + global $language_content; + $langcode = $langcode ? $langcode : $language_content->language; + $output = ' ' . check_plain($title) . "\n"; + $output .= ' ' . check_url($link) . "\n"; + + // The RSS 2.0 "spec" doesn't indicate HTML can be used in the description. + // We strip all HTML tags, but need to prevent double encoding from properly + // escaped source data (such as & becoming &). + $output .= ' ' . check_plain(decode_entities(strip_tags($description))) . "\n"; + $output .= ' ' . check_plain($langcode) . "\n"; + $output .= format_xml_elements($args); + $output .= $items; + $output .= "\n"; + return $output; +} + /** * Extention of IslandoraSolrResults for templating purposes. * This overrides the displayResults function to provide an alternate display @@ -61,12 +97,7 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { drupal_alter('islandora_solr_search_atom_item', $item, $doc); // Render rss item. - $rendered_item = format_rss_item($item['title'], $item['link'], $item['description'], $item['items']); - $test = islandora_solr_config_format_atom_item($item['title'], $item['link'], $item['description'], $item['items']); - $open_tag = ""; - $close_tag = ""; - $rendered_item = str_replace($open_tag, "", $rendered_item); - $rendered_item = str_replace($close_tag, "", $rendered_item); + $rendered_item = format_atom_item($item['title'], $item['link'], $item['description'], $item['items']); // ... allow it to be altered... drupal_alter('islandora_solr_config_rss_item_post_render', $rendered_item, $doc); @@ -112,13 +143,6 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { $description = $channel['description']; $langcode = $channel['langcode']; $args = $channel['args']; - $args[] = array( - 'key' => 'link', - 'attributes' => array( - 'rel' => 'next', - 'href' => $link_next, - ), - ); $output = "\n"; $output .= '' . "\n"; @@ -127,34 +151,14 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { if (isset($link_prev)) { $output .= ' ' . "\n"; } - $output .= ' '; - $strip_channel = format_rss_channel($title, $url, $description, $items, $langcode, $args); - $tags = array( - "", - "", - ); - $output .= str_replace($tags, "", $strip_channel); + $output .= ' ' . "\n"; + $output .= format_atom_channel($title, $url, $description, $items, $langcode, $args); $output .= "\n"; print $output; exit; } -/** - * Formats a single atom item. - * - * Arbitrary elements may be added using the $args associative array. - */ -function islandora_solr_config_format_atom_item($title, $link, $description, $args = array()) { - $output = "\n"; - $output .= ' ' . check_plain($title) . "\n"; - $output .= ' ' . check_url($link) . "\n"; - $output .= ' ' . check_plain($description) . "\n"; - $output .= format_xml_elements($args); - $output .= "\n"; - - return $output; -} /** * Function for setting the values of the elements for the RSS display. From 7c43353a62586473a03c1c151fecaa3d3859841c Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Wed, 12 Jun 2019 19:35:50 +0000 Subject: [PATCH 10/11] tweak RSS image class --- islandora_solr_config/islandora_solr_config.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/islandora_solr_config/islandora_solr_config.module b/islandora_solr_config/islandora_solr_config.module index 43dd7260..454b3a52 100644 --- a/islandora_solr_config/islandora_solr_config.module +++ b/islandora_solr_config/islandora_solr_config.module @@ -62,7 +62,7 @@ function islandora_solr_config_islandora_solr_secondary_display() { 'class' => 'IslandoraSolrResultsAtom', 'function' => 'printAtom', 'description' => t("Show search results as an Atom feed"), - 'logo' => '' . t(', + 'logo' => '' . t(', ), ); } From ed7c02a7cc7a01c564f187b67cc16ac8816f8cb5 Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Wed, 12 Jun 2019 19:39:19 +0000 Subject: [PATCH 11/11] RSS Atomized --- islandora_solr_config/includes/atom_results.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/islandora_solr_config/includes/atom_results.inc b/islandora_solr_config/includes/atom_results.inc index 86816b07..388e9b4a 100644 --- a/islandora_solr_config/includes/atom_results.inc +++ b/islandora_solr_config/includes/atom_results.inc @@ -100,7 +100,7 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { $rendered_item = format_atom_item($item['title'], $item['link'], $item['description'], $item['items']); // ... allow it to be altered... - drupal_alter('islandora_solr_config_rss_item_post_render', $rendered_item, $doc); + drupal_alter('islandora_solr_config_atom_item_post_render', $rendered_item, $doc); // ... and add to items string. $items .= "$rendered_item\n"; @@ -110,8 +110,8 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { $query = $islandora_solr_query->solrQuery; // Get the variables for the element. - $channel = $this->rssChannel($query); - drupal_alter('islandora_solr_config_rss_root_element_attributes', $channel, $items); + $channel = $this->atomChannel($query); + drupal_alter('islandora_solr_config_atom_root_element_attributes', $channel, $items); // Give the results clean variable names. $title = $channel['title']; @@ -244,7 +244,7 @@ class IslandoraSolrResultsAtom extends IslandoraSolrResults { * @return array * variable that holds all values to be rendered into elements */ - public function rssChannel($query) { + public function atomChannel($query) { // Set variables. global $base_url; $rss_channel = variable_get('islandora_solr_config_rss_channel', array(