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"];
180 $parent_node = $this->tree->getNodeData(
181 $this->tree->getParentId($this->getItemGroupRefId()));
183 $materials = array();
184 $nodes = $this->tree->getChilds($parent_node[
"child"]);
186 include_once(
"./Modules/File/classes/class.ilObjFileAccess.php");
187 foreach($nodes as $node)
190 if ($node[
'child'] == $parent_node[
"child"] ||
191 $this->obj_def->isSideBlock($node[
'type']) ||
192 in_array($node[
'type'], array(
'sess',
'itgr',
'rolf',
'adm')))
199 if ($node[
'type'] ==
"file" &&
205 $materials[] = $node;
224 $valid_items = array();
225 foreach ($ass_items as $aitem)
227 if (in_array($aitem[
"ref_id"],
$items))
229 $valid_items[] = $aitem[
"ref_id"];
245 global $ilObjDataCache,
$ilLog;
247 $ilLog->write(__METHOD__.
': Begin cloning item group materials ... -'.$a_source_id.
'-');
249 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
251 $mappings = $cwo->getMappings();
253 $new_items = array();
256 foreach($source_ig->getItems() as $item_ref_id)
258 if(isset($mappings[$item_ref_id]) and $mappings[$item_ref_id])
260 $ilLog->write(__METHOD__.
': Clone item group item nr. '.$item_ref_id);
261 $new_items[] = $mappings[$item_ref_id];
265 $ilLog->write(__METHOD__.
': No mapping found for item group item nr. '.$item_ref_id);
270 $ilLog->write(__METHOD__.
': Finished cloning item group items ...');
278 $itgr_nodes = $tree->getChildsByType($a_ref_id,
'itgr');
279 foreach ($itgr_nodes as $node)
281 $itgr_ids[] = $node[
'obj_id'];
283 $query =
"SELECT item_ref_id FROM item_group_item ".
284 "WHERE ".$ilDB->in(
'item_group_id', $itgr_ids,
false,
'integer');