Tepmlates fixes
This commit is contained in:
@@ -48,6 +48,38 @@ class Pronunciation extends AbstractEntity
|
|||||||
* @ORM\Column(type="string", nullable=true)
|
* @ORM\Column(type="string", nullable=true)
|
||||||
*/
|
*/
|
||||||
protected $filename;
|
protected $filename;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of filename
|
||||||
|
*/
|
||||||
|
public function getFilename()
|
||||||
|
{
|
||||||
|
return $this->filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of terms
|
||||||
|
*/
|
||||||
|
public function getTerms()
|
||||||
|
{
|
||||||
|
return $this->terms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of ipa
|
||||||
|
*/
|
||||||
|
public function getIpa()
|
||||||
|
{
|
||||||
|
return $this->ipa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of type
|
||||||
|
*/
|
||||||
|
public function getType()
|
||||||
|
{
|
||||||
|
return $this->type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Model\Database\Entity;
|
namespace App\Model\Database\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
use App\Model\Database\Entity\Attributes\TId;
|
use App\Model\Database\Entity\Attributes\TId;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\Common\Proxy\Proxy;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity(repositoryClass="App\Model\Database\Repository\TermRepository")
|
* @ORM\Entity(repositoryClass="App\Model\Database\Repository\TermRepository")
|
||||||
@@ -14,6 +16,7 @@ use App\Model\Database\Entity\Attributes\TId;
|
|||||||
* @property String $string1
|
* @property String $string1
|
||||||
* @property String $string2
|
* @property String $string2
|
||||||
* @property Dictionary $dictionary
|
* @property Dictionary $dictionary
|
||||||
|
* @property mixed $pronunciations
|
||||||
* @property Suffix $suffix1
|
* @property Suffix $suffix1
|
||||||
* @property Suffix $suffix2
|
* @property Suffix $suffix2
|
||||||
* @property DictType $type
|
* @property DictType $type
|
||||||
@@ -25,10 +28,10 @@ class Term extends AbstractEntity
|
|||||||
|
|
||||||
use Tid;
|
use Tid;
|
||||||
|
|
||||||
public function __construct(Dictionary $dictionary,$string)
|
public function __construct(Dictionary $dictionary, $string)
|
||||||
{
|
{
|
||||||
$this->dictionary = $dictionary;
|
$this->dictionary = $dictionary;
|
||||||
$this->string1 = $string;
|
$this->string1 = $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +39,7 @@ class Term extends AbstractEntity
|
|||||||
*/
|
*/
|
||||||
protected $dictionary;
|
protected $dictionary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string")
|
* @ORM\Column(type="string")
|
||||||
*/
|
*/
|
||||||
protected $string1;
|
protected $string1;
|
||||||
@@ -46,7 +49,6 @@ class Term extends AbstractEntity
|
|||||||
*/
|
*/
|
||||||
protected $string2;
|
protected $string2;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity="Suffix")
|
* @ORM\ManyToOne(targetEntity="Suffix")
|
||||||
*/
|
*/
|
||||||
@@ -57,7 +59,6 @@ class Term extends AbstractEntity
|
|||||||
*/
|
*/
|
||||||
protected $suffix2;
|
protected $suffix2;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity="DictType")
|
* @ORM\ManyToOne(targetEntity="DictType")
|
||||||
*/
|
*/
|
||||||
@@ -66,8 +67,9 @@ class Term extends AbstractEntity
|
|||||||
/**
|
/**
|
||||||
* @ORM\ManyToMany(targetEntity="Pronunciation", inversedBy="terms")
|
* @ORM\ManyToMany(targetEntity="Pronunciation", inversedBy="terms")
|
||||||
* @ORM\JoinTable(name="terms_pronunciations")
|
* @ORM\JoinTable(name="terms_pronunciations")
|
||||||
|
* @var Collection&iterable<Pronunciation>
|
||||||
*/
|
*/
|
||||||
protected $pronunciations;
|
protected Collection $pronunciations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string",nullable=true)
|
* @ORM\Column(type="string",nullable=true)
|
||||||
@@ -76,13 +78,13 @@ class Term extends AbstractEntity
|
|||||||
|
|
||||||
public function setMember($member)
|
public function setMember($member)
|
||||||
{
|
{
|
||||||
$this->member = $member;
|
$this->member = $member;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMember()
|
public function getMember()
|
||||||
{
|
{
|
||||||
return $this->member;
|
return $this->member;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,29 +99,26 @@ class Term extends AbstractEntity
|
|||||||
|
|
||||||
public function getFlags()
|
public function getFlags()
|
||||||
{
|
{
|
||||||
return $this->flags;
|
return $this->flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setFlags($flags)
|
public function setFlags($flags)
|
||||||
{
|
{
|
||||||
$this->flags = $flags;
|
$this->flags = $flags;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOrder2()
|
public function getOrder2()
|
||||||
{
|
{
|
||||||
return $this->order2;
|
return $this->order2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setOrder2($order2)
|
public function setOrder2($order2)
|
||||||
{
|
{
|
||||||
$this->order2 = $order2;
|
$this->order2 = $order2;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the value of string1
|
* Get the value of string1
|
||||||
*/
|
*/
|
||||||
@@ -219,6 +218,14 @@ class Term extends AbstractEntity
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
/**
|
||||||
|
* Get the value of pronunciations
|
||||||
|
*
|
||||||
|
* @return Collection&iterable<Pronunciation>
|
||||||
|
*/
|
||||||
|
public function getPronunciations()
|
||||||
|
{
|
||||||
|
return $this->pronunciations;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -171,56 +171,60 @@ final class HomePresenter extends BaseFrontPresenter
|
|||||||
|
|
||||||
public function actionDefault()
|
public function actionDefault()
|
||||||
{
|
{
|
||||||
if ($this->getRequest()->isMethod('GET') && $this->term) {
|
/*
|
||||||
$this['searchForm']['string']->setValue($this->term);
|
if ($this->getRequest()->isMethod('GET') && $this->term) {
|
||||||
$t = $this->slugs[$this->slug];
|
$this['searchForm']['string']->setValue($this->term);
|
||||||
$result = $this->doSearch('TermsQuery',$t->id,$this->term);
|
$t = $this->slugs[$this->slug];
|
||||||
if ($result) $this->template->result = $result;
|
$result = $this->doSearch('TermsQuery',$t->id,$this->term);
|
||||||
}
|
if ($result) $this->template->result = $result;
|
||||||
|
}
|
||||||
$this['searchForm']->onSuccess[] = array($this, 'searchFormSucceeded');
|
*/
|
||||||
|
$this['searchForm']->onSuccess[] = array($this, 'searchFormSucceeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionSelect($slug,$term = null)
|
public function actionSelect($slug,$term = null)
|
||||||
{
|
{
|
||||||
$this['searchForm']->onSuccess[] = array($this, 'searchFormSucceededIpa');
|
$this['searchForm']->onSuccess[] = array($this, 'searchFormSucceededIpa');
|
||||||
if ($this->getRequest()->isMethod('GET')) {
|
if ($this->getRequest()->isMethod('GET')) {
|
||||||
if (isset($this->slugs[$slug])) {
|
if (isset($this->slugs[$slug])) {
|
||||||
$t = $this->slugs[$slug];
|
$t = $this->slugs[$slug];
|
||||||
$this['searchForm']['translation']->setValue($t->id);
|
$this['searchForm']['translation']->setValue($t->id);
|
||||||
$translation = $t;
|
$translation = $t;
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($term) {
|
|
||||||
$query = new TermsFullQuery($translation->dictionary,$term,$translation->direction);
|
|
||||||
$result = $this->repoTerms->fetch($query);
|
|
||||||
|
|
||||||
$this->template->result = $result;
|
$id = $this['searchForm']['translation']->value;
|
||||||
$this->template->translation = $translation;
|
dump($id);
|
||||||
}
|
if (isset($this->translations[$id])) {
|
||||||
$this->setView('ipa');
|
$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);
|
||||||
|
|
||||||
|
$this->template->result = $result;
|
||||||
|
$this->template->translation = $translation;
|
||||||
|
}
|
||||||
|
$this->setView('ipa');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleGetInfo($id)
|
public function handleGetInfo($id)
|
||||||
{
|
{
|
||||||
$term = $this->repoTerms->find($id);
|
$term = $this->repoTerms->find($id);
|
||||||
$termFlags = $this->repoTermFlags->findAssoc([],'id');
|
$termFlags = $this->repoTermFlags->findAssoc([],'id');
|
||||||
|
|
||||||
$dictionary = $term->dictionary;
|
$dictionary = $term->dictionary;
|
||||||
|
|
||||||
$query = new TermsFullQuery($dictionary,$term->string1,1,false);
|
$query = new TermsFullQuery($dictionary,$term->string1,1,false);
|
||||||
$result = $this->repoTerms->fetch($query);
|
$result = $this->repoTerms->fetch($query);
|
||||||
|
|
||||||
$this->template->result = $result;
|
$this->template->result = $result;
|
||||||
$this->template->termFlags = $termFlags;
|
$this->template->termFlags = $termFlags;
|
||||||
|
|
||||||
$this->setView('info');
|
$this->setView('info');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderDefault()
|
public function renderDefault()
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ $( document ).ready(function() {
|
|||||||
{/block}
|
{/block}
|
||||||
{block content}
|
{block content}
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<p>Zadaj vyhladavany vyraz.</p>
|
<h2>Zadaj vyhladavany vyraz.</h2>
|
||||||
|
|
||||||
<div class="boxes">
|
<div class="boxes">
|
||||||
{form searchForm}
|
{form searchForm}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{block title}Slovnik{/block}
|
{block title}Slovnik{/block}
|
||||||
{layout ../@layout.latte}
|
|
||||||
{block head}
|
{block head}
|
||||||
<script>
|
<script>
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
@@ -7,7 +6,7 @@ $( document ).ready(function() {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
id = $(this).attr("data-sound-id");
|
id = $(this).attr("data-sound-id");
|
||||||
var audioElement = document.createElement('audio');
|
var audioElement = document.createElement('audio');
|
||||||
audioElement.setAttribute('src', {link Homepage:play} + "/" + id);
|
audioElement.setAttribute('src', {link Home:play} + "/" + id);
|
||||||
console.log("Play sound:" + id);
|
console.log("Play sound:" + id);
|
||||||
audioElement.play();
|
audioElement.play();
|
||||||
});
|
});
|
||||||
@@ -17,7 +16,7 @@ $(function() {
|
|||||||
$("input[name=" + select_name + "]").autocomplete({
|
$("input[name=" + select_name + "]").autocomplete({
|
||||||
source: function( request, response ) {
|
source: function( request, response ) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "{!$presenter->link('autocomplete')}",
|
url: {!$presenter->link('autocomplete')},
|
||||||
data: {
|
data: {
|
||||||
whichData: select_name,
|
whichData: select_name,
|
||||||
typedText: request.term,
|
typedText: request.term,
|
||||||
@@ -94,8 +93,8 @@ $(function() {
|
|||||||
{$last == $term->string1 && trim($last2) != '' && trim($term->string2) != '' ? ', ' : ''}{$term->string2}{**
|
{$last == $term->string1 && trim($last2) != '' && trim($term->string2) != '' ? ', ' : ''}{$term->string2}{**
|
||||||
Nutne kvoli newline
|
Nutne kvoli newline
|
||||||
**}
|
**}
|
||||||
{? $last = $term->string1}
|
{var $last = $term->string1}
|
||||||
{? $last2 = $term->string2}
|
{var $last2 = $term->string2}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</table>
|
</table>
|
||||||
{/ifset}
|
{/ifset}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{block title}Slovnik{/block}
|
{block title}Slovnik{/block}
|
||||||
{layout ../@layout.latte}
|
|
||||||
{block head}
|
{block head}
|
||||||
<script>
|
<script>
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
@@ -7,7 +6,7 @@ $( document ).ready(function() {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
id = $(this).attr("data-sound-id");
|
id = $(this).attr("data-sound-id");
|
||||||
var audioElement = document.createElement('audio');
|
var audioElement = document.createElement('audio');
|
||||||
var link = {link Homepage:play 123456 };
|
var link = {link Home:play 123456 };
|
||||||
audioElement.setAttribute('src', link.replace('123456',id));
|
audioElement.setAttribute('src', link.replace('123456',id));
|
||||||
console.log("Play sound:" + id);
|
console.log("Play sound:" + id);
|
||||||
audioElement.play();
|
audioElement.play();
|
||||||
@@ -56,8 +55,8 @@ $( document ).ready(function() {
|
|||||||
{$last == $term->string1 && trim($last2) != '' && trim($term->string2) != '' ? ', ' : ''}{$term->string2}{**
|
{$last == $term->string1 && trim($last2) != '' && trim($term->string2) != '' ? ', ' : ''}{$term->string2}{**
|
||||||
Nutne kvoli newline
|
Nutne kvoli newline
|
||||||
**}
|
**}
|
||||||
{? $last = $term->string1}
|
{var $last = $term->string1}
|
||||||
{? $last2 = $term->string2}
|
{var $last2 = $term->string2}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</table>
|
</table>
|
||||||
{/ifset}
|
{/ifset}
|
||||||
|
|||||||
Reference in New Issue
Block a user