ILIAS  release_8 Revision v8.24
class.ilPublicSubmissionsTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
27
28 public function __construct(
29 object $a_parent_obj,
30 string $a_parent_cmd,
31 ilExAssignment $a_ass
32 ) {
33 global $DIC;
34
35 $this->ctrl = $DIC->ctrl();
36 $this->lng = $DIC->language();
37 $ilCtrl = $DIC->ctrl();
38 $lng = $DIC->language();
39
40 $this->ass = $a_ass;
41
42 parent::__construct($a_parent_obj, $a_parent_cmd);
43 $this->setData($this->ass->getMemberListData());
44 $this->setTitle($lng->txt("exc_assignment") . ": " . $this->ass->getTitle());
45 $this->setTopCommands(true);
46 //$this->setLimit(9999);
47
48 $this->addColumn($this->lng->txt("name"), "name");
49 $this->addColumn($this->lng->txt("exc_submission"), "");
50
51 $this->setDefaultOrderField("name");
52 $this->setDefaultOrderDirection("asc");
53
54 $this->setEnableHeader(true);
55 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
56 $this->setRowTemplate("tpl.exc_public_submissions_row.html", "Modules/Exercise");
57 //$this->disable("footer");
58 $this->setEnableTitle(true);
59 }
60
65 protected function fillRow(array $a_set): void
66 {
68 $ilCtrl = $this->ctrl;
69
70 $member_id = $a_set["usr_id"];
71 if (($mem_obj = ilObjectFactory::getInstanceByObjId($member_id, false)) === null) {
72 return;
73 }
74
75 // name and login
76 $this->tpl->setVariable(
77 "TXT_NAME",
78 $a_set["name"]
79 );
80 $this->tpl->setVariable(
81 "TXT_LOGIN",
82 "[" . $a_set["login"] . "]"
83 );
84
85 // image
86 $this->tpl->setVariable(
87 "USR_IMAGE",
88 $mem_obj->getPersonalPicturePath("xxsmall")
89 );
90 $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
91
92 $sub = new ilExSubmission($this->ass, $member_id);
93
94 // submission:
95
96 // nr of submitted files
97 $sub_cnt = count($sub->getFiles());
98
99 $this->tpl->setVariable("TXT_SUBMITTED_FILES", $lng->txt("exc_files_returned"));
100 $this->tpl->setVariable("VAL_SUBMITTED_FILES", $sub_cnt);
101
102 // download command
103 if ($sub_cnt > 0) {
104 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "member_id", $member_id);
105 $url = $ilCtrl->getLinkTargetByClass("ilExSubmissionFileGUI", "downloadReturned");
106 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "member_id", "");
107
108 // #15126
109 $button = ilLinkButton::getInstance();
110 $button->setCaption("exc_download_files");
111 $button->setUrl($url);
112 $button->setOmitPreventDoubleSubmission(true);
113 $this->tpl->setVariable("BTN_DOWNLOAD", $button->render());
114 }
115
116 $this->tpl->parseCurrentBlock();
117 }
118}
Exercise assignment.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, ilExAssignment $a_ass)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableTitle(bool $a_enabletitle)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setTopCommands(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
ilLanguage $lng
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$url