Anthony RICHARD 1 year ago
commit 36e559ff8e

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 307 KiB

@ -27,7 +27,15 @@ class TeacherController extends UserController
$vocab = $mdl->removeVocById($id);
echo $twig->render('manageVocabListView.html', [ 'vocabularies' => $vocab, 'userID' => $user->getId(), 'userRole' => $user->getRoles() ]);
}
public function getContent(){
global $twig;
global $user;
$mdl = new MdlTeacher();
$name = Validation::filter_str_simple($_GET['vocabID'] ?? null);
$content= $mdl->findByIdVoc($name);
echo $twig->render('manageVocabListView.html', ['content' => $content, 'userID' => $user->getId(), 'userRole' => $user->getRoles() ]);
}
public function showVocabListForm(): void {
global $twig;
global $user;

@ -30,6 +30,11 @@ class MdlTeacher extends MdlUser
$res = $gtw->findByName($name);
return $res;
}
public function findByIdVoc($id):array {
$gtw = new TranslationGateway();
return $gtw->findByIdVoc($id);
}
public function RemoveVocById(int $id):void{
$gtw = new VocabularyListGateway();

@ -7,10 +7,8 @@
<meta name="description" content="" />
<meta name="author" content="" />
<title>In English Please!</title>
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Font Awesome icons (free version)-->
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<!-- Google fonts-->
<link rel="icon" type="image/x-icon" href="{{base}}/assets/favicon.ico"/>
<!-- Font Awesome icons (free version)--><!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet" />
<link
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
@ -158,10 +156,6 @@
<footer class="footer bg-black small text-center text-white-50">
<div class="container px-4 px-lg-5">Copyright &copy; SegWave</div>
</footer>
<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core theme JS-->
<script src="{{base}}/js/scripts.js"></script>
</body>
</html>

@ -29,7 +29,7 @@
<div class="content">
<section class="VocabularyList">
<h2>My lists</h2>
{% include 'vocabularyContainer.twig' with {'actions' : ['affContent', 'delById'], 'vocabularies' : vocabularies } %}
{% include 'vocabularyContainer.twig' with {'actions' : ['affContent', 'delById', 'getContent' ], 'vocabularies' : vocabularies, 'vocabID' : vocabID, 'content' : content } %}
</section>
<section>
<h2>Content</h2>

@ -27,8 +27,10 @@
<li class="nav-item"><a class="nav-link" href="{{ base }}/teacher/{{ userID }}/showAccountInfos">My account</a></li>
{% endif %}
{% if userRole is empty %}
<li class="nav-item"><a class="nav-link" href="#game">Game</a></li>
<li class="nav-item"><a class="nav-link" href="#download">Download</a></li>
<li class="nav-item"><a class="nav-link" href="{{base}}/visitor/login">Login</a></li>
{% else %}
{% else %}
<li class="nav-item"><a class="nav-link" href="{{ base }}/visitor/disconnect">Log out</a></li>
{% endif %}

@ -16,15 +16,19 @@
{% if actions is defined%}
<td>
{% if 'getByName' in actions %}
<a href="{{base}}/teacher/{{userId}}/getByName?listName={{selectedName}}">
{% if 'getContent' in actions %}
<a href="{{base}}/teacher/{{userID}}/getContent?vocabID={{row.id}}">
<input class="btn-black" type="button" value="aff content" />
</a>
{% endif %}
{% if 'delById' in actions %}
<a id="delButton" href="{{base}}/teacher/{{userId}}/delById?vocabID={{ row.id }}">
<a id="delButton" href="{{base}}/teacher/{{userID}}/delById?vocabID={{ row.id }}">
<input class="btn-black" type="button" value="delete from vocabulary" />
</a>
{% endif %}
{% endif %}
{% endfor %}

Loading…
Cancel
Save