Skip to content

Commit

Permalink
Portfolio: Add category title translated when you edit/create a post …
Browse files Browse the repository at this point in the history
…- refs BT#19052
  • Loading branch information
cfasanando committed Oct 14, 2021
1 parent 011aac5 commit 6da2582
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main/inc/lib/PortfolioController.php
Expand Up @@ -482,11 +482,11 @@ public function addItem()
$categoriesSelect->addOption(get_lang('SelectACategory'), 0);
$parentCategories = $this->getCategoriesForIndex(null, 0);
foreach ($parentCategories as $parentCategory) {
$categoriesSelect->addOption($parentCategory->getTitle(), $parentCategory->getId());
$categoriesSelect->addOption($this->translateDisplayName($parentCategory->getTitle()), $parentCategory->getId());
$subCategories = $this->getCategoriesForIndex(null, $parentCategory->getId());
if (count($subCategories) > 0) {
foreach ($subCategories as $subCategory) {
$categoriesSelect->addOption(' — '.$subCategory->getTitle(), $subCategory->getId());
$categoriesSelect->addOption(' — '.$this->translateDisplayName($subCategory->getTitle()), $subCategory->getId());
}
}
}
Expand Down Expand Up @@ -693,11 +693,11 @@ public function editItem(Portfolio $item)
$categoriesSelect->addOption(get_lang('SelectACategory'), 0);
$parentCategories = $this->getCategoriesForIndex(null, 0);
foreach ($parentCategories as $parentCategory) {
$categoriesSelect->addOption($parentCategory->getTitle(), $parentCategory->getId());
$categoriesSelect->addOption($this->translateDisplayName($parentCategory->getTitle()), $parentCategory->getId());
$subCategories = $this->getCategoriesForIndex(null, $parentCategory->getId());
if (count($subCategories) > 0) {
foreach ($subCategories as $subCategory) {
$categoriesSelect->addOption(' — '.$subCategory->getTitle(), $subCategory->getId());
$categoriesSelect->addOption(' — '.$this->translateDisplayName($subCategory->getTitle()), $subCategory->getId());
}
}
}
Expand Down

0 comments on commit 6da2582

Please sign in to comment.