Skip to content

Commit

Permalink
remove sitelocales module dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Pieter van der Poel committed Jan 26, 2017
1 parent a8f4471 commit 568ef9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
17 changes: 9 additions & 8 deletions code/model/YearCalendarItemTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getCMSFields()
'SortOrder',
]);

$fields->addFieldsToTab('Root.Translations', $this->getTranslatableTabSet());
$fields->addFieldsToTab('Root.Main', $this->getTranslatableTabSet());

if ($segmentFields = $this->getLocalizedFieldnames('URLSegment')) {
$fields->removeByName($segmentFields);
Expand Down Expand Up @@ -173,14 +173,15 @@ public function CssColorString()
protected function getLocalizedFieldnames($field)
{
$fieldnames = [];
if ($locales = SiteLocaleConfig::inst()
->getAllowedLocales()
) {
foreach ($locales as $locale) {
array_push($fieldnames, TranslatableDataObject::localized_field($field, $locale));
}
if (class_exists('Translatable')) {

if ($locales = Translatable::get_allowed_locales()) {
foreach ($locales as $locale) {
array_push($fieldnames, TranslatableDataObject::localized_field($field, $locale));
}

return $fieldnames;
return $fieldnames;
}
}

return false;
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"silverstripe/tagfield": "^1.0",
"mediaweb/datetime": "^1.0",
"sabre/vobject": "~4.1",
"bummzack/translatable-dataobject": "1.*",
"novatio/silverstripe-sitelocales": "1.*"
"bummzack/translatable-dataobject": "1.*"
},
"extra": {
"installer-name": "yearcalendar"
Expand Down

0 comments on commit 568ef9c

Please sign in to comment.