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 @@ In English Please! - - - - + +
Copyright © SegWave
- - - - \ No newline at end of file diff --git a/Project/php/templates/manageVocabListView.html b/Project/php/templates/manageVocabListView.html index ec80ecf..2092693 100755 --- a/Project/php/templates/manageVocabListView.html +++ b/Project/php/templates/manageVocabListView.html @@ -29,7 +29,7 @@

My lists

- {% include 'vocabularyContainer.twig' with {'actions' : ['affContent', 'delById'], 'vocabularies' : vocabularies } %} + {% include 'vocabularyContainer.twig' with {'actions' : ['affContent', 'delById', 'getContent' ], 'vocabularies' : vocabularies, 'vocabID' : vocabID, 'content' : content } %}

Content

diff --git a/Project/php/templates/navBar.twig b/Project/php/templates/navBar.twig index 12b403f..6a96ecf 100755 --- a/Project/php/templates/navBar.twig +++ b/Project/php/templates/navBar.twig @@ -27,8 +27,10 @@ {% endif %} {% if userRole is empty %} + + - {% else %} + {% else %} {% endif %} diff --git a/Project/php/templates/vocabularyContainer.twig b/Project/php/templates/vocabularyContainer.twig index 54da6ac..32ac29a 100755 --- a/Project/php/templates/vocabularyContainer.twig +++ b/Project/php/templates/vocabularyContainer.twig @@ -16,15 +16,19 @@ {% if actions is defined%} - {% if 'getByName' in actions %} - + {% if 'getContent' in actions %} + + + {% endif %} + {% if 'delById' in actions %} - + {% endif %} + {% endif %} {% endfor %}