diff --git a/Project/php/assets/favicon.ico b/Project/php/assets/favicon.ico index 9356735..61db0e4 100755 Binary files a/Project/php/assets/favicon.ico and b/Project/php/assets/favicon.ico differ diff --git a/Project/php/controller/TeacherController.php b/Project/php/controller/TeacherController.php index 729f6e3..dac863e 100755 --- a/Project/php/controller/TeacherController.php +++ b/Project/php/controller/TeacherController.php @@ -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; diff --git a/Project/php/model/MdlTeacher.php b/Project/php/model/MdlTeacher.php index 786f8d6..992b86a 100755 --- a/Project/php/model/MdlTeacher.php +++ b/Project/php/model/MdlTeacher.php @@ -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(); diff --git a/Project/php/templates/home.html b/Project/php/templates/home.html index 0562ede..38284a5 100755 --- a/Project/php/templates/home.html +++ b/Project/php/templates/home.html @@ -7,10 +7,8 @@