Merge remote-tracking branch 'origin/3.0'

This commit is contained in:
Ingo Schommer 2012-08-12 22:21:19 +02:00
commit c3949f899e
2 changed files with 17 additions and 8 deletions

View File

@ -466,9 +466,15 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$addAction = $instance->i18n_singular_name();
// Get description
$description = _t($class . 'DESCRIPTION');
if(!$description) $description = $instance->uninherited('description');
if($class == 'Page' && !$description) $description = singleton('SiteTree')->uninherited('description');
$description = _t($class . '.DESCRIPTION');
if(!$description) {
$description = $instance->uninherited('description');
}
if($class == 'Page' && !$description) {
$description = singleton('SiteTree')->uninherited('description');
}
$result->push(new ArrayData(array(
'ClassName' => $class,
@ -480,6 +486,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
}
$result = $result->sort('AddAction');
return $result;
}

View File

@ -205,10 +205,12 @@ class SiteConfig extends DataObject implements PermissionProvider {
$siteConfig->Tagline = _t('SiteConfig.TAGLINEDEFAULT',"your tagline here");
if(class_exists('Translatable') && $siteConfig->hasExtension('Translatable')){
$defaultConfig = DataObject::get_one('SiteConfig');
Translatable::disable_locale_filter();
$defaultConfig = SiteConfig::get()->first();
Translatable::enable_locale_filter();
if($defaultConfig){
$siteConfig->Title = $defaultConfig->Title;
$siteConfig->Tagline = $defaultConfig->Tagline;
return $defaultConfig->createTranslation($locale);
}
// TODO Copy view/edit group settings