diff --git a/application/controllers/advanced.php b/application/controllers/advanced.php index b1f9351c..5cc26a43 100755 --- a/application/controllers/advanced.php +++ b/application/controllers/advanced.php @@ -19,6 +19,11 @@ function _remap($path, $params = array()) { $form = form_open('advanced/post'); $search_fields = $this->config->item('skylight_search_fields'); + // Determine the page title and heading. + $page_title_prefix = $this->config->item('skylight_page_title_prefix'); + if( !isset($page_title_prefix) ) { + $page_title_prefix = ""; + } foreach($search_fields as $key => $value) { @@ -71,7 +76,7 @@ function _remap($path, $params = array()) { $formdata['formhidden'] = false; // Set the page title to the record title - $data['page_title'] = 'Advanced Search'; + $data['page_title'] = $page_title_prefix.'Advanced Search'; $this->view('header', $data); $this->view('div_main'); $this->view('advanced_search',$formdata); @@ -204,7 +209,9 @@ function _remap($path, $params = array()) { $data['sort_options'] = $sort_options; // Variables to populate the search box $data['searchbox_query'] = $query; - if (($data['searchbox_query'] == '*') || ($data['searchbox_query'] == '*:*')) $data['searchbox_query'] = ''; + if (($data['searchbox_query'] == '*') || ($data['searchbox_query'] == '*:*')) { + $data['searchbox_query'] = ''; + } $data['searchbox_filters'] = $saved_filters; $data['form'] = $form; @@ -212,10 +219,20 @@ function _remap($path, $params = array()) { $data['message'] = $message; + + $decodedQuery = urldecode($query); + if( $decodedQuery !== "*:*" && $decodedQuery !== "*" && $decodedQuery !== "" ) { + $data['page_title'] = $page_title_prefix.'Search results for "'.$decodedQuery.'"'; + $data['page_heading'] = 'Search results for "'.$decodedQuery.'"'; + } else { + $data['page_title'] = $page_title_prefix.'Search Results'; + $data['page_heading'] = 'Search Results"'; + } + + // Check for zero results $result_count = $data['rows']; if ($result_count == 0) { - $data['page_title'] = 'No search results found!'; $this->view('header', $data); $this->view('div_main'); $this->view('advanced_search',$data); @@ -246,8 +263,6 @@ function _remap($path, $params = array()) { else $data['endrow'] = $data['startrow'] + ($rows - 1); - // Set the page title to the record title - $data['page_title'] = 'Search results for "'.urldecode($query).'"'; $data['title_field'] = $title; $data['author_field'] = $title = $this->skylight_utilities->getField('Author'); $data['fielddisplay'] = $this->config->item("skylight_searchresult_display"); diff --git a/application/controllers/browse.php b/application/controllers/browse.php index 8ad0be2c..45e62a8f 100755 --- a/application/controllers/browse.php +++ b/application/controllers/browse.php @@ -18,7 +18,7 @@ function _remap($field, $params = array()) { $delimiter = $this->config->item('skylight_filter_delimiter'); $rows = 30; $recorddisplay = $this->config->item('skylight_recorddisplay'); - // $title = $recorddisplay['Title']; + //$title = $recorddisplay['Title']; $saved_filters = array(); $url_filters = array(); @@ -35,10 +35,8 @@ function _remap($field, $params = array()) { } } - $offset = $this->input->get('offset'); $prefix = $this->input->get('prefix'); - // echo "PREFIX IS $prefix"; // Base search URL @@ -47,17 +45,25 @@ function _remap($field, $params = array()) { $base_search .= '/'.$url_filter; } + $decodedField = urldecode($field); // Solr query business moved to solr_client library - $data = $this->solr_client->browseTerms($field, $rows, $offset, $prefix); + $data = $this->solr_client->browseTerms($decodedField, $rows, $offset, $prefix); + + + // Determine the page title and heading. + $page_title_prefix = $this->config->item('skylight_page_title_prefix'); + if( !isset($page_title_prefix) ) { + $page_title_prefix = ""; + } // Check for zero results $result_count = $data['rows']; $facet_count = $data['facet']['termcount']; if ($result_count == 0) { - $data['page_title'] = 'No search results found!'; - $this->view('header', $data); + $data['page_title'] = $page_title_prefix.'Browse "'. $decodedField . '"'; + $this->view('header', $data); $this->view('div_main'); $this->view('search_noresults'); $this->view('div_main_end'); @@ -79,8 +85,8 @@ function _remap($field, $params = array()) { $data['endrow'] = $data['startrow'] + ($rows - 1); // Set the page title to the record title - $data['page_title'] = 'Browsing '.$field.' terms'; - $data['browse_url'] = $browse_url; + $data['page_title'] = $page_title_prefix.'Browse "'. $decodedField . '"'; + $data['browse_url'] = $browse_url; $data['field'] = $field; $data['offset'] = $offset; @@ -104,4 +110,4 @@ function _remap($field, $params = array()) { $this->view('div_sidebar_end'); $this->view('footer'); } -} \ No newline at end of file +} diff --git a/application/controllers/feedback.php b/application/controllers/feedback.php old mode 100755 new mode 100644 index 671f7cb7..eec723f1 --- a/application/controllers/feedback.php +++ b/application/controllers/feedback.php @@ -13,7 +13,13 @@ function Feedback() { public function index() { $data['recaptcha_key_public'] = $this->config->item('skylight_recaptcha_key_public'); - $data['page_title'] = 'Feedback'; + // Determine the page title and heading. + $page_title_prefix = $this->config->item('skylight_page_title_prefix'); + if( !isset($page_title_prefix) ) { + $page_title_prefix = ""; + } + + $data['page_title'] = $page_title_prefix.'Feedback'; $this->view('header', $data); $this->view('div_main'); @@ -58,4 +64,4 @@ function _check_captcha($input) { } } -} \ No newline at end of file +} diff --git a/application/controllers/record.php b/application/controllers/record.php old mode 100755 new mode 100644 index 4c367b86..635a4deb --- a/application/controllers/record.php +++ b/application/controllers/record.php @@ -37,9 +37,15 @@ function _remap($id, $params = array()) { // Solr query business moved to solr_client library $data = $this->solr_client->getRecord($id); + // Determine the page title and heading. + $page_title_prefix = $this->config->item('skylight_page_title_prefix'); + if( !isset($page_title_prefix) ) { + $page_title_prefix = ""; + } + // Check for a valid ID if ($data['result_count'] == 0) { - $data['page_title'] = 'Invalid record identifier!'; + $data['page_title'] = $page_title_prefix.'Record - Invalid Identifier'; $this->view('header', $data); $this->view('div_main'); $this->view('record_invalid'); @@ -94,7 +100,9 @@ function _remap($id, $params = array()) { $data['sharethis'] = $this->config->item('skylight_share_buttons'); - $data['page_title'] = $data['solr'][$title][0]; + //$data['page_title'] = $data['solr'][$title][0]; + $data['page_title'] = $page_title_prefix . '"'.$data['solr'][$title][0].'"'; + $data['record_title'] = $data['solr'][$title][0]; $data['title_field'] = $title; $data['id'] = $id; @@ -122,4 +130,4 @@ function _remap($id, $params = array()) { $this->view('footer'); } -} \ No newline at end of file +} diff --git a/application/controllers/search.php b/application/controllers/search.php index b08c86ed..8900419e 100755 --- a/application/controllers/search.php +++ b/application/controllers/search.php @@ -98,10 +98,25 @@ function _remap($query, $params = array()) { if (($data['searchbox_query'] == '*') || ($data['searchbox_query'] == '*:*')) $data['searchbox_query'] = ''; $data['searchbox_filters'] = $saved_filters; + + // Obtain the common page title prefix. + $page_title_prefix = $this->config->item('skylight_page_title_prefix'); + if( !isset($page_title_prefix) ) { + $page_title_prefix = ""; + } + + if( urldecode($query) != "*:*" && urldecode($query) != "*" ) { + $data['page_title'] = $page_title_prefix.'Search results for "'.urldecode($query).'"'; + $data['page_heading'] = 'Search results for "'.urldecode($query).'"'; + } else { + $data['page_title'] = $page_title_prefix.'Search Results'; + $data['page_heading'] = 'Search Results"'; + } + + // Check for zero results $result_count = $data['rows']; if ($result_count == 0) { - $data['page_title'] = 'No search results found!'; $this->view('header', $data); $this->view('div_main'); $this->view('search_suggestions', $data); @@ -140,11 +155,6 @@ function _remap($query, $params = array()) { $data['author_field'] = 'dccreator'; } - // Set the page title to the record title - $data['page_title'] = 'Search results for "'.urldecode($query).'"'; - $data['page_heading'] = 'Search results for "'.urldecode($query).'"'; - - //$data['title_field'] = $title; $data['fielddisplay'] = $this->config->item("skylight_searchresult_display"); // TODO: get rid of this, it's bad @@ -164,4 +174,4 @@ function _remap($query, $params = array()) { } -} \ No newline at end of file +} diff --git a/application/views/record.php b/application/views/record.php index 45be43fc..5d356fab 100644 --- a/application/views/record.php +++ b/application/views/record.php @@ -13,7 +13,7 @@ ?> -