Merge pull request #5 from UndefinedOffset/ss-3.0

API CHANGE: compatibility with SilverStripe 3.0. For SilverStripe 2.4 releases please use the 0.2 branch.
This commit is contained in:
Will Rossiter 2012-03-26 02:39:40 -07:00
commit 295aba26e6
2 changed files with 12 additions and 12 deletions

View File

@ -6,14 +6,14 @@
* *
* @package googlesitemaps * @package googlesitemaps
*/ */
class GoogleSitemapDecorator extends DataObjectDecorator { class GoogleSitemapDecorator extends DataExtension {
} }
/** /**
* @package googlesitemaps * @package googlesitemaps
*/ */
class GoogleSitemapSiteTreeDecorator extends SiteTreeDecorator { class GoogleSitemapSiteTreeDecorator extends DataExtension {
function extraStatics() { function extraStatics() {
return array( return array(
@ -23,7 +23,7 @@ class GoogleSitemapSiteTreeDecorator extends SiteTreeDecorator {
); );
} }
function updateCMSFields(&$fields) { function updateSettingsFields(&$fields) {
$prorities = array( $prorities = array(
'' => _t('SiteTree.PRIORITYAUTOSET', 'Auto-set based on page depth'), '' => _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 '-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") '0.1' => '10 - ' . _t('SiteTree.PRIORITYLEASTIMPORTANT', "Least important")
); );
$tabset = $fields->findOrMakeTab('Root.Content'); $tabset = $fields->findOrMakeTab('Root.Settings');
$message = "<p>"; $message = "<p>";
$message .= sprintf(_t('SiteTree.METANOTEPRIORITY', "Manually specify a Google Sitemaps priority for this page (%s)"), $message .= sprintf(_t('SiteTree.METANOTEPRIORITY', "Manually specify a Google Sitemaps priority for this page (%s)"),

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% control Items %> <% loop $Items %>
<url> <url>
<loc>$AbsoluteLink</loc> <loc>$AbsoluteLink</loc>
<lastmod>$LastEdited.Format(c)</lastmod> <lastmod>$LastEdited.Format(c)</lastmod>
<% if ChangeFreq %><changefreq>$ChangeFreq</changefreq><% end_if %> <% if $ChangeFreq %><changefreq>$ChangeFreq</changefreq><% end_if %>
<% if Priority %><priority>$Priority</priority><% end_if %> <% if $Priority %><priority>$Priority</priority><% end_if %>
</url> </url>
<% end_control %> <% end_loop %>
</urlset> </urlset>