Fix nette 3.0

This commit is contained in:
2022-01-30 22:35:13 +01:00
parent 7ecaa70768
commit a4b67569a4
9 changed files with 82 additions and 53 deletions

View File

@@ -41,6 +41,7 @@ abstract class BaseFrontPresenter extends UnsecuredPresenter
protected function startup()
{
$trs = $this->em->getRepository(Translation::class)->findBy([], ['id' => 'ASC', 'direction' => 'ASC']);
$drs = $this->em->getRepository(Dictionary::class)->findPairs('id', 'name');
$select = [];
@@ -52,10 +53,10 @@ abstract class BaseFrontPresenter extends UnsecuredPresenter
$lang = mb_substr($lang1, 0, -1);
$lang .= "o-" . $lang2;
$slug = Strings::webalize($lang);
$select[$drs[$t->getDictionary()->getId()]][$t->getId()] = $lang;
$translations[$t->getId()]["slug"] = $slug;
$translations[$t->getId()]["lang"] = $lang;
$translations[$t->getId()]["t"] = $t;
$select[$drs[$t->getDictionary()->id]][$t->id] = $lang;
$translations[$t->id]["slug"] = $slug;
$translations[$t->id]["lang"] = $lang;
$translations[$t->id]["t"] = $t;
$slugs[$slug] = $t;
}
$this->translations = $translations;