aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-12-02 22:05:50 -0500
committercash <cash.costello@gmail.com>2011-12-02 22:05:50 -0500
commitc4ed70ad4cf233f6091f6de22a5cfaf81ea88747 (patch)
tree0dcaaf83e169d6d7d906675c64464700545ea884 /views
parent98acc22fec2dc7942e5c6e5bcdd2e6a356c6e905 (diff)
downloadelgg-c4ed70ad4cf233f6091f6de22a5cfaf81ea88747.tar.gz
elgg-c4ed70ad4cf233f6091f6de22a5cfaf81ea88747.tar.bz2
Elgg 1.8 version
Diffstat (limited to 'views')
-rw-r--r--views/default/opensearch/includes.php7
-rw-r--r--views/opensearch_rss/page/default.php (renamed from views/opensearch_rss/page_shells/default.php)14
-rw-r--r--views/opensearch_rss/page/layouts/default.php5
-rw-r--r--views/opensearch_rss/pageshells/pageshell.php6
-rw-r--r--views/opensearch_rss/search/layout.php3
-rw-r--r--views/opensearch_rss/search/list.php (renamed from views/opensearch_rss/search/listing.php)3
-rw-r--r--views/xml/opensearch/description.php20
7 files changed, 35 insertions, 23 deletions
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 @@
<?php
+/**
+ * OpenSearch head include
+ */
-$url = "{$vars['url']}pg/opensearch/osd.xml";
-$title = $vars['config']->sitename;
+$url = elgg_normalize_url('opensearch/osd.xml');
+$title = elgg_get_site_entity()->name;
?>
<link rel="search" type="application/opensearchdescription+xml" href="<?php echo $url; ?>" title="<?php echo $title; ?>" />
diff --git a/views/opensearch_rss/page_shells/default.php b/views/opensearch_rss/page/default.php
index e9510e9da..79cd544c4 100644
--- a/views/opensearch_rss/page_shells/default.php
+++ b/views/opensearch_rss/page/default.php
@@ -1,4 +1,7 @@
<?php
+/**
+ * Page shell for OpenSearch RSS feed
+ */
global $OPEN_SEARCH_COUNT;
@@ -11,16 +14,15 @@ echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
// Set title
$search_terms = get_input('q');
-$title = $vars['config']->sitename;
-$title .= ' ' . sprintf(elgg_echo('opensearch:title'), $search_terms);
+$title = elgg_get_site_entity()->name;
+$title .= ' ' . elgg_echo('opensearch:title', array($search_terms));
-$description = sprintf(elgg_echo('opensearch:description'), $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 = "{$vars['url']}pg/opensearch/osd.xml";
+$search_url = str_replace('&view=opensearch_rss', '', full_url());
+$os_url = elgg_normalize_url('opensearch/osd.xml');
?>
<rss version="2.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
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 @@
+<?php
+/**
+ * OpenSearch RSS layout shell
+ */
+echo $vars['content']; \ No newline at end of file
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 @@
-<?php
-/**
- * To support Elgg 1.7
- */
-
-require_once(dirname(dirname(__FILE__)) . "/page_shells/default.php");
diff --git a/views/opensearch_rss/search/layout.php b/views/opensearch_rss/search/layout.php
index 4cd2ff050..d5bb9fe57 100644
--- a/views/opensearch_rss/search/layout.php
+++ b/views/opensearch_rss/search/layout.php
@@ -1,2 +1,5 @@
<?php
+/**
+ * OpenSearch search layout
+ */
echo $vars['body']; \ No newline at end of file
diff --git a/views/opensearch_rss/search/listing.php b/views/opensearch_rss/search/list.php
index 219462976..bc7b5574e 100644
--- a/views/opensearch_rss/search/listing.php
+++ b/views/opensearch_rss/search/list.php
@@ -1,4 +1,7 @@
<?php
+/**
+ * OpenSearch serach results list
+ */
global $OPEN_SEARCH_COUNT;
if (!isset($OPEN_SEARCH_COUNT)) {
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}&amp;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();
?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
@@ -34,10 +36,10 @@ $html_url = "{$vars['url']}pg/search/?q={searchTerms}";
<Url type="text/html" template="<?php echo $html_url; ?>"/>
<Url type="application/rss+xml" template="<?php echo $rss_url; ?>"/>
<?php if (isset($ico)): ?>
- <Image height="16" width="16" type="image/vnd.microsoft.icon"><?php echo "{$vars['url']}$ico"; ?></Image>
+ <Image height="16" width="16" type="image/vnd.microsoft.icon"><?php echo "{$site_url}$ico"; ?></Image>
<?php endif; ?>
<?php if (isset($png)): ?>
- <Image height="64" width="64" type="image/png"><?php echo "{$vars['url']}$png"; ?></Image>
+ <Image height="64" width="64" type="image/png"><?php echo "{$site_url}$png"; ?></Image>
<?php endif; ?>
<?php if (isset($tags)): ?>
<Tags><?php echo $tags; ?></Tags>