svn: /pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/ LatestReleases.tpl.php Main.tpl.php

From: Date: Tue, 30 Mar 2010 19:00:00 +0000
Subject: svn: /pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/ LatestReleases.tpl.php Main.tpl.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-9349@lists.php.net to get a copy of this message
saltybeagle Tue, 30 Mar 2010 19:00:00 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=297195 Log: Add in the RDF items as a table of contents. Changed paths: U pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/LatestReleases.tpl.php U pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/Main.tpl.php Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/LatestReleases.tpl.php =================================================================== --- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/LatestReleases.tpl.php 2010-03-30 18:31:25 UTC (rev 297194) +++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/LatestReleases.tpl.php 2010-03-30 19:00:00 UTC (rev 297195) @@ -1,4 +1,7 @@ -<?php foreach($context as $package): ?> +<?php +$item_table_of_contents = '<items><rdf:Seq>'; +foreach($context as $package): ?> +<?php $item_table_of_contents .= '<rdf:li rdf:resource="'.pear2\SimpleChannelFrontend\Main::getURL().$package->name.'-'.$package->version['release'].'" />'.PHP_EOL; ?> <item rdf:about="<?php echo pear2\SimpleChannelFrontend\Main::getURL().$package->name.'-'.$package->version['release']; ?>"> <title><?php echo $package->name.' '.$package->version['release']; ?></title> <link><?php echo pear2\SimpleChannelFrontend\Main::getURL().$package->name.'-'.$package->version['release']; ?></link> @@ -7,4 +10,9 @@ </content:encoded> <dc:date><?php echo date('c', strtotime($package->date.' '.$package->time)); ?></dc:date> </item> -<?php endforeach; ?> \ No newline at end of file +<?php endforeach; +$item_table_of_contents .= '</rdf:Seq></items>'; +$savant->addFilters(function($buffer) use ($item_table_of_contents) { + return str_replace('<!-- {items} -->', $item_table_of_contents, $buffer); +}); +?> \ No newline at end of file Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/Main.tpl.php =================================================================== --- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/Main.tpl.php 2010-03-30 18:31:25 UTC (rev 297194) +++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/rss/Main.tpl.php 2010-03-30 19:00:00 UTC (rev 297195) @@ -12,6 +12,7 @@ <dc:language>en-us</dc:language> <title><?php echo pear2\SimpleChannelFrontend\Main::$channel->summary; ?>: Latest releases</title> <description>The latest releases for <?php echo pear2\SimpleChannelFrontend\Main::$channel->summary; ?>.</description> + <!-- {items} --> </channel> <?php echo $savant->render($context->page_content); ?> </rdf:RDF> \ No newline at end of file

« previous php.pear.core (#9349) next »