19 declare(strict_types=1);
30 private int $mode = self::MODE_SOAP;
44 $this->
logger = $DIC->logger()->grp();
46 $this->
access = $DIC->access();
52 public function setMode(
int $a_mode): void
54 $this->mode = $a_mode;
64 if ($this->
getMode() == self::MODE_SOAP) {
65 $this->
logger->debug(
'Using soap mode');
72 if ($this->attach_users) {
79 } elseif ($this->
getMode() == self::MODE_EXPORT) {
80 $this->
logger->debug(
'Using export mode');
100 $this->
xmlSetDtdDef(
"<!DOCTYPE group PUBLIC \"-//ILIAS//DTD Group//EN\" \"" . ILIAS_HTTP_PATH .
"/components/ILIAS/Export/xml/ilias_grp_9_0.xsd\">");
101 $this->
xmlSetGenCmt(
"Export of ILIAS group " . $this->group_obj->getId() .
" of installation " . $this->
settings->get(
'inst_id') .
".");
108 $attrs[
"exportVersion"] = self::EXPORT_VERSION;
109 $attrs[
"id"] =
"il_" . $this->
settings->get(
'inst_id') .
'_grp_' . $this->group_obj->getId();
111 switch ($this->group_obj->readGroupStatus()) {
113 $attrs[
'type'] =
'open';
118 $attrs[
'type'] =
'closed';
134 if ($desc = $this->group_obj->getDescription()) {
138 $attr[
'id'] =
'il_' . $this->
settings->get(
'inst_id') .
'_usr_' . $this->group_obj->getOwner();
141 $this->
xmlElement(
'information',
null, $this->group_obj->getInformation());
149 if (!$this->group_obj->getStart() || !$this->group_obj->getEnd()) {
156 'withTime' => $this->group_obj->getStartTimeIndication()
178 switch ($this->group_obj->getRegistrationType()) {
180 $attrs[
'type'] =
'direct';
183 $attrs[
'type'] =
'confirmation';
186 $attrs[
'type'] =
'password';
191 $attrs[
'type'] =
'disabled';
194 $attrs[
'waitingList'] = $this->group_obj->isWaitingListEnabled() ?
'Yes' :
'No';
198 if (strlen($pwd = $this->group_obj->getPassword())) {
204 if (!$this->group_obj->isRegistrationUnlimited()) {
208 $this->
xmlEndTag(
'temporarilyAvailable');
213 $attrs[
'enabled'] = $this->group_obj->isMembershipLimited() ?
'Yes' :
'No';
214 $this->
xmlElement(
'maxMembers', $attrs, $this->group_obj->getMaxMembers());
215 $this->
xmlElement(
'minMembers',
null, $this->group_obj->getMinMembers());
216 $this->
xmlElement(
'WaitingListAutoFill',
null, (
int) $this->group_obj->hasWaitingListAutoFill());
217 $this->
xmlElement(
'CancellationEnd',
null, ($this->group_obj->getCancellationEnd() && !$this->group_obj->getCancellationEnd()->isNull()) ? $this->group_obj->getCancellationEnd()->get(
IL_CAL_UNIX) :
null);
219 $this->
xmlElement(
'mailMembersType',
null, (
string) $this->group_obj->getMailToMembersType());
222 'RegistrationAccessCode',
224 'enabled' => (
int) $this->group_obj->isRegistrationAccessCodeEnabled(),
225 'code' => $this->group_obj->getRegistrationAccessCode()
237 $this->
xmlElement(
'showMembers',
null, $this->group_obj->getShowMembers());
238 $this->
xmlElement(
'admissionNotification',
null, $this->group_obj->getAutoNotification() ? 1 : 0);
244 'active' => $this->group_obj->isSessionLimitEnabled() ? 1 : 0,
245 'previous' => $this->group_obj->getNumberOfPreviousSessions(),
246 'next' => $this->group_obj->getNumberOfNextSessions()
251 'enabled' => (
int) $this->group_obj->getEnableGroupMap(),
252 'latitude' => $this->group_obj->getLatitude(),
253 'longitude' => $this->group_obj->getLongitude(),
254 'location_zoom' => $this->group_obj->getLocationZoom()
260 $admins = $this->group_obj->getGroupAdminIds();
261 $admins = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
264 $this->group_obj->getRefId(),
268 foreach ($admins as
$id) {
269 $attr[
'id'] =
'il_' . $this->
settings->get(
'inst_id') .
'_usr_' .
$id;
270 $attr[
'notification'] = $this->participants->isNotificationEnabled($id) ?
'Yes' :
'No';
278 $members = $this->group_obj->getGroupMemberIds();
279 $members = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
282 $this->group_obj->getRefId(),
285 foreach ($members as
$id) {
286 if (!$this->group_obj->isAdmin($id)) {
287 $attr[
'id'] =
'il_' . $this->
settings->get(
'inst_id') .
'_usr_' .
$id;
301 $this->attach_users = $value;
__construct(ilObjGroup $group_obj)
const GRP_REGISTRATION_DEACTIVATED
xmlSetGenCmt(string $genCmt)
Sets generated comment.
ilGroupParticipants $participants
const GRP_REGISTRATION_REQUEST
__buildAdvancedMetaData()
xmlEndTag(string $tag)
Writes an endtag.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
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()