Skip to content

Commit

Permalink
Merge branch '3' into 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Apr 19, 2024
2 parents 38bad2d + ed0f42a commit 31bcc5c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
8 changes: 8 additions & 0 deletions lang/sk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ sk:
PLURALNAME: 'Kategórie blogu'
SINGULARNAME: 'Kategória blogu'
Title: Názov
belongs_many_many_BlogPosts: 'Príspevky v blogu'
db_Title: Názov
db_URLSegment: 'Časť URL'
has_one_Blog: Blog
SilverStripe\Blog\Model\BlogMemberExtension:
BLOGPOSTS: 'Základné stránky'
TABBLOGPOSTS: 'Základné stránky'
belongs_many_many_BlogPosts: 'Príspevky v blogu'
db_BlogProfileSummary: 'Prehľad profilu blogu'
db_URLSegment: 'Časť URL'
has_one_BlogProfileImage: 'Profilový obrázok blogu'
SilverStripe\Blog\Model\BlogObject:
Title: Názov
SilverStripe\Blog\Model\BlogPost:
Expand All @@ -75,7 +81,9 @@ sk:
PLURALNAME: 'Štítky blogu'
SINGULARNAME: 'Štítok blogu'
Title: Názov
belongs_many_many_BlogPosts: 'Príspevky v blogu'
db_Title: Názov
db_URLSegment: 'Časť URL'
has_one_Blog: Blog
SilverStripe\Blog\Widgets\BlogArchiveWidget:
ArchiveType: 'Typ archívu'
Expand Down
10 changes: 10 additions & 0 deletions lang/sl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,27 @@ sl:
AND: in
Archive: Arhiv
Comments: Komentarji
FILTERDESCRIPTION_PAGE: 'Stran {page}'
PLURALNAME: 'Izvorna stran'
SilverStripe\Blog\Model\BlogCategory:
belongs_many_many_BlogPosts: 'Zapisi na blogu'
db_Title: Naziv
db_URLSegment: 'Naslov URL'
SilverStripe\Blog\Model\BlogMemberExtension:
belongs_many_many_BlogPosts: 'Zapisi na blogu'
db_BlogProfileSummary: 'Povzetek blogerskega profila'
db_URLSegment: 'Naslov URL'
has_one_BlogProfileImage: 'Osebna podoba'
SilverStripe\Blog\Model\BlogObject:
Title: Naziv
SilverStripe\Blog\Model\BlogPost:
AUTHOR: Avtor
PLURALNAME: 'Izvorna stran'
SilverStripe\Blog\Model\BlogTag:
belongs_many_many_BlogPosts: 'Zapisi na blogu'
db_Title: Naziv
db_URLSegment: 'Naslov URL'
SilverStripe\Blog\Widgets\BlogCategoriesWidget:
Sort: Razvrščanje
SilverStripe\Blog\Widgets\BlogTagsWidget:
Sort: Razvrščanje
9 changes: 4 additions & 5 deletions src/Model/BlogMemberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class BlogMemberExtension extends DataExtension
'BlogProfileImage' => Image::class
];

private static array $owns = [
'BlogProfileImage',
];

/**
* @var array
*/
Expand All @@ -59,11 +63,6 @@ public function onBeforeWrite()
$this->owner->URLSegment = preg_replace('/-[0-9]+$/', '', $this->owner->URLSegment ?? '') . '-' . $count;
$count++;
}

// Auto publish profile images
if ($this->owner->BlogProfileImage() && $this->owner->BlogProfileImage()->exists()) {
$this->owner->BlogProfileImage()->publishSingle();
}
}

/**
Expand Down

0 comments on commit 31bcc5c

Please sign in to comment.