From c4ed70ad4cf233f6091f6de22a5cfaf81ea88747 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 2 Dec 2011 22:05:50 -0500 Subject: Elgg 1.8 version --- views/default/opensearch/includes.php | 7 +++-- views/opensearch_rss/page/default.php | 42 +++++++++++++++++++++++++++ views/opensearch_rss/page/layouts/default.php | 5 ++++ views/opensearch_rss/page_shells/default.php | 40 ------------------------- views/opensearch_rss/pageshells/pageshell.php | 6 ---- views/opensearch_rss/search/layout.php | 3 ++ views/opensearch_rss/search/list.php | 27 +++++++++++++++++ views/opensearch_rss/search/listing.php | 24 --------------- views/xml/opensearch/description.php | 20 +++++++------ 9 files changed, 93 insertions(+), 81 deletions(-) create mode 100644 views/opensearch_rss/page/default.php create mode 100644 views/opensearch_rss/page/layouts/default.php delete mode 100644 views/opensearch_rss/page_shells/default.php delete mode 100644 views/opensearch_rss/pageshells/pageshell.php create mode 100644 views/opensearch_rss/search/list.php delete mode 100644 views/opensearch_rss/search/listing.php (limited to 'views') diff --git a/views/default/opensearch/includes.php b/views/default/opensearch/includes.php index 57e56723f..6aceb45c2 100644 --- a/views/default/opensearch/includes.php +++ b/views/default/opensearch/includes.php @@ -1,7 +1,10 @@ sitename; +$url = elgg_normalize_url('opensearch/osd.xml'); +$title = elgg_get_site_entity()->name; ?> diff --git a/views/opensearch_rss/page/default.php b/views/opensearch_rss/page/default.php new file mode 100644 index 000000000..79cd544c4 --- /dev/null +++ b/views/opensearch_rss/page/default.php @@ -0,0 +1,42 @@ +\n"; + +// Set title +$search_terms = get_input('q'); +$title = elgg_get_site_entity()->name; +$title .= ' ' . elgg_echo('opensearch:title', array($search_terms)); + +$description = elgg_echo('opensearch:description', array($search_terms)); + +// Remove viewtype from URL +$search_url = str_replace('&view=opensearch_rss', '', full_url()); + +$os_url = elgg_normalize_url('opensearch/osd.xml'); + +?> + + + <?php echo $title; ?> + + + + + diff --git a/views/opensearch_rss/page/layouts/default.php b/views/opensearch_rss/page/layouts/default.php new file mode 100644 index 000000000..488734f84 --- /dev/null +++ b/views/opensearch_rss/page/layouts/default.php @@ -0,0 +1,5 @@ +\n"; - -// Set title -$search_terms = get_input('q'); -$title = $vars['config']->sitename; -$title .= ' ' . sprintf(elgg_echo('opensearch:title'), $search_terms); - -$description = sprintf(elgg_echo('opensearch:description'), $search_terms); - -// Remove viewtype from URL -$search_url = str_replace('&view=opensearch_rss','', full_url()); - -$os_url = "{$vars['url']}pg/opensearch/osd.xml"; - - -?> - - - <?php echo $title; ?> - - - - - diff --git a/views/opensearch_rss/pageshells/pageshell.php b/views/opensearch_rss/pageshells/pageshell.php deleted file mode 100644 index f883f236a..000000000 --- a/views/opensearch_rss/pageshells/pageshell.php +++ /dev/null @@ -1,6 +0,0 @@ - $entity, + 'params' => $vars['params'], + 'results' => $vars['results'] + )); + } +} +elgg_set_viewtype('opensearch_rss'); + +echo $body; \ No newline at end of file diff --git a/views/opensearch_rss/search/listing.php b/views/opensearch_rss/search/listing.php deleted file mode 100644 index 219462976..000000000 --- a/views/opensearch_rss/search/listing.php +++ /dev/null @@ -1,24 +0,0 @@ - $entity, - 'params' => $vars['params'], - 'results' => $vars['results'] - )); - } -} -elgg_set_viewtype('opensearch_rss'); - -echo $body; \ No newline at end of file diff --git a/views/xml/opensearch/description.php b/views/xml/opensearch/description.php index 221cb768e..78aadc699 100644 --- a/views/xml/opensearch/description.php +++ b/views/xml/opensearch/description.php @@ -5,23 +5,25 @@ */ // reset cache headers because IE8 is stupid -header('Pragma: public', TRUE); -header('Cache-Control: public', TRUE); +header('Pragma: public', true); +header('Cache-Control: public', true); $config_ini = dirname(dirname(dirname(dirname(__FILE__)))) . '/config.ini'; $config = parse_ini_file($config_ini); -if ($config == FALSE) { +if ($config == false) { elgg_log("Unable to parse OpenSearch config file", 'ERROR'); - return TRUE; + return true; } extract($config); -$site = get_entity($CONFIG->site_guid); +$site = elgg_get_site_entity(); $email = $site->email; -$rss_url = "{$vars['url']}pg/search/?q={searchTerms}&view=opensearch_rss"; -$html_url = "{$vars['url']}pg/search/?q={searchTerms}"; +$rss_url = elgg_normalize_url('search/?q={searchTerms}&view=opensearch_rss'); +$rss_url = elgg_format_url($rss_url); +$html_url = elgg_normalize_url('search/?q={searchTerms}'); +$site_url = elgg_get_site_url(); ?> @@ -34,10 +36,10 @@ $html_url = "{$vars['url']}pg/search/?q={searchTerms}"; - + - + -- cgit v1.2.3