ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilAssQuestionPreviewToolbarGUI.php
Go to the documentation of this file.
1 <?php
2 
26 {
29  private $editPageCmd;
31 
32  public function __construct(ilLanguage $lng)
33  {
34  $this->lng = $lng;
35  global $DIC;
36  $this->ilCtrl = $DIC->ctrl();
37 
39  }
40 
41  public function build(): void
42  {
43  // Edit Question
44  if ($this->getEditQuestionCmd() !== null) {
45  $button_edit_question = $this->ui->factory()->button()->primary($this->lng->txt('edit_question'), $this->getEditQuestionCmd());
46  $this->addComponent($button_edit_question);
47  }
48 
49  // Edit Page
50  if ($this->getEditPageCmd() !== null) {
51  $button_edit_page = $this->ui->factory()->button()->standard($this->lng->txt('edit_page'), $this->getEditPageCmd());
52  $this->addComponent($button_edit_page);
53  }
54 
55  //Reset Preview
56  $action = $this->ilCtrl->getLinkTargetByClass(ilAssQuestionPreviewGUI::class, $this->getResetPreviewCmd());
57  $button = $this->ui->factory()->button()->standard($this->lng->txt('qpl_reset_preview'), $action);
58  $this->addComponent($button);
59  }
60 
61  public function setResetPreviewCmd($resetPreviewCmd): void
62  {
63  $this->resetPreviewCmd = $resetPreviewCmd;
64  }
65 
66  public function getResetPreviewCmd()
67  {
69  }
70 
74  public function getEditQuestionCmd()
75  {
77  }
78 
82  public function setEditQuestionCmd($editQuestionCmd): void
83  {
84  $this->editQuestionCmd = $editQuestionCmd;
85  }
86 
90  public function getEditPageCmd()
91  {
92  return $this->editPageCmd;
93  }
94 
98  public function setEditPageCmd($editPageCmd): void
99  {
100  $this->editPageCmd = $editPageCmd;
101  }
102 }
addComponent(\ILIAS\UI\Component\Component $a_comp)
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)