Fixes
This commit is contained in:
@@ -8,12 +8,21 @@ use App\Model\Database\Entity\Attributes\TUpdatedAt;
|
||||
use App\Model\Exception\Logic\InvalidArgumentException;
|
||||
use App\Model\Security\Identity;
|
||||
use App\Model\Utils\DateTime;
|
||||
use App\Model\Utils\Strings;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Model\Database\Repository\UserRepository")
|
||||
* @ORM\Table(name="`user`")
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*
|
||||
* @property int $id
|
||||
* @property String $name
|
||||
* @property String $surname
|
||||
* @property String $email
|
||||
* @property String $password
|
||||
* @property String $role
|
||||
* @property int $state
|
||||
*/
|
||||
class User extends AbstractEntity
|
||||
{
|
||||
|
||||
@@ -22,8 +22,8 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
{
|
||||
|
||||
|
||||
/** @inject @var \App\Model\Database\EntityManager */
|
||||
public $em;
|
||||
/** @inject @var EntityManager */
|
||||
public EntityManager $em;
|
||||
/** @inject */
|
||||
public VisualPaginatorFactory $visualPaginatorFactory;
|
||||
/** @inject */
|
||||
@@ -38,6 +38,7 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
|
||||
/** @persistent */
|
||||
public $term;
|
||||
|
||||
/** @persistent */
|
||||
public $slug;
|
||||
|
||||
@@ -58,7 +59,6 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
$translations[$t->getId()]["lang"] = $lang;
|
||||
$translations[$t->getId()]["t"] = $t;
|
||||
$slugs[$slug] = $t;
|
||||
|
||||
}
|
||||
$this->translations = $translations;
|
||||
$this->dictionaries = $drs;
|
||||
@@ -117,6 +117,7 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
->setRequired('Vyberte slovnik');
|
||||
$form->addText('clen', 'Clen', 5);
|
||||
$form->addSubmit('search', 'Vyhaľadaj');
|
||||
$form->onSuccess[] = array($this, 'searchFormSucceeded');
|
||||
return $form;
|
||||
}
|
||||
|
||||
@@ -127,6 +128,8 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
$term = $values->string;
|
||||
|
||||
$result = $this->doSearch('TermsQuery', $translation, $term, $clen);
|
||||
$this->term = $term;
|
||||
dump($result);
|
||||
$this->template->result = $result;
|
||||
}
|
||||
|
||||
@@ -157,7 +160,6 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
$basepath = $this->getHttpRequest()->url->basePath . "/media";
|
||||
$oggResp = new OggResponse($id, $pron->filename);
|
||||
return $this->sendResponse($oggResp);
|
||||
|
||||
}
|
||||
|
||||
public function beforeRender()
|
||||
@@ -171,14 +173,15 @@ 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;
|
||||
} else {
|
||||
//dumpe($this);
|
||||
$this->term = $this['searchForm']['string']->getValue();
|
||||
}
|
||||
*/
|
||||
$this['searchForm']->onSuccess[] = array($this, 'searchFormSucceeded');
|
||||
}
|
||||
|
||||
@@ -199,7 +202,6 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
$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);
|
||||
@@ -274,13 +276,9 @@ final class HomePresenter extends BaseFrontPresenter
|
||||
|
||||
public function renderIpa()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function renderMerge()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
0
app/modules/Front/Home/SearchPresenter.php
Normal file
0
app/modules/Front/Home/SearchPresenter.php
Normal file
Reference in New Issue
Block a user