ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 (protected assQuestion $questionOBJ, protected readonly ilCtrl $ctrl, protected readonly ilTabsGUI $tabs, protected ilLanguage $lng)
 Constructor. More...
 
 forward ()
 this is the actual forward method that is to be implemented by derived forwarder classes More...
 

Additional Inherited Members

 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
RequestDataCollector $request
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

@access public

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

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

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...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26

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

+ 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

@access protected

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

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...
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
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.

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

+ Here is the call graph for this function:

◆ forward()

ilAssQuestionFeedbackPageObjectCommandForwarder::forward ( )

forward method

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

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

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

+ Here is the call graph for this function:

◆ getPageObjectGUI()

ilAssQuestionFeedbackPageObjectCommandForwarder::getPageObjectGUI (   $pageObjectType,
  $pageObjectId 
)

instantiates, initialises and returns a page object gui class

@access protected

Returns
ilAssGenFeedbackPageGUI|ilAssSpecFeedbackPageGUI

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

104 {
106 $pageObjectGUI = new ilAssGenFeedbackPageGUI($pageObjectId);
107 $pageObjectGUI->obj->addUpdateListener(
108 $this->questionOBJ,
109 'updateTimestamp'
110 );
111 $pageObjectGUI->setTemplateTargetVar('ADM_CONTENT');
112 $pageObjectGUI->setTemplateOutput(true);
113 return $pageObjectGUI;
114 }
115 $pageObjectGUI = new ilAssSpecFeedbackPageGUI($pageObjectId);
116 $pageObjectGUI->obj->addUpdateListener(
117 $this->questionOBJ,
118 'updateTimestamp'
119 );
120 $pageObjectGUI->setTemplateTargetVar('ADM_CONTENT');
121 $pageObjectGUI->setTemplateOutput(true);
122 return $pageObjectGUI;
123 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilAssQuestionFeedback\PAGE_OBJECT_TYPE_GENERIC_FEEDBACK.

Referenced by forward().

+ Here is the caller graph for this function:

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