37 $this->obj_def = $objDefinition;
58 $this->item_group_id = $a_val;
78 $this->item_group_ref_id = $a_val;
98 $this->items = $a_val;
118 if (!in_array($a_item_ref_id, $this->items))
120 $this->items[] = (int) $a_item_ref_id;
129 $query =
"DELETE FROM item_group_item ".
130 "WHERE item_group_id = ".$this->db->quote($this->
getItemGroupId(),
'integer');
131 $this->db->manipulate(
$query);
141 foreach($this->items as $item)
143 $query =
"INSERT INTO item_group_item (item_group_id,item_ref_id) ".
146 $this->db->quote($item ,
'integer').
" ".
148 $this->db->manipulate(
$query);
157 $this->items = array();
158 $set = $this->db->query(
"SELECT * FROM item_group_item ".
159 " WHERE item_group_id = ".$this->db->quote($this->getItemGroupId(),
"integer")
161 while ($rec = $this->db->fetchAssoc($set))
163 $this->items[] = $rec[
"item_ref_id"];
175 global $objDefinition;
182 $parent_node = $this->tree->getNodeData(
183 $this->tree->getParentId($this->getItemGroupRefId()));
185 $materials = array();
186 $nodes = $this->tree->getChilds($parent_node[
"child"]);
188 include_once(
"./Modules/File/classes/class.ilObjFileAccess.php");
189 foreach($nodes as $node)
192 if ($node[
'child'] == $parent_node[
"child"] ||
193 $this->obj_def->isSideBlock($node[
'type']) ||
194 in_array($node[
'type'], array(
'sess',
'itgr',
'rolf',
'adm')))
201 if ($node[
'type'] ==
"file" &&
207 if ($objDefinition->isInactivePlugin($node[
'type']))
212 $materials[] = $node;
231 $valid_items = array();
232 foreach ($ass_items as $aitem)
234 if (in_array($aitem[
"ref_id"],
$items))
236 $valid_items[] = $aitem[
"ref_id"];
252 global $ilObjDataCache,
$ilLog;
254 $ilLog->write(__METHOD__.
': Begin cloning item group materials ... -'.$a_source_id.
'-');
256 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
258 $mappings = $cwo->getMappings();
260 $new_items = array();
263 foreach($source_ig->getItems() as $item_ref_id)
265 if(isset($mappings[$item_ref_id]) and $mappings[$item_ref_id])
267 $ilLog->write(__METHOD__.
': Clone item group item nr. '.$item_ref_id);
268 $new_items[] = $mappings[$item_ref_id];
272 $ilLog->write(__METHOD__.
': No mapping found for item group item nr. '.$item_ref_id);
277 $ilLog->write(__METHOD__.
': Finished cloning item group items ...');
285 $itgr_nodes = $tree->getChildsByType($a_ref_id,
'itgr');
286 foreach ($itgr_nodes as $node)
288 $itgr_ids[] = $node[
'obj_id'];
290 $query =
"SELECT item_ref_id FROM item_group_item ".
291 "WHERE ".$ilDB->in(
'item_group_id', $itgr_ids,
false,
'integer');