ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilAssQuestionFeedbackEditingGUI Class Reference
+ Collaboration diagram for ilAssQuestionFeedbackEditingGUI:

Public Member Functions

 __construct (protected readonly assQuestionGUI $question_gui, protected readonly ilCtrl $ctrl, protected readonly ilAccessHandler $access, protected readonly ilGlobalTemplateInterface $tpl, protected readonly ilTabsGUI $tabs, protected readonly ilLanguage $lng, protected readonly ilHelpGUI $help, private readonly RequestDataCollector $request, private readonly ContentStyle $content_style, private readonly bool $in_pool_context=false)
 
 executeCommand ()
 
 confirmSyncCmd ()
 
 syncCmd ()
 

Data Fields

const CMD_SHOW = 'showFeedbackForm'
 
const CMD_SAVE = 'saveFeedbackForm'
 
const CMD_SHOW_SYNC = 'confirmSync'
 
const CMD_SYNC = 'sync'
 

Protected Member Functions

 setContentStyle ()
 

Protected Attributes

assQuestion $question_obj = null
 
ilAssQuestionFeedback $feedback_obj = null
 

Private Member Functions

 showFeedbackFormCmd (string $additional_content='')
 
 saveFeedbackFormCmd ()
 
 createFeedbackPageCmd ()
 
 buildForm ()
 
 isFormSaveable ()
 
 isSyncAfterSaveRequired ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionFeedbackEditingGUI::__construct ( protected readonly assQuestionGUI  $question_gui,
protected readonly ilCtrl  $ctrl,
protected readonly ilAccessHandler  $access,
protected readonly ilGlobalTemplateInterface  $tpl,
protected readonly ilTabsGUI  $tabs,
protected readonly ilLanguage  $lng,
protected readonly ilHelpGUI  $help,
private readonly RequestDataCollector  $request,
private readonly ContentStyle  $content_style,
private readonly bool  $in_pool_context = false 
)

Definition at line 41 of file class.ilAssQuestionFeedbackEditingGUI.php.

52  {
53  $this->question_obj = $question_gui->getObject();
54  $this->feedback_obj = $question_gui->getObject()->feedbackOBJ;
55  }

Member Function Documentation

◆ buildForm()

ilAssQuestionFeedbackEditingGUI::buildForm ( )
private

Definition at line 134 of file class.ilAssQuestionFeedbackEditingGUI.php.

References ILIAS\Repository\ctrl(), isFormSaveable(), and ILIAS\Repository\lng().

Referenced by saveFeedbackFormCmd(), and showFeedbackFormCmd().

135  {
136  $form = new ilPropertyFormGUI();
137  $form->setFormAction($this->ctrl->getFormAction($this));
138  $form->setTitle($this->lng->txt('feedback_generic'));
139  $form->setTableWidth("100%");
140  $form->setId("feedback");
141 
142  $this->feedback_obj->completeGenericFormProperties($form);
143  if ($this->question_obj->hasSpecificFeedback()) {
144  $this->feedback_obj->completeSpecificFormProperties($form);
145  }
146 
147  if ($this->isFormSaveable()) {
148  $form->addCommandButton(self::CMD_SAVE, $this->lng->txt("save"));
149  }
150 
151  return $form;
152  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmSyncCmd()

ilAssQuestionFeedbackEditingGUI::confirmSyncCmd ( )

Definition at line 180 of file class.ilAssQuestionFeedbackEditingGUI.php.

References showFeedbackFormCmd().

180  : void
181  {
182  $modal = $this->question_gui->getQuestionSyncModal(self::CMD_SYNC, self::class);
183  $this->showFeedbackFormCmd($modal);
184  }
+ Here is the call graph for this function:

◆ createFeedbackPageCmd()

ilAssQuestionFeedbackEditingGUI::createFeedbackPageCmd ( )
private

Definition at line 126 of file class.ilAssQuestionFeedbackEditingGUI.php.

References ILIAS\Repository\ctrl().

126  : void
127  {
128  $mode = $this->request->raw('fb_mode');
129  $this->ctrl->redirectToUrl(
130  $this->feedback_obj->createFeedbackPages($mode)
131  );
132  }
+ Here is the call graph for this function:

◆ executeCommand()

ilAssQuestionFeedbackEditingGUI::executeCommand ( )

Definition at line 57 of file class.ilAssQuestionFeedbackEditingGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), setContentStyle(), and ILIAS\Repository\tabs().

57  : void
58  {
59  $this->help->setScreenIdComponent('qpl');
60 
61  $cmd = $this->ctrl->getCmd(self::CMD_SHOW);
62  $nextClass = $this->ctrl->getNextClass($this);
63 
64  $this->ctrl->setParameter($this, 'q_id', $this->question_gui->getObject()->getId());
65 
66  $this->setContentStyle();
67 
68  switch ($nextClass) {
69  case 'ilassspecfeedbackpagegui':
70  case 'ilassgenfeedbackpagegui':
71  $forwarder = new ilAssQuestionFeedbackPageObjectCommandForwarder($this->question_obj, $this->ctrl, $this->tabs, $this->lng);
72  $forwarder->forward();
73  break;
74 
75  default:
76  $this->tabs->setTabActive('feedback');
77  $cmd .= 'Cmd';
78  $this->$cmd();
79  break;
80  }
81  }
+ Here is the call graph for this function:

◆ isFormSaveable()

ilAssQuestionFeedbackEditingGUI::isFormSaveable ( )
private

Definition at line 154 of file class.ilAssQuestionFeedbackEditingGUI.php.

Referenced by buildForm().

154  : bool
155  {
156  if ($this->question_obj->isAdditionalContentEditingModePageObject()
157  && !($this->feedback_obj->isSaveableInPageObjectEditingMode())) {
158  return false;
159  }
160  return true;
161  }
+ Here is the caller graph for this function:

◆ isSyncAfterSaveRequired()

ilAssQuestionFeedbackEditingGUI::isSyncAfterSaveRequired ( )
private

Definition at line 163 of file class.ilAssQuestionFeedbackEditingGUI.php.

Referenced by saveFeedbackFormCmd().

163  : bool
164  {
165  if ($this->in_pool_context) {
166  return false;
167  }
168 
169  if ($this->question_obj->isAdditionalContentEditingModePageObject()) {
170  return false;
171  }
172 
173  if (!$this->question_gui->needsSyncQuery()) {
174  return false;
175  }
176 
177  return true;
178  }
+ Here is the caller graph for this function:

◆ saveFeedbackFormCmd()

ilAssQuestionFeedbackEditingGUI::saveFeedbackFormCmd ( )
private

Definition at line 100 of file class.ilAssQuestionFeedbackEditingGUI.php.

References buildForm(), ILIAS\Repository\ctrl(), isSyncAfterSaveRequired(), and ILIAS\Repository\lng().

100  : void
101  {
102  $form = $this->buildForm();
103  $form->setValuesByPost();
104 
105  if ($form->checkInput()) {
106  $this->feedback_obj->saveGenericFormProperties($form);
107  if ($this->question_obj->hasSpecificFeedback()) {
108  $this->feedback_obj->saveSpecificFormProperties($form);
109  }
110  $this->question_obj->cleanupMediaObjectUsage();
111  $this->question_obj->updateTimestamp();
112 
113  if ($this->isSyncAfterSaveRequired()) {
114  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
115  $this->ctrl->redirect($this, self::CMD_SHOW_SYNC);
116  }
117 
118  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
119  $this->ctrl->redirect($this, self::CMD_SHOW);
120  }
121 
122  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
123  $this->tpl->setContent($this->ctrl->getHTML($form));
124  }
+ Here is the call graph for this function:

◆ setContentStyle()

ilAssQuestionFeedbackEditingGUI::setContentStyle ( )
protected

Definition at line 83 of file class.ilAssQuestionFeedbackEditingGUI.php.

Referenced by executeCommand().

83  : void
84  {
85  $this->content_style->gui()->addCss($this->tpl, $this->request->getRefId());
86  }
+ Here is the caller graph for this function:

◆ showFeedbackFormCmd()

ilAssQuestionFeedbackEditingGUI::showFeedbackFormCmd ( string  $additional_content = '')
private

Definition at line 88 of file class.ilAssQuestionFeedbackEditingGUI.php.

References buildForm().

Referenced by confirmSyncCmd(), and syncCmd().

88  : void
89  {
90  $form = $this->buildForm();
91 
92  $this->feedback_obj->initGenericFormProperties($form);
93  if ($this->question_obj->hasSpecificFeedback()) {
94  $this->feedback_obj->initSpecificFormProperties($form);
95  }
96 
97  $this->tpl->setContent($form->getHTML() . $additional_content);
98  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ syncCmd()

ilAssQuestionFeedbackEditingGUI::syncCmd ( )

Definition at line 186 of file class.ilAssQuestionFeedbackEditingGUI.php.

References showFeedbackFormCmd().

186  : void
187  {
188  $this->question_obj->syncWithOriginal();
189  $this->showFeedbackFormCmd();
190  }
+ Here is the call graph for this function:

Field Documentation

◆ $feedback_obj

ilAssQuestionFeedback ilAssQuestionFeedbackEditingGUI::$feedback_obj = null
protected

Definition at line 39 of file class.ilAssQuestionFeedbackEditingGUI.php.

◆ $question_obj

assQuestion ilAssQuestionFeedbackEditingGUI::$question_obj = null
protected

Definition at line 38 of file class.ilAssQuestionFeedbackEditingGUI.php.

◆ CMD_SAVE

const ilAssQuestionFeedbackEditingGUI::CMD_SAVE = 'saveFeedbackForm'

Definition at line 34 of file class.ilAssQuestionFeedbackEditingGUI.php.

◆ CMD_SHOW

◆ CMD_SHOW_SYNC

const ilAssQuestionFeedbackEditingGUI::CMD_SHOW_SYNC = 'confirmSync'

Definition at line 35 of file class.ilAssQuestionFeedbackEditingGUI.php.

◆ CMD_SYNC

const ilAssQuestionFeedbackEditingGUI::CMD_SYNC = 'sync'

Definition at line 36 of file class.ilAssQuestionFeedbackEditingGUI.php.


The documentation for this class was generated from the following file: