3 declare(strict_types=1);
34 private int $mode = self::MODE_SOAP;
48 $this->
logger = $DIC->logger()->grp();
50 $this->
access = $DIC->access();
56 public function setMode(
int $a_mode): void
58 $this->mode = $a_mode;
68 if ($this->
getMode() == self::MODE_SOAP) {
69 $this->
logger->debug(
'Using soap mode');
77 if ($this->attach_users) {
84 } elseif ($this->
getMode() == self::MODE_EXPORT) {
85 $this->
logger->debug(
'Using export mode');
107 $this->
xmlSetDtdDef(
"<!DOCTYPE group PUBLIC \"-//ILIAS//DTD Group//EN\" \"" . ILIAS_HTTP_PATH .
"/xml/ilias_group_3_10.dtd\">");
108 $this->
xmlSetGenCmt(
"Export of ILIAS group " . $this->group_obj->getId() .
" of installation " . $this->
settings->get(
'inst_id') .
".");
115 $attrs[
"exportVersion"] = self::EXPORT_VERSION;
116 $attrs[
"id"] =
"il_" . $this->
settings->get(
'inst_id') .
'_grp_' . $this->group_obj->getId();
118 switch ($this->group_obj->readGroupStatus()) {
120 $attrs[
'type'] =
'open';
125 $attrs[
'type'] =
'closed';
133 $md2xml =
new ilMD2XML($this->group_obj->getId(), $this->group_obj->getId(),
'grp');
147 $this->
xmlElement(
'title', null, $this->group_obj->getTitle());
149 if ($desc = $this->group_obj->getDescription()) {
150 $this->
xmlElement(
'description', null, $desc);
153 $attr[
'id'] =
'il_' . $this->
settings->get(
'inst_id') .
'_usr_' . $this->group_obj->getOwner();
156 $this->
xmlElement(
'information', null, $this->group_obj->getInformation());
164 if (!$this->group_obj->getStart() || !$this->group_obj->getEnd()) {
171 'withTime' => $this->group_obj->getStartTimeIndication()
177 $this->group_obj->getStart() ?
196 switch ($this->group_obj->getRegistrationType()) {
198 $attrs[
'type'] =
'direct';
201 $attrs[
'type'] =
'confirmation';
204 $attrs[
'type'] =
'password';
209 $attrs[
'type'] =
'disabled';
212 $attrs[
'waitingList'] = $this->group_obj->isWaitingListEnabled() ?
'Yes' :
'No';
216 if (strlen($pwd = $this->group_obj->getPassword())) {
222 if (!$this->group_obj->isRegistrationUnlimited()) {
226 $this->
xmlEndTag(
'temporarilyAvailable');
231 $attrs[
'enabled'] = $this->group_obj->isMembershipLimited() ?
'Yes' :
'No';
232 $this->
xmlElement(
'maxMembers', $attrs, $this->group_obj->getMaxMembers());
233 $this->
xmlElement(
'minMembers', null, $this->group_obj->getMinMembers());
234 $this->
xmlElement(
'WaitingListAutoFill', null, (
int) $this->group_obj->hasWaitingListAutoFill());
235 $this->
xmlElement(
'CancellationEnd', null, ($this->group_obj->getCancellationEnd() && !$this->group_obj->getCancellationEnd()->isNull()) ? $this->group_obj->getCancellationEnd()->get(
IL_CAL_UNIX) : null);
237 $this->
xmlElement(
'mailMembersType', null, (
string) $this->group_obj->getMailToMembersType());
240 'RegistrationAccessCode',
242 'enabled' => (
int) $this->group_obj->isRegistrationAccessCodeEnabled(),
243 'code' => $this->group_obj->getRegistrationAccessCode()
255 $this->
xmlElement(
'showMembers', null, $this->group_obj->getShowMembers());
256 $this->
xmlElement(
'admissionNotification', null, $this->group_obj->getAutoNotification() ? 1 : 0);
262 'active' => $this->group_obj->isSessionLimitEnabled() ? 1 : 0,
263 'previous' => $this->group_obj->getNumberOfPreviousSessions(),
264 'next' => $this->group_obj->getNumberOfNextSessions()
269 'enabled' => (
int) $this->group_obj->getEnableGroupMap(),
270 'latitude' => $this->group_obj->getLatitude(),
271 'longitude' => $this->group_obj->getLongitude(),
272 'location_zoom' => $this->group_obj->getLocationZoom()
278 $admins = $this->group_obj->getGroupAdminIds();
279 $admins = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
282 $this->group_obj->getRefId(),
286 foreach ($admins as
$id) {
287 $attr[
'id'] =
'il_' . $this->
settings->get(
'inst_id') .
'_usr_' .
$id;
288 $attr[
'notification'] = $this->participants->isNotificationEnabled($id) ?
'Yes' :
'No';
296 $members = $this->group_obj->getGroupMemberIds();
297 $members = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
300 $this->group_obj->getRefId(),
303 foreach ($members as
$id) {
304 if (!$this->group_obj->isAdmin($id)) {
305 $attr[
'id'] =
'il_' . $this->
settings->get(
'inst_id') .
'_usr_' .
$id;
319 $this->attach_users = $value;
__construct(ilObjGroup $group_obj)
const GRP_REGISTRATION_DEACTIVATED
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...
xmlSetGenCmt(string $genCmt)
Sets generated comment.
ilGroupParticipants $participants
appendXML(string $a_str)
append xml string to document
const GRP_REGISTRATION_REQUEST
__buildAdvancedMetaData()
xmlEndTag(string $tag)
Writes an endtag.
xmlSetDtdDef(string $dtdDef)
Sets dtd definition.
static _exportContainerSortingSettings(ilXmlWriter $xml, int $obj_id)
sorting XML-export for all container objects
setAttachUsers(bool $value)
const GRP_REGISTRATION_PASSWORD
xmlHeader()
Writes xml header.
static _exportContainerSettings(ilXmlWriter $a_xml, int $a_obj_id)
const GRP_REGISTRATION_DIRECT
__buildPeriod()
Add group period settings to xml.
static _appendXMLByObjId(ilXmlWriter $a_xml_writer, int $a_obj_id)
Get xml of object values.
__buildExtraSettings()
Build extra settings, like "show member list".
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
static lookupViewMode($a_obj_id)
xmlDumpMem(bool $format=true)
Returns xml document from memory.
__buildTitleDescription()