Merge pull request #1093 from dhensby/patch-1

Implement `TemplateGlobalProvider` on `SiteConfig`
This commit is contained in:
Will Rossiter 2014-08-23 09:24:26 +12:00
commit 3f902eb9fc

View File

@ -17,7 +17,7 @@
* @author Tom Rix
* @package cms
*/
class SiteConfig extends DataObject implements PermissionProvider {
class SiteConfig extends DataObject implements PermissionProvider, TemplateGlobalProvider {
private static $db = array(
"Title" => "Varchar(255)",
"Tagline" => "Varchar(255)",
@ -309,4 +309,14 @@ class SiteConfig extends DataObject implements PermissionProvider {
return false;
}
/**
* Add $SiteConfig to all SSViewers
*/
public static function get_template_global_variables() {
return array(
'SiteConfig' => 'current_site_config',
);
}
}