From 05d7bb8f82ae93ee955e39e1d276dc7994d7454f Mon Sep 17 00:00:00 2001 From: Ed Date: Sun, 25 Mar 2012 13:07:44 -0300 Subject: [PATCH] Better compatibility with SilverStripe 3.0 --- code/GoogleSitemapDecorator.php | 8 ++++---- templates/GoogleSitemap.ss | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/GoogleSitemapDecorator.php b/code/GoogleSitemapDecorator.php index 4e85382..80b64b1 100644 --- a/code/GoogleSitemapDecorator.php +++ b/code/GoogleSitemapDecorator.php @@ -6,14 +6,14 @@ * * @package googlesitemaps */ -class GoogleSitemapDecorator extends DataObjectDecorator { +class GoogleSitemapDecorator extends DataExtension { } /** * @package googlesitemaps */ -class GoogleSitemapSiteTreeDecorator extends SiteTreeDecorator { +class GoogleSitemapSiteTreeDecorator extends DataExtension { function extraStatics() { return array( @@ -23,7 +23,7 @@ class GoogleSitemapSiteTreeDecorator extends SiteTreeDecorator { ); } - function updateCMSFields(&$fields) { + function updateSettingsFields(&$fields) { $prorities = array( '' => _t('SiteTree.PRIORITYAUTOSET', 'Auto-set based on page depth'), '-1' => _t('SiteTree.PRIORITYNOTINDEXED', "Not indexed"), // We set this to -ve one because a blank value implies auto-generation of Priority @@ -39,7 +39,7 @@ class GoogleSitemapSiteTreeDecorator extends SiteTreeDecorator { '0.1' => '10 - ' . _t('SiteTree.PRIORITYLEASTIMPORTANT', "Least important") ); - $tabset = $fields->findOrMakeTab('Root.Content'); + $tabset = $fields->findOrMakeTab('Root.Settings'); $message = "

"; $message .= sprintf(_t('SiteTree.METANOTEPRIORITY', "Manually specify a Google Sitemaps priority for this page (%s)"), diff --git a/templates/GoogleSitemap.ss b/templates/GoogleSitemap.ss index 9272ed4..b681336 100644 --- a/templates/GoogleSitemap.ss +++ b/templates/GoogleSitemap.ss @@ -1,11 +1,11 @@ - <% control Items %> - - $AbsoluteLink - $LastEdited.Format(c) - <% if ChangeFreq %>$ChangeFreq<% end_if %> - <% if Priority %>$Priority<% end_if %> - - <% end_control %> + <% loop $Items %> + + $AbsoluteLink + $LastEdited.Format(c) + <% if $ChangeFreq %>$ChangeFreq<% end_if %> + <% if $Priority %>$Priority<% end_if %> + + <% end_loop %> \ No newline at end of file