25include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
26include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
75 $this->logger =
$DIC->logger()->grp();
77 $this->EXPORT_VERSION =
"3";
86 $this->mode = $a_mode;
96 if ($this->
getMode() == self::MODE_SOAP) {
97 $this->logger->debug(
'Using soap mode');
105 if ($this->attach_users) {
109 include_once
'./Services/Container/classes/class.ilContainerSortingSettings.php';
113 } elseif ($this->
getMode() == self::MODE_EXPORT) {
114 $this->logger->debug(
'Using export mode');
122 include_once
'./Services/Container/classes/class.ilContainerSortingSettings.php';
138 $this->
xmlSetGenCmt(
"Export of ILIAS group " . $this->group_obj->getId() .
" of installation " . $this->ilias->getSetting(
'inst_id') .
".");
151 $attrs[
"exportVersion"] = $this->EXPORT_VERSION;
152 $attrs[
"id"] =
"il_" . $this->
ilias->getSetting(
'inst_id') .
'_grp_' . $this->group_obj->getId();
154 switch ($this->group_obj->readGroupStatus()) {
156 $attrs[
'type'] =
'open';
161 $attrs[
'type'] =
'closed';
174 $md2xml =
new ilMD2XML($this->group_obj->getId(), $this->group_obj->getId(),
'grp');
175 $md2xml->startExport();
195 $this->
xmlElement(
'title',
null, $this->group_obj->getTitle());
197 if ($desc = $this->group_obj->getDescription()) {
198 $this->
xmlElement(
'description',
null, $desc);
201 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' . $this->group_obj->getOwner();
204 $this->
xmlElement(
'information',
null, $this->group_obj->getInformation());
212 if (!$this->group_obj->getStart() || !$this->group_obj->getEnd()) {
219 'withTime' => $this->group_obj->getStartTimeIndication()
225 $this->group_obj->getStart() ?
245 switch ($this->group_obj->getRegistrationType()) {
247 $attrs[
'type'] =
'direct';
250 $attrs[
'type'] =
'confirmation';
253 $attrs[
'type'] =
'password';
258 $attrs[
'type'] =
'disabled';
261 $attrs[
'waitingList'] = $this->group_obj->isWaitingListEnabled() ?
'Yes' :
'No';
265 if (strlen($pwd = $this->group_obj->getPassword())) {
271 if (!$this->group_obj->isRegistrationUnlimited()) {
275 $this->
xmlEndTag(
'temporarilyAvailable');
280 $attrs[
'enabled'] = $this->group_obj->isMembershipLimited() ?
'Yes' :
'No';
281 $this->
xmlElement(
'maxMembers', $attrs, $this->group_obj->getMaxMembers());
282 $this->
xmlElement(
'minMembers',
null, (
int) $this->group_obj->getMinMembers());
283 $this->
xmlElement(
'WaitingListAutoFill',
null, (
int) $this->group_obj->hasWaitingListAutoFill());
284 $this->
xmlElement(
'CancellationEnd',
null, ($this->group_obj->getCancellationEnd() && !$this->group_obj->getCancellationEnd()->isNull()) ? $this->group_obj->getCancellationEnd()->get(
IL_CAL_UNIX) :
null);
286 $this->
xmlElement(
'mailMembersType',
null, (
string) $this->group_obj->getMailToMembersType());
296 $this->
xmlElement(
'showMembers',
null, $this->group_obj->getShowMembers());
297 $this->
xmlElement(
'admissionNotification',
null, $this->group_obj->getAutoNotification() ? 1 : 0);
302 $admins = $this->group_obj->getGroupAdminIds();
303 $admins =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
306 $this->group_obj->getRefId(),
310 foreach ($admins as $id) {
311 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' . $id;
312 $attr[
'notification'] = $this->participants->isNotificationEnabled($id) ?
'Yes' :
'No';
321 $members = $this->group_obj->getGroupMemberIds();
322 $members =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
325 $this->group_obj->getRefId(),
328 foreach ($members as $id) {
329 if (!$this->group_obj->isAdmin($id)) {
330 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' . $id;
345 $this->attach_users = $value ? true :
false;
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
const GRP_REGISTRATION_DIRECT
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_DEACTIVATED
const GRP_REGISTRATION_REQUEST
static _appendXMLByObjId(ilXmlWriter $a_xml_writer, $a_obj_id)
Get xml of object values.
static _exportContainerSortingSettings(ilXmlWriter $xml, $obj_id)
sorting XML-export for all container objects
static _exportContainerSettings(ilXmlWriter $a_xml, $a_obj_id)
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
__buildTitleDescription()
__construct($group_obj)
constructor
__buildExtraSettings()
Build extra settings, like "show member list".
__buildMetaData()
write lom meta data
__buildGroup()
Group start.
__buildAdvancedMetaData()
Build advanced meta data.
__buildPeriod()
Add group period settings to xml.
xmlEndTag($tag)
Writes an endtag.
xmlSetGenCmt($genCmt)
Sets generated comment.
xmlDumpMem($format=true)
Returns xml document from memory.
xmlHeader()
Writes xml header @access public.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
appendXML($a_str)
append xml string to document
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
redirection script todo: (a better solution should control the processing via a xml file)