ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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

 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
 setSubmission (ilExSubmission $a_submission)
 Set submission. More...
 
 setExercise (ilObjExercise $a_exercise)
 Set exercise. More...
 

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.

Member Function Documentation

◆ addEditFormCustomProperties()

ilExAssTypeBlogGUI::addEditFormCustomProperties ( ilPropertyFormGUI  $form)

Add custom form properties to edit form.

Implements ilExAssignmentTypeGUIInterface.

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

31  : void
32  {
33  }

◆ buildSubmissionPropertiesAndActions()

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

Implements ilExAssignmentTypeGUIInterface.

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

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

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

45  : array
46  {
47  return [];
48  }

◆ getOverviewContent()

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

Add overview content of submission to info screen object.

Implements ilExAssignmentTypeGUIInterface.

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

50  : void
51  {
52  }

◆ importFormToAssignment()

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

Get values from form and put them into assignment.

Implements ilExAssignmentTypeGUIInterface.

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

38  : void
39  {
40  }

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