ILIAS  trunk Revision v5.2.0beta1-34132-g2d4d73d4a0
ilAssQuestionFeedbackPageObjectCommandForwarder Class Reference
+ Inheritance diagram for ilAssQuestionFeedbackPageObjectCommandForwarder:
+ Collaboration diagram for ilAssQuestionFeedbackPageObjectCommandForwarder:

Public Member Functions

 __construct (assQuestion $questionOBJ, ilCtrl $ctrl, ilTabsGUI $tabs, ilLanguage $lng)
 Constructor. More...
 
 forward ()
 forward method More...
 
 ensurePageObjectExists ($pageObjectType, $pageObjectId)
 ensures an existing page object with giben type/id More...
 
 getPageObjectGUI ($pageObjectType, $pageObjectId)
 instantiates, initialises and returns a page object gui class More...
 
- Public Member Functions inherited from ilAssQuestionAbstractPageObjectCommandForwarder
 __construct (assQuestion $questionOBJ, ilCtrl $ctrl, ilTabsGUI $tabs, ilLanguage $lng)
 Constructor. More...
 
 forward ()
 this is the actual forward method that is to be implemented by derived forwarder classes More...
 

Additional Inherited Members

- Protected Member Functions inherited from ilAssQuestionAbstractPageObjectCommandForwarder
 ensurePageObjectExists ($pageObjectType, $pageObjectId)
 ensures an existing page object with giben type/id More...
 
 getPageObjectGUI ($pageObjectType, $pageObjectId)
 instantiates, initialises and returns a page object gui object More...
 
- Protected Attributes inherited from ilAssQuestionAbstractPageObjectCommandForwarder
ILIAS TestQuestionPool InternalRequestService $request
 
 $questionOBJ = null
 
 $ctrl = null
 
 $tabs = null
 
 $lng = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionFeedbackPageObjectCommandForwarder::__construct ( assQuestion  $questionOBJ,
ilCtrl  $ctrl,
ilTabsGUI  $tabs,
ilLanguage  $lng 
)

Constructor.

public

Parameters
assQuestion$questionOBJ
ilCtrl$ctrl
ilTabsGUI$tabs
ilLanguage$lng

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilAssQuestionFeedbackEditingGUI\CMD_SHOW, ILIAS\Repository\ctrl(), ILIAS\Repository\int(), and ilAssQuestionFeedback\isValidFeedbackPageObjectType().

39  {
40  global $DIC;
41  $main_tpl = $DIC->ui()->mainTemplate();
42  parent::__construct($questionOBJ, $ctrl, $tabs, $lng);
43 
44  if (!$this->request->isset('feedback_id') || !(int) $this->request->raw('feedback_id') || !$questionOBJ->feedbackOBJ->checkFeedbackParent((int) $this->request->raw('feedback_id'))) {
45  $main_tpl->setOnScreenMessage('failure', 'invalid feedback id given: ' . (int) $this->request->raw('feedback_id'), true);
46  $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
47  }
48 
49  if (!$this->request->isset('feedback_type') || !ilAssQuestionFeedback::isValidFeedbackPageObjectType($this->request->raw('feedback_type'))) {
50  $main_tpl->setOnScreenMessage('failure', 'invalid feedback type given: ' . $this->request->raw('feedback_type'), true);
51  $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
52  }
53  }
static isValidFeedbackPageObjectType(string $feedbackPageObjectType)
returns the fact whether the given page object type relates to generic or specific feedback page obje...
$DIC
Definition: xapitoken.php:62
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ ensurePageObjectExists()

ilAssQuestionFeedbackPageObjectCommandForwarder::ensurePageObjectExists (   $pageObjectType,
  $pageObjectId 
)

ensures an existing page object with giben type/id

protected

Definition at line 79 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

References ilPageObject\_exists(), ilAssQuestionFeedback\PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and ilAssQuestionFeedback\PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

79  : void
80  {
82  && !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
83  $pageObject = new ilAssGenFeedbackPage();
84  $pageObject->setParentId($this->questionOBJ->getId());
85  $pageObject->setId($pageObjectId);
86  $pageObject->createFromXML();
87  }
89  && !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
90  $pageObject = new ilAssSpecFeedbackPage();
91  $pageObject->setParentId($this->questionOBJ->getId());
92  $pageObject->setId($pageObjectId);
93  $pageObject->createFromXML();
94  }
95  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
+ Here is the call graph for this function:

◆ forward()

ilAssQuestionFeedbackPageObjectCommandForwarder::forward ( )

forward method

Definition at line 58 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

References ilAssQuestionFeedbackEditingGUI\CMD_SHOW, ILIAS\Repository\ctrl(), getPageObjectGUI(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

58  : void
59  {
60  $pageObjectGUI = $this->getPageObjectGUI($this->request->raw('feedback_type'), $this->request->raw('feedback_id'));
61  $pageObjectGUI->setEnabledTabs(true);
62 
63  $this->tabs->setBackTarget(
64  $this->lng->txt('tst_question_feedback_back_to_feedback_form'),
65  $this->ctrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW)
66  );
67 
68  $this->ctrl->setParameter($pageObjectGUI, 'feedback_id', $this->request->raw('feedback_id'));
69  $this->ctrl->setParameter($pageObjectGUI, 'feedback_type', $this->request->raw('feedback_type'));
70 
71  $this->ctrl->forwardCommand($pageObjectGUI);
72  }
getPageObjectGUI($pageObjectType, $pageObjectId)
instantiates, initialises and returns a page object gui class
+ Here is the call graph for this function:

◆ getPageObjectGUI()

ilAssQuestionFeedbackPageObjectCommandForwarder::getPageObjectGUI (   $pageObjectType,
  $pageObjectId 
)

instantiates, initialises and returns a page object gui class

protected

Returns
ilAssGenFeedbackPageGUI|ilAssSpecFeedbackPageGUI

Definition at line 103 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

References ilAssQuestionFeedback\PAGE_OBJECT_TYPE_GENERIC_FEEDBACK.

Referenced by forward().

104  {
106  $pageObjectGUI = new ilAssGenFeedbackPageGUI($pageObjectId);
107  $pageObjectGUI->obj->addUpdateListener(
108  $this->questionOBJ,
109  'updateTimestamp'
110  );
111  return $pageObjectGUI;
112  }
113  $pageObjectGUI = new ilAssSpecFeedbackPageGUI($pageObjectId);
114  $pageObjectGUI->obj->addUpdateListener(
115  $this->questionOBJ,
116  'updateTimestamp'
117  );
118  return $pageObjectGUI;
119  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

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