ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilTestPlayerToolProvider.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 
26 {
28  {
29  return $this->context_collection->main();
30  }
31 
35  public function getToolsForContextStack(CalledContexts $called_contexts): array
36  {
37  $additionalData = $called_contexts->current()->getAdditionalData();
38  $has_question_list = $additionalData->exists(ilTestPlayerLayoutProvider::TEST_PLAYER_QUESTIONLIST);
39 
40  if (!$has_question_list) {
41  return [];
42  }
43 
44  $ui = $this->dic->ui();
45  $lng = $this->dic->language();
46 
47  return [
48  $this->factory->tool(
49  $this->identification_provider->contextAwareIdentifier('tst_qst_list')
50  )->withSymbol($ui->factory()->symbol()->icon()->standard('tst', $lng->txt('more')))
51  ->withTitle($lng->txt('mainbar_button_label_questionlist'))
52  ->withContent(
53  $ui->factory()->legacy()->content(
54  $ui->renderer()->render(
55  $called_contexts->current()->getAdditionalData()->get(ilTestPlayerLayoutProvider::TEST_PLAYER_QUESTIONLIST)
56  )
57  )
58  )
59  ];
60  }
61 }
factory()
getToolsForContextStack(CalledContexts $called_contexts)
global $lng
Definition: privfeed.php:31