Skip to content

Commit

Permalink
addded helpers for rss and other outputs, added auto detect rss link …
Browse files Browse the repository at this point in the history
…to headers of themes.
  • Loading branch information
Jeremy Boggs committed Dec 13, 2007
1 parent 98f1342 commit dface83
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions application/helpers/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ function not_empty_or($value, $default) {
* @return void
**/

// Function to easily generate various xml outputs of items
function items_output_uri($output="rss2") {
return uri('items/?output='.$output);
}

function auto_discovery_link_tag(){
$html = '<link rel="alternate" type="application/rss+xml" title="Omeka RSS Feed" href="'. items_output_uri() .'" />';
return $html;
}

function display_file($item, $props = array()) {
if(has_files($item)) {
if(count($item->Files) > 1) {
Expand Down
2 changes: 2 additions & 0 deletions themes/desertoasis/common/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="<?php echo settings('description'); ?>" />

<?php echo auto_discovery_link_tag(); ?>

<!-- Stylesheets -->
<link rel="stylesheet" media="screen" href="<?php css('screen'); ?>" />
<link rel="stylesheet" media="print" href="<?php css('print'); ?>" />
Expand Down
2 changes: 2 additions & 0 deletions themes/minimalist/common/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="<?php echo settings('description'); ?>" />

<?php echo auto_discovery_link_tag(); ?>

<!-- Stylesheets -->
<link rel="stylesheet" media="screen" href="<?php css('screen'); ?>" />
<link rel="stylesheet" media="print" href="<?php css('print'); ?>" />
Expand Down

0 comments on commit dface83

Please sign in to comment.