Tepmlates fixes

This commit is contained in:
2022-01-26 21:30:25 +01:00
parent b4380aeb95
commit cddc8b970e
6 changed files with 123 additions and 82 deletions

View File

@@ -125,7 +125,7 @@ final class HomePresenter extends BaseFrontPresenter
$translation = $values->translation;
$clen = $values->clen;
$term = $values->string;
$result = $this->doSearch('TermsQuery',$translation,$term,$clen);
$this->template->result = $result;
}
@@ -171,56 +171,60 @@ final class HomePresenter extends BaseFrontPresenter
public function actionDefault()
{
if ($this->getRequest()->isMethod('GET') && $this->term) {
$this['searchForm']['string']->setValue($this->term);
$t = $this->slugs[$this->slug];
$result = $this->doSearch('TermsQuery',$t->id,$this->term);
if ($result) $this->template->result = $result;
}
$this['searchForm']->onSuccess[] = array($this, 'searchFormSucceeded');
/*
if ($this->getRequest()->isMethod('GET') && $this->term) {
$this['searchForm']['string']->setValue($this->term);
$t = $this->slugs[$this->slug];
$result = $this->doSearch('TermsQuery',$t->id,$this->term);
if ($result) $this->template->result = $result;
}
*/
$this['searchForm']->onSuccess[] = array($this, 'searchFormSucceeded');
}
public function actionSelect($slug,$term = null)
{
$this['searchForm']->onSuccess[] = array($this, 'searchFormSucceededIpa');
if ($this->getRequest()->isMethod('GET')) {
if (isset($this->slugs[$slug])) {
$t = $this->slugs[$slug];
$this['searchForm']['translation']->setValue($t->id);
$translation = $t;
}
} else {
$id = $this['searchForm']['translation']->value;
if (isset($this->translations[$id])) {
$t = $this->translations[$id];
$this->redirect('Homepage:select',$t["slug"],$this['searchForm']['string']->value);
$this['searchForm']->onSuccess[] = array($this, 'searchFormSucceededIpa');
if ($this->getRequest()->isMethod('GET')) {
if (isset($this->slugs[$slug])) {
$t = $this->slugs[$slug];
$this['searchForm']['translation']->setValue($t->id);
$translation = $t;
}
} else {
$id = $this['searchForm']['translation']->value;
dump($id);
if (isset($this->translations[$id])) {
$t = $this->translations[$id];
$this->redirect('Front:Home:select',$t["slug"],$this['searchForm']['string']->value);
}
}
}
if ($term) {
$query = new TermsFullQuery($translation->dictionary,$term,$translation->direction);
$result = $this->repoTerms->fetch($query);
if ($term) {
$query = new TermsFullQuery($translation->dictionary,$term,$translation->direction);
$result = $this->repoTerms->fetch($query);
$this->template->result = $result;
$this->template->translation = $translation;
}
$this->setView('ipa');
$this->template->result = $result;
$this->template->translation = $translation;
}
$this->setView('ipa');
}
public function handleGetInfo($id)
{
$term = $this->repoTerms->find($id);
$termFlags = $this->repoTermFlags->findAssoc([],'id');
$term = $this->repoTerms->find($id);
$termFlags = $this->repoTermFlags->findAssoc([],'id');
$dictionary = $term->dictionary;
$dictionary = $term->dictionary;
$query = new TermsFullQuery($dictionary,$term->string1,1,false);
$result = $this->repoTerms->fetch($query);
$query = new TermsFullQuery($dictionary,$term->string1,1,false);
$result = $this->repoTerms->fetch($query);
$this->template->result = $result;
$this->template->termFlags = $termFlags;
$this->template->result = $result;
$this->template->termFlags = $termFlags;
$this->setView('info');
$this->setView('info');
}
public function renderDefault()