ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExAssTypeBlogGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilExAssTypeBlogGUI:
+ Collaboration diagram for ilExAssTypeBlogGUI:

Public Member Functions

 __construct (protected \ILIAS\Exercise\InternalDomainService $domain, protected \ILIAS\Exercise\InternalGUIService $gui)
 
 addEditFormCustomProperties (ilPropertyFormGUI $form)
 Add custom form properties to edit form. More...
 
 importFormToAssignment (ilExAssignment $ass, ilPropertyFormGUI $form)
 Get values from form and put them into assignment. More...
 
 getFormValuesArray (ilExAssignment $ass)
 Get form values array from assignment.
Returns
array
More...
 
 getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 Add overview content of submission to info screen object. More...
 
 buildSubmissionPropertiesAndActions (\ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI $builder)
 
- Public Member Functions inherited from ilExAssignmentTypeGUIInterface
 addEditFormCustomProperties (ilPropertyFormGUI $form)
 Add custom form properties to edit form. More...
 
 importFormToAssignment (ilExAssignment $ass, ilPropertyFormGUI $form)
 Get values from form and put them into assignment. More...
 
 getFormValuesArray (ilExAssignment $ass)
 Get form values array from assignment. More...
 
 getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 Add overview content of submission to info screen object. More...
 
 setSubmission (ilExSubmission $a_submission)
 Set submission. More...
 
 setExercise (ilObjExercise $a_exercise)
 Set exercise. More...
 
 buildSubmissionPropertiesAndActions (\ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI $builder)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Blog type gui implementations

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilExAssTypeBlogGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssTypeBlogGUI::__construct ( protected \ILIAS\Exercise\InternalDomainService  $domain,
protected \ILIAS\Exercise\InternalGUIService  $gui 
)

Definition at line 28 of file class.ilExAssTypeBlogGUI.php.

31 {
32 }

Member Function Documentation

◆ addEditFormCustomProperties()

ilExAssTypeBlogGUI::addEditFormCustomProperties ( ilPropertyFormGUI  $form)

Add custom form properties to edit form.

Implements ilExAssignmentTypeGUIInterface.

Definition at line 37 of file class.ilExAssTypeBlogGUI.php.

37 : void
38 {
39 }

◆ buildSubmissionPropertiesAndActions()

ilExAssTypeBlogGUI::buildSubmissionPropertiesAndActions ( \ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI  $builder)

Implements ilExAssignmentTypeGUIInterface.

Definition at line 60 of file class.ilExAssTypeBlogGUI.php.

60 : void
61 {
62 global $DIC;
63
64 $service = $DIC->exercise()->internal();
65 $gui = $service->gui();
66 $domain = $service->domain();
67 $f = $gui->ui()->factory();
68 $lng = $domain->lng();
69 $ilCtrl = $gui->ctrl();
70 $submission = $this->getSubmission();
71
72
73 $wsp_tree = new \ilWorkspaceTree($submission->getUserId());
74
75 // #12939
76 if (!$wsp_tree->getRootId()) {
77 $wsp_tree->createTreeForUser($submission->getUserId());
78 }
79
80 $files_str = "";
81 $buttons_str = "";
82 $valid_blog = false;
83 $selected_blog = $submission->getSelectedObject();
84 if ($selected_blog) {
85 $blog_id = (int) $selected_blog->getTitle();
86 $node = $wsp_tree->getNodeData($blog_id);
87 if ($node["title"]) {
88 // #10116
89 $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", $blog_id);
90 $blog_link = $ilCtrl->getLinkTargetByClass(array("ildashboardgui", "ilpersonalworkspacegui", "ilobjbloggui"), "");
91 $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", "");
92 $valid_blog = true;
93 $builder->addProperty(
94 $builder::SEC_SUBMISSION,
95 $lng->txt("exc_blog_returned"),
96 $node["title"]
97 );
98 if ($submission->canSubmit()) {
99 $button = $f->button()->primary(
100 $lng->txt("exc_edit_blog"),
101 $blog_link
102 );
103 $builder->setMainAction(
104 $builder::SEC_SUBMISSION,
105 $button
106 );
107 } else {
108 $button = $f->button()->standard(
109 $lng->txt("exc_edit_blog"),
110 $blog_link
111 );
112 $builder->addAction(
113 $builder::SEC_SUBMISSION,
114 $button
115 );
116 }
117 }
118 // remove invalid resource if no upload yet (see download below)
119 /*elseif (substr($selected_blog["filename"], -1) == "/") {
120 // #16887
121 $submission->deleteResourceObject();
122 }*/
123 }
124 if ($submission->canSubmit()) {
125 if (!$valid_blog) {
126 $button = $f->button()->primary(
127 $lng->txt("exc_create_blog"),
128 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionObjectGUI"), "createBlog")
129 );
130 $builder->setMainAction(
131 $builder::SEC_SUBMISSION,
132 $button
133 );
134 }
135 // #10462
136 $blogs = count($wsp_tree->getObjectsFromType("blog"));
137 if ((!$valid_blog && $blogs)
138 || ($valid_blog && $blogs > 1)) {
139 $button = $f->button()->standard(
140 $lng->txt("exc_select_blog" . ($valid_blog ? "_change" : "")),
141 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionObjectGUI"), "selectBlog")
142 );
143 $builder->addAction(
144 $builder::SEC_SUBMISSION,
145 $button
146 );
147 }
148 if ($valid_blog) {
149 $button = $f->button()->standard(
150 $lng->txt("exc_select_blog_unlink"),
151 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionObjectGUI"), "askUnlinkBlog")
152 );
153 $builder->addAction(
154 $builder::SEC_SUBMISSION,
155 $button
156 );
157 }
158 }
159
160 if ($submission->hasSubmitted()) {
161 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "delivered", $selected_blog->getId());
162 $dl_link = $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionFileGUI"), "download");
163 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "delivered", "");
164
165 $link = $f->link()->standard(
166 $lng->txt("download"),
167 $dl_link
168 );
169 $builder->addAction(
170 $builder::SEC_SUBMISSION,
171 $link
172 );
173 }
174 }
$service
Definition: ltiresult.php:36
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26
getSubmission()
Get submission.

References $DIC, Vendor\Package\$f, $lng, $service, getSubmission(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getFormValuesArray()

ilExAssTypeBlogGUI::getFormValuesArray ( ilExAssignment  $ass)

Get form values array from assignment.

Returns
array

Implements ilExAssignmentTypeGUIInterface.

Definition at line 51 of file class.ilExAssTypeBlogGUI.php.

51 : array
52 {
53 return [];
54 }

◆ getOverviewContent()

ilExAssTypeBlogGUI::getOverviewContent ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)

Add overview content of submission to info screen object.

Implements ilExAssignmentTypeGUIInterface.

Definition at line 56 of file class.ilExAssTypeBlogGUI.php.

56 : void
57 {
58 }

◆ importFormToAssignment()

ilExAssTypeBlogGUI::importFormToAssignment ( ilExAssignment  $ass,
ilPropertyFormGUI  $form 
)

Get values from form and put them into assignment.

Implements ilExAssignmentTypeGUIInterface.

Definition at line 44 of file class.ilExAssTypeBlogGUI.php.

44 : void
45 {
46 }

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