54 $this->obj_data_cache = $DIC[
"ilObjDataCache"];
55 $this->log = $DIC[
"ilLog"];
56 $ilDB = $DIC->database();
57 $lng = $DIC->language();
58 $tree = $DIC->repositoryTree();
59 $objDefinition = $DIC[
"objDefinition"];
64 $this->obj_def = $objDefinition;
83 $this->item_group_id = $a_val;
103 $this->item_group_ref_id = $a_val;
123 $this->items = $a_val;
143 if (!in_array($a_item_ref_id, $this->items)) {
144 $this->items[] = (int) $a_item_ref_id;
151 public function delete()
153 $query =
"DELETE FROM item_group_item " .
154 "WHERE item_group_id = " . $this->db->quote($this->
getItemGroupId(),
'integer');
155 $this->db->manipulate(
$query);
165 foreach ($this->items as $item) {
166 $query =
"INSERT INTO item_group_item (item_group_id,item_ref_id) " .
169 $this->db->quote($item,
'integer') .
" " .
171 $this->db->manipulate(
$query);
180 $this->items =
array();
181 $set = $this->db->query(
182 "SELECT * FROM item_group_item " .
183 " WHERE item_group_id = " . $this->db->quote($this->getItemGroupId(),
"integer")
185 while ($rec = $this->db->fetchAssoc($set)) {
186 $this->items[] = $rec[
"item_ref_id"];
204 $parent_node = $this->tree->getNodeData(
205 $this->tree->getParentId($this->getItemGroupRefId())
208 $materials =
array();
209 $nodes = $this->tree->getChilds($parent_node[
"child"]);
211 include_once(
"./Modules/File/classes/class.ilObjFileAccess.php");
212 foreach ($nodes as $node) {
214 if ($node[
'child'] == $parent_node[
"child"] ||
215 $this->obj_def->isSideBlock($node[
'type']) ||
216 in_array($node[
'type'],
array(
'sess',
'itgr',
'rolf',
'adm'))) {
222 if ($node[
'type'] ==
"file" &&
227 if ($objDefinition->isInactivePlugin($node[
'type'])) {
231 $materials[] = $node;
250 $valid_items =
array();
251 foreach ($ass_items as $aitem) {
252 if (in_array($aitem[
"ref_id"],
$items)) {
253 $valid_items[] = $aitem[
"ref_id"];
272 $ilLog->write(__METHOD__ .
': Begin cloning item group materials ... -' . $a_source_id .
'-');
274 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
276 $mappings = $cwo->getMappings();
278 $new_items =
array();
281 foreach ($source_ig->getItems() as $item_ref_id) {
282 if (isset($mappings[$item_ref_id]) and $mappings[$item_ref_id]) {
283 $ilLog->write(__METHOD__ .
': Clone item group item nr. ' . $item_ref_id);
284 $new_items[] = $mappings[$item_ref_id];
286 $ilLog->write(__METHOD__ .
': No mapping found for item group item nr. ' . $item_ref_id);
291 $ilLog->write(__METHOD__ .
': Finished cloning item group items ...');
299 $ilDB = $DIC->database();
300 $tree = $DIC->repositoryTree();
302 $itgr_nodes =
$tree->getChildsByType($a_ref_id,
'itgr');
303 foreach ($itgr_nodes as $node) {
304 $itgr_ids[] = $node[
'obj_id'];
306 $query =
"SELECT item_ref_id FROM item_group_item " .
307 "WHERE " .
$ilDB->in(
'item_group_id', $itgr_ids,
false,
'integer');
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
addItem($a_item_ref_id)
Add one item.
__construct($a_item_group_ref_id=0)
Constructor.
getAssignableItems()
Get assignable items.
static _isFileHidden($a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user. ...
getItemGroupId()
Get item group id.
static _getItemsOfContainer($a_ref_id)
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getValidItems()
Get valid items.
foreach($_POST as $key=> $value) $res
static _lookupObjId($a_id)
setItems($a_val)
Set items.
setItemGroupRefId($a_val)
Set item group ref id.
Create styles array
The data for the language used.
setItemGroupId($a_val)
Set item group id.
getItemGroupRefId()
Get item group ref id.
update()
Update item group items.
cloneItems($a_source_id, $a_copy_id)
Clone items.
read()
Read item group items.