ENHANCEMENT: added ability to define a custom prority to dataobjects.

This commit is contained in:
Will Rossiter 2011-06-13 11:16:07 +12:00
parent 805c7e2ee4
commit 65c59fc020
1 changed files with 22 additions and 19 deletions

View File

@ -10,7 +10,7 @@
* sitemap whenever the GoogleBot visits your website.
*
* Enabling notification of Google after every publish (in your _config.php):
*
* <example>
* GoogleSitemap::enable_google_notificaton();
* </example>
@ -79,12 +79,15 @@ class GoogleSitemap extends Controller {
public static function register_dataobject($className, $changeFreq = 'monthly', $priority = '0.6') {
if (!self::is_registered($className)) {
Object::add_extension($className, 'GoogleSitemapDecorator');
self::$google_sitemap_dataobjects[] = $className;
if ($changeFreq === null) {
if (!$changeFreq) {
self::$google_sitemap_dataobjects_changefreq[] = "monthly";
} else {
self::$google_sitemap_dataobjects_changefreq[] = $changeFreq;
}
self::$google_sitemap_dataobjects_priority[] = $priority;
}
}
@ -132,7 +135,7 @@ class GoogleSitemap extends Controller {
/**
* Returns all the links to {@link SiteTree} pages and
* {@link DataObject} urls on the page
* {@link DataObject} urls on the page.
*
* @return DataObjectSet
*/