Consolidate into a single feed XSL file - accessed via Horde_Themes::getFeedXsl()
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 22 Nov 2010 01:53:03 +0000 (18:53 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 22 Nov 2010 18:33:23 +0000 (11:33 -0700)
15 files changed:
ansel/rss.php
ansel/themes/default/feed-rss.xsl [deleted file]
framework/Core/lib/Horde/Themes.php
horde/themes/default/feed-rss.xsl [new file with mode: 0644]
imp/rss.php
imp/themes/default/feed-rss.xsl [deleted file]
jonah/delivery/rss.php
jonah/themes/default/feed-rss.xsl [deleted file]
kronolith/feed/index.php
kronolith/themes/default/feed-rss.xsl [deleted file]
whups/query/rss.php
whups/queue/rss.php
whups/search/rss.php
whups/themes/default/feed-rss.xsl [deleted file]
whups/ticket/rss.php

index a75535b..970582e 100644 (file)
@@ -263,7 +263,7 @@ if (empty($rss)) {
         }
     }
 
-    $xsl = $registry->get('themesuri') . '/feed-rss.xsl';
+    $xsl = Horde_Themes::getFeedXsl();
     $stream_name = htmlspecialchars($params['name']);
     $stream_desc = htmlspecialchars($params['desc']);
     $stream_updated = htmlspecialchars(date('r', $params['last_modified']));
diff --git a/ansel/themes/default/feed-rss.xsl b/ansel/themes/default/feed-rss.xsl
deleted file mode 100644 (file)
index 018a71f..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet version="1.0"
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:rss="http://purl.org/rss/1.0/"
-  xmlns:atom="http://www.w3.org/2005/Atom">
-
-  <xsl:output indent="yes" encoding="UTF-8"/>
-
-  <xsl:template match="/rss|/atom:feed">
-    <html>
-      <head>
-        <title>
-          <xsl:value-of select="/rss/channel/title"/>
-        </title>
-        <style type="text/css">
-          img {
-              border: 0;
-              padding: 5px;
-          }
-        </style>
-      </head>
-      <body>
-        <p>
-          You're viewing an XML content feed which is
-          intended to be viewed within a feed aggregator.
-        </p>
-
-        <xsl:variable name="link" select="/rss/channel/link"/>
-        <h3>Subscribe to <a href="{$link}"><xsl:value-of select="/rss/channel/title"/></a></h3>
-        <xsl:variable name="cimage" select="/rss/channel/image/url"/>
-        <div style="float:right;"><img src="{$cimage}"/></div>
-
-        <p>
-          Subscribe now in your favorite RSS aggregator:
-        </p>
-
-        <xsl:variable name="resource" select="/rss/channel/atom:link"/>
-
-        <div>
-          <a href="http://www.rojo.com/add-subscription?resource={$resource}">
-            <img src="http://www.rojo.com/skins/static/images/add-to-rojo.gif" alt="Subscribe in Rojo"/>
-          </a>
-
-          <a href="http://add.my.yahoo.com/rss?url={$resource}">
-            <img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif" alt="Add to My yahoo" />
-          </a>
-
-          <a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url={$resource}">
-            <img src="http://www.newsgator.com/images/ngsub1.gif" alt="Subscribe in NewsGator Online"/>
-          </a>
-
-          <a href="http://www.bloglines.com/sub/{$resource}">
-            <img src="http://www.bloglines.com/images/sub_modern5.gif" alt="Subscribe with Bloglines"/>
-          </a>
-
-          <a href="http://fusion.google.com/add?feedurl={$resource}">
-            <img src="http://buttons.googlesyndication.com/fusion/add.gif" alt="Subscribe with Google Reader"/>
-          </a>
-        </div>
-
-        <p>
-          <h3>Preview</h3>
-        </p>
-
-        <xsl:apply-templates select="/rss/channel/item" />
-
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="item">
-    <xsl:variable name="link" select="link"/>
-    <p>
-      <a href="{$link}">
-        <xsl:value-of select="title"/>
-      </a>
-      <br />
-      <xsl:value-of select="description"/>
-    </p>
-  </xsl:template>
-
-</xsl:stylesheet>
index 2808d5c..cff21a9 100644 (file)
@@ -139,4 +139,16 @@ class Horde_Themes
         return $sounds;
     }
 
+    /**
+     * Return the location of the feed XSL file.
+     *
+     * As of now, this file MUST live in horde/themes/default/feed-rss.xsl.
+     *
+     * @return string  Path to the feed file.
+     */
+    static public function getFeedXsl()
+    {
+         return $GLOBALS['registry']->get('themesuri', 'horde') . '/default/feed-rss.xsl';
+    }
+
 }
diff --git a/horde/themes/default/feed-rss.xsl b/horde/themes/default/feed-rss.xsl
new file mode 100644 (file)
index 0000000..018a71f
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:rss="http://purl.org/rss/1.0/"
+  xmlns:atom="http://www.w3.org/2005/Atom">
+
+  <xsl:output indent="yes" encoding="UTF-8"/>
+
+  <xsl:template match="/rss|/atom:feed">
+    <html>
+      <head>
+        <title>
+          <xsl:value-of select="/rss/channel/title"/>
+        </title>
+        <style type="text/css">
+          img {
+              border: 0;
+              padding: 5px;
+          }
+        </style>
+      </head>
+      <body>
+        <p>
+          You're viewing an XML content feed which is
+          intended to be viewed within a feed aggregator.
+        </p>
+
+        <xsl:variable name="link" select="/rss/channel/link"/>
+        <h3>Subscribe to <a href="{$link}"><xsl:value-of select="/rss/channel/title"/></a></h3>
+        <xsl:variable name="cimage" select="/rss/channel/image/url"/>
+        <div style="float:right;"><img src="{$cimage}"/></div>
+
+        <p>
+          Subscribe now in your favorite RSS aggregator:
+        </p>
+
+        <xsl:variable name="resource" select="/rss/channel/atom:link"/>
+
+        <div>
+          <a href="http://www.rojo.com/add-subscription?resource={$resource}">
+            <img src="http://www.rojo.com/skins/static/images/add-to-rojo.gif" alt="Subscribe in Rojo"/>
+          </a>
+
+          <a href="http://add.my.yahoo.com/rss?url={$resource}">
+            <img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif" alt="Add to My yahoo" />
+          </a>
+
+          <a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url={$resource}">
+            <img src="http://www.newsgator.com/images/ngsub1.gif" alt="Subscribe in NewsGator Online"/>
+          </a>
+
+          <a href="http://www.bloglines.com/sub/{$resource}">
+            <img src="http://www.bloglines.com/images/sub_modern5.gif" alt="Subscribe with Bloglines"/>
+          </a>
+
+          <a href="http://fusion.google.com/add?feedurl={$resource}">
+            <img src="http://buttons.googlesyndication.com/fusion/add.gif" alt="Subscribe with Google Reader"/>
+          </a>
+        </div>
+
+        <p>
+          <h3>Preview</h3>
+        </p>
+
+        <xsl:apply-templates select="/rss/channel/item" />
+
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template match="item">
+    <xsl:variable name="link" select="link"/>
+    <p>
+      <a href="{$link}">
+        <xsl:value-of select="title"/>
+      </a>
+      <br />
+      <xsl:value-of select="description"/>
+    </p>
+  </xsl:template>
+
+</xsl:stylesheet>
index a706306..b5cc21b 100644 (file)
@@ -85,7 +85,7 @@ $description = ($total_num == 0)
 
 $t = $injector->createInstance('Horde_Template');
 $t->set('charset', 'UTF-8');
-$t->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
+$t->set('xsl', Horde_Themes::getFeedXsl());
 $t->set('pubDate', htmlspecialchars(date('r')));
 $t->set('desc', htmlspecialchars($description));
 $t->set('title', htmlspecialchars($registry->get('name') . ' - ' . IMP::getLabel($mailbox)));
diff --git a/imp/themes/default/feed-rss.xsl b/imp/themes/default/feed-rss.xsl
deleted file mode 100644 (file)
index 211493e..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet version="1.0"
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:rss="http://purl.org/rss/1.0/"
-  xmlns:atom="http://www.w3.org/2005/Atom">
-
-  <xsl:output indent="yes" encoding="UTF-8"/>
-
-  <xsl:template match="/rss|/atom:feed">
-    <html>
-      <head>
-        <title>
-          <xsl:value-of select="/rss/channel/title"/>
-        </title>
-        <style type="text/css">
-          img {
-              border: 0;
-              padding: 5px;
-          }
-        </style>
-      </head>
-      <body>
-        <p>
-          You're viewing an XML content feed which is
-          intended to be viewed within a feed aggregator.
-        </p>
-
-        <h3>Subscribe to <xsl:value-of select="/rss/channel/title"/></h3>
-
-        <p>
-          Subscribe now in your favorite RSS aggregator:
-        </p>
-
-        <xsl:variable name="resource" select="/rss/channel/atom:link"/>
-
-        <div>
-          <a href="http://www.rojo.com/add-subscription?resource={$resource}">
-            <img src="http://www.rojo.com/skins/static/images/add-to-rojo.gif" alt="Subscribe in Rojo"/>
-          </a>
-
-          <a href="http://add.my.yahoo.com/rss?url={$resource}">
-            <img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif" alt="Add to My yahoo" />
-          </a>
-
-          <a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url={$resource}">
-            <img src="http://www.newsgator.com/images/ngsub1.gif" alt="Subscribe in NewsGator Online"/>
-          </a>
-
-          <a href="http://www.bloglines.com/sub/{$resource}">
-            <img src="http://www.bloglines.com/images/sub_modern5.gif" alt="Subscribe with Bloglines"/>
-          </a>
-
-          <a href="http://fusion.google.com/add?feedurl={$resource}">
-            <img src="http://buttons.googlesyndication.com/fusion/add.gif" alt="Subscribe with Google Reader"/>
-          </a>
-        </div>
-
-        <p>
-          <h3>Preview</h3>
-        </p>
-
-        <xsl:apply-templates select="/rss/channel/item" />
-
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="item">
-    <xsl:variable name="link" select="link"/>
-    <p>
-      <a href="{$link}">
-        <xsl:value-of select="title"/>
-      </a>
-    </p>
-  </xsl:template>
-
-</xsl:stylesheet>
index d72a3a8..af1c231 100644 (file)
@@ -68,7 +68,7 @@ try {
 // Build the template (@TODO: Use Horde_View)
 $template = new Horde_Template();
 $template->set('jonah', 'Jonah ' . $registry->getVersion() . ' (http://www.horde.org/jonah/)');
-$template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
+$template->set('xsl', Horde_Themes::getFeedXsl());
 if (!empty($criteria['tag_id'])) {
     $template->set('channel_name', sprintf(_("Stories tagged with %s in %s"), $tag_name, htmlspecialchars($channel['channel_name'])));
 } else {
diff --git a/jonah/themes/default/feed-rss.xsl b/jonah/themes/default/feed-rss.xsl
deleted file mode 100644 (file)
index 51d3c86..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet version="1.0"
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:rss="http://purl.org/rss/1.0/"
-  xmlns:atom="http://www.w3.org/2005/Atom">
-
-  <xsl:output indent="yes" encoding="UTF-8"/>
-
-  <xsl:template match="/rss|/atom:feed">
-    <html>
-      <head>
-        <title>
-          <xsl:value-of select="/rss/channel/title"/>
-        </title>
-        <style type="text/css">
-          img {
-              border: 0;
-              padding: 5px;
-          }
-        </style>
-      </head>
-      <body>
-        <p>
-          You're viewing an XML content feed which is
-          intended to be viewed within a feed aggregator.
-        </p>
-
-        <xsl:variable name="link" select="/rss/channel/link"/>
-        <h3>Subscribe to <a href="{$link}"><xsl:value-of select="/rss/channel/title"/></a></h3>
-        <xsl:variable name="cimage" select="/rss/channel/image/url"/>
-        <div style="float:right;"><img src="{$cimage}"/></div>
-        <p>
-          Subscribe now in your favorite RSS aggregator:
-        </p>
-
-        <xsl:variable name="resource" select="/rss/channel/atom:link"/>
-
-        <div>
-          <a href="http://add.my.yahoo.com/rss?url={$resource}">
-            <img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif" alt="Add to My yahoo" />
-          </a>
-
-          <a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url={$resource}">
-            <img src="http://www.newsgator.com/images/ngsub1.gif" alt="Subscribe in NewsGator Online"/>
-          </a>
-
-          <a href="http://www.bloglines.com/sub/{$resource}">
-            <img src="http://www.bloglines.com/images/sub_modern5.gif" alt="Subscribe with Bloglines"/>
-          </a>
-
-          <a href="http://fusion.google.com/add?feedurl={$resource}">
-            <img src="http://buttons.googlesyndication.com/fusion/add.gif" alt="Subscribe with Google Reader"/>
-          </a>
-        </div>
-
-        <p>
-          <h3>Preview</h3>
-        </p>
-
-        <xsl:apply-templates select="/rss/channel/item" />
-
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="item">
-    <xsl:variable name="link" select="link"/>
-    <p>
-      <a href="{$link}">
-        <xsl:value-of select="title"/>
-      </a>
-      <br />
-      <xsl:value-of select="description"/>
-    </p>
-  </xsl:template>
-
-</xsl:stylesheet>
index 6f5ffee..128139c 100644 (file)
@@ -96,7 +96,7 @@ $template->set('kronolith_name', 'Kronolith');
 $template->set('kronolith_version', $registry->getVersion());
 $template->set('kronolith_uri', 'http://www.horde.org/kronolith/');
 $template->set('kronolith_icon', Horde::url(Horde_Themes::img('kronolith.png'), true, -1));
-$template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
+$template->set('xsl', Horde_Themes::getFeedXsl());
 $template->set('calendar_name', htmlspecialchars($share->get('name')));
 $template->set('calendar_desc', htmlspecialchars($share->get('desc')), true);
 $template->set('calendar_owner', htmlspecialchars($identity->getValue('fullname')));
diff --git a/kronolith/themes/default/feed-rss.xsl b/kronolith/themes/default/feed-rss.xsl
deleted file mode 100644 (file)
index f625d5c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet version="1.0"
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:rss="http://purl.org/rss/1.0/"
-  xmlns:atom="http://www.w3.org/2005/Atom">
-
-  <xsl:output indent="yes" encoding="UTF-8"/>
-
-  <xsl:template match="/rss|/atom:feed">
-    <html>
-      <head>
-        <title>
-          <xsl:value-of select="/rss/channel/title"/>
-        </title>
-        <style type="text/css">
-          img {
-              border: 0;
-              padding: 5px;
-          }
-        </style>
-      </head>
-      <body>
-        <p>
-          You're viewing an XML content feed which is
-          intended to be viewed within a feed aggregator.
-        </p>
-
-        <xsl:variable name="link" select="/rss/channel/link"/>
-        <h3>Subscribe to <a href="{$link}"><xsl:value-of select="/rss/channel/title"/></a></h3>
-        <xsl:variable name="cimage" select="/rss/channel/image/url"/>
-        <div style="float:right;"><img src="{$cimage}"/></div>
-        <p>
-          Subscribe now in your favorite RSS aggregator:
-        </p>
-
-        <xsl:variable name="resource" select="/rss/channel/atom:link"/>
-
-        <div>
-          <a href="http://www.rojo.com/add-subscription?resource={$resource}">
-            <img src="http://www.rojo.com/skins/static/images/add-to-rojo.gif" alt="Subscribe in Rojo"/>
-          </a>
-
-          <a href="http://add.my.yahoo.com/rss?url={$resource}">
-            <img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif" alt="Add to My yahoo" />
-          </a>
-
-          <a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url={$resource}">
-            <img src="http://www.newsgator.com/images/ngsub1.gif" alt="Subscribe in NewsGator Online"/>
-          </a>
-
-          <a href="http://www.bloglines.com/sub/{$resource}">
-            <img src="http://www.bloglines.com/images/sub_modern5.gif" alt="Subscribe with Bloglines"/>
-          </a>
-
-          <a href="http://fusion.google.com/add?feedurl={$resource}">
-            <img src="http://buttons.googlesyndication.com/fusion/add.gif" alt="Subscribe with Google Reader"/>
-          </a>
-        </div>
-
-        <p>
-          <h3>Preview</h3>
-        </p>
-
-        <xsl:apply-templates select="/rss/channel/item" />
-
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="item">
-    <xsl:variable name="link" select="link"/>
-    <p>
-      <a href="{$link}">
-        <xsl:value-of select="title"/>
-      </a>
-      <br />
-      <xsl:value-of select="description"/>
-    </p>
-  </xsl:template>
-
-</xsl:stylesheet>
index e861885..5e27d2c 100644 (file)
@@ -55,7 +55,7 @@ foreach (array_keys($tickets) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
+$template->set('xsl', Horde_Themes::getFeedXsl());
 $template->set('pubDate', htmlspecialchars(date('r')));
 $template->set('title', htmlspecialchars($whups_query->name ? $whups_query->name : _("Query Results")));
 $template->set('items', $items, true);
index 7a6ea0b..5331c7b 100644 (file)
@@ -86,7 +86,7 @@ foreach (array_keys($tickets) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
+$template->set('xsl', Horde_Themes::getFeedXsl());
 $template->set('pubDate', htmlspecialchars(date('r')));
 if (isset($type) && isset($queue['name'])) {
     $rss_title = sprintf(_("%s %s tickets in %s"),
index bdb59ef..7845a6f 100644 (file)
@@ -47,7 +47,7 @@ foreach (array_keys($tickets) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
+$template->set('xsl', Horde_Themes::getFeedXsl());
 $template->set('pubDate', htmlspecialchars(date('r')));
 $template->set('title', _("Search Results"));
 $template->set('items', $items, true);
diff --git a/whups/themes/default/feed-rss.xsl b/whups/themes/default/feed-rss.xsl
deleted file mode 100644 (file)
index 211493e..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet version="1.0"
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:rss="http://purl.org/rss/1.0/"
-  xmlns:atom="http://www.w3.org/2005/Atom">
-
-  <xsl:output indent="yes" encoding="UTF-8"/>
-
-  <xsl:template match="/rss|/atom:feed">
-    <html>
-      <head>
-        <title>
-          <xsl:value-of select="/rss/channel/title"/>
-        </title>
-        <style type="text/css">
-          img {
-              border: 0;
-              padding: 5px;
-          }
-        </style>
-      </head>
-      <body>
-        <p>
-          You're viewing an XML content feed which is
-          intended to be viewed within a feed aggregator.
-        </p>
-
-        <h3>Subscribe to <xsl:value-of select="/rss/channel/title"/></h3>
-
-        <p>
-          Subscribe now in your favorite RSS aggregator:
-        </p>
-
-        <xsl:variable name="resource" select="/rss/channel/atom:link"/>
-
-        <div>
-          <a href="http://www.rojo.com/add-subscription?resource={$resource}">
-            <img src="http://www.rojo.com/skins/static/images/add-to-rojo.gif" alt="Subscribe in Rojo"/>
-          </a>
-
-          <a href="http://add.my.yahoo.com/rss?url={$resource}">
-            <img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif" alt="Add to My yahoo" />
-          </a>
-
-          <a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url={$resource}">
-            <img src="http://www.newsgator.com/images/ngsub1.gif" alt="Subscribe in NewsGator Online"/>
-          </a>
-
-          <a href="http://www.bloglines.com/sub/{$resource}">
-            <img src="http://www.bloglines.com/images/sub_modern5.gif" alt="Subscribe with Bloglines"/>
-          </a>
-
-          <a href="http://fusion.google.com/add?feedurl={$resource}">
-            <img src="http://buttons.googlesyndication.com/fusion/add.gif" alt="Subscribe with Google Reader"/>
-          </a>
-        </div>
-
-        <p>
-          <h3>Preview</h3>
-        </p>
-
-        <xsl:apply-templates select="/rss/channel/item" />
-
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="item">
-    <xsl:variable name="link" select="link"/>
-    <p>
-      <a href="{$link}">
-        <xsl:value-of select="title"/>
-      </a>
-    </p>
-  </xsl:template>
-
-</xsl:stylesheet>
index 12cec5e..08f4107 100644 (file)
@@ -42,7 +42,7 @@ foreach (array_keys($history) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
+$template->set('xsl', Horde_Themes::getFeedXsl());
 $template->set('pubDate', htmlspecialchars(date('r')));
 $template->set('title', htmlspecialchars($details['summary']));
 $template->set('items', $items, true);