ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPublicSubmissionsTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected \ILIAS\Exercise\InternalDomainService $domain;
27 protected \ILIAS\Exercise\InternalGUIService $gui;
29
30 public function __construct(
31 object $a_parent_obj,
32 string $a_parent_cmd,
33 ilExAssignment $a_ass
34 ) {
35 global $DIC;
36
37 $this->ctrl = $DIC->ctrl();
38 $this->lng = $DIC->language();
39 $ilCtrl = $DIC->ctrl();
40 $lng = $DIC->language();
41
42 $this->ass = $a_ass;
43
44 parent::__construct($a_parent_obj, $a_parent_cmd);
45 $this->setData($this->ass->getMemberListData());
46 $this->setTitle($lng->txt("exc_assignment") . ": " . $this->ass->getTitle());
47 $this->setTopCommands(true);
48 //$this->setLimit(9999);
49
50 $this->addColumn($this->lng->txt("name"), "name");
51 $this->addColumn($this->lng->txt("exc_submission"), "");
52
53 $this->setDefaultOrderField("name");
54 $this->setDefaultOrderDirection("asc");
55
56 $this->setEnableHeader(true);
57 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
58 $this->setRowTemplate("tpl.exc_public_submissions_row.html", "components/ILIAS/Exercise");
59 //$this->disable("footer");
60 $this->setEnableTitle(true);
61 $this->gui = $DIC->exercise()->internal()->gui();
62 $this->domain = $DIC->exercise()->internal()->domain();
63 }
64
69 protected function fillRow(array $a_set): void
70 {
72 $ilCtrl = $this->ctrl;
73
74 $member_id = $a_set["usr_id"];
75 if (($mem_obj = ilObjectFactory::getInstanceByObjId($member_id, false)) === null) {
76 return;
77 }
78
79 // name and login
80 $this->tpl->setVariable(
81 "TXT_NAME",
82 $a_set["name"]
83 );
84 $this->tpl->setVariable(
85 "TXT_LOGIN",
86 "[" . $a_set["login"] . "]"
87 );
88
89 // image
90 $this->tpl->setVariable(
91 "USR_IMAGE",
92 $mem_obj->getPersonalPicturePath("xxsmall")
93 );
94 $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
95
96 // nr of submitted files
97 $subs = $this->domain->submission($this->ass->getId())->getSubmissionsOfUser($member_id);
98 $sub_cnt = count(iterator_to_array($subs));
99
100 $this->tpl->setVariable("TXT_SUBMITTED_FILES", $lng->txt("exc_files_returned"));
101 $this->tpl->setVariable("VAL_SUBMITTED_FILES", $sub_cnt);
102
103 // download command
104 if ($sub_cnt > 0) {
105 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "member_id", $member_id);
106 $url = $ilCtrl->getLinkTargetByClass("ilExSubmissionFileGUI", "downloadReturned");
107 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "member_id", "");
108
109 // #15126
110 $button = $this->gui->button(
111 $lng->txt("exc_download_files"),
112 $url
113 );
114 $this->tpl->setVariable("BTN_DOWNLOAD", $button->render());
115 }
116
117 $this->tpl->parseCurrentBlock();
118 }
119}
Exercise assignment.
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...
ILIAS Exercise InternalDomainService $domain
ILIAS Exercise InternalGUIService $gui
__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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26
$url
Definition: shib_logout.php:68