remove obsolete code

This commit is contained in:
Audrey Jensen 2023-06-29 20:06:57 +00:00
parent ff923ab3a4
commit b9996d942d
2 changed files with 5 additions and 23 deletions

View File

@ -48,8 +48,7 @@ class ComplaintController extends AbstractController
{
$isSubmitted = null;
}
$headerFile = Yaml::parseFile('../config/portalLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP);
return $this->render('complaint.html.twig',['header' => $headerFile, 'form' => $form, 'isSubmitted' => $isSubmitted]);
return $this->render('complaint.html.twig',['form' => $form, 'isSubmitted' => $isSubmitted]);
}
public function sendEmail(TransportTransportInterface $mailer, string $message, LoggerInterface $log) : bool
{

View File

@ -17,15 +17,12 @@ class SafetyController extends AbstractController
#[Route('/training/safety', name: 'safetyHome')]
public function Index() : Response
{
$headerFile = Yaml::parseFile('../config/portalLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP);
$contentFile = Yaml::parseFile('../config/safetyLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP);
return $this->render('Training/Safety/safetyHome.html.twig',['header' => $headerFile, 'content' => $contentFile]);
return $this->render('Training/Safety/safetyHome.html.twig',['content' => $contentFile]);
}
#[Route('/training/safety/quiz')]
public function Quiz(Request $request, LoggerInterface $log)
{
$headerFile = Yaml::parseFile('../config/portalLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP);
$form = $this->createForm(SafetyQuizType::class);
$form->handleRequest($request);
if($form->isSubmitted() && $form->isValid())
@ -43,10 +40,10 @@ class SafetyController extends AbstractController
}
}
$log->Debug($testerName . ' quiz answers correct: ' . $correctAnswers);
return $this->render('Training/Safety/quizResults.html.twig', ['header'=>$headerFile, 'testerName'=>$testerName,
return $this->render('Training/Safety/quizResults.html.twig', ['testerName'=>$testerName,
'correctAnswers'=>$correctAnswers, 'totalAnswers'=>count($data)]);
}
return $this->render('Training/Safety/SafetyQuiz.html.twig',['header' => $headerFile, 'quiz'=>$form]);
return $this->render('Training/Safety/SafetyQuiz.html.twig',['quiz'=>$form]);
}
#[Route('/Training/Safety/Topics/{topic?}')]
public function Topics(?string $topic) : Response
@ -56,21 +53,7 @@ class SafetyController extends AbstractController
{
return $this->redirectToRoute('safetyHome');
}
$headerFile = Yaml::parseFile('../config/portalLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP);
$topicsFile = Yaml::parseFile('../config/safetyLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP);
$topic = strtolower($topic);
return $this->render('Training/Safety/Topics/'.$topic.".html.twig", ['headerFile'=> $headerFile]);
/* //Scan through each link file If we see what we need, then let's get it.
foreach($topicsFile['Cards'] as $card)
{
foreach($card as $item)
{
if($item['url']== $topic)
{
return $this->render('Training/Safety/Topics/'.$topic.".html.twig", ['headerFile'=> $headerFile]);
}
}
} */
return $this->render('Training/Safety/Topics/'.$topic.".html.twig");
}
}