27 require_once
"./Services/Object/classes/class.ilObject.php";
72 parent::__construct($a_id, $a_call_by_reference);
84 $cont_dir = $webspace_dir.
"/container_data";
85 if (!is_dir($cont_dir))
89 $obj_dir = $cont_dir.
"/obj_".$this->
getId();
90 if (!is_dir($obj_dir))
154 $this->hiddenfilesfound = $a_hiddenfilesfound;
172 return $this->style_id;
180 $this->style_id = $a_style_id;
195 $q =
"SELECT * FROM container_settings WHERE ".
196 " id = ".$ilDB->quote($a_id ,
'integer').
" AND ".
197 " keyword = ".$ilDB->quote($a_keyword ,
'text');
198 $set = $ilDB->query($q);
201 if(isset($rec[
'value']))
203 return $rec[
"value"];
205 if($a_default_value === NULL)
209 return $a_default_value;
216 $query =
"DELETE FROM container_settings WHERE ".
217 "id = ".$ilDB->quote($a_id,
'integer').
" ".
218 "AND keyword = ".$ilDB->quote($a_keyword,
'text');
221 $query =
"INSERT INTO container_settings (id, keyword, value) VALUES (".
222 $ilDB->quote($a_id ,
'integer').
", ".
223 $ilDB->quote($a_keyword ,
'text').
", ".
224 $ilDB->quote($a_value ,
'text').
249 $file_name = $cont_dir.
"/icon_".$a_size.
".png";
250 if (is_file($file_name))
256 $file_name = $cont_dir.
"/icon_".$a_size.
".gif";
257 if (is_file($file_name))
269 function saveIcons($a_big_icon, $a_small_icon, $a_tiny_icon)
277 $big_geom = $this->ilias->getSetting(
"custom_icon_big_width").
"x".
278 $this->ilias->getSetting(
"custom_icon_big_height");
279 $big_file_name = $cont_dir.
"/icon_big.png";
281 if (is_file($a_big_icon))
288 if (is_file($cont_dir.
"/icon_big.png"))
298 $small_geom = $this->ilias->getSetting(
"custom_icon_small_width").
"x".
299 $this->ilias->getSetting(
"custom_icon_small_height");
300 $small_file_name = $cont_dir.
"/icon_small.png";
302 if (is_file($a_small_icon))
308 if (is_file($cont_dir.
"/icon_small.png"))
318 $tiny_geom = $this->ilias->getSetting(
"custom_icon_tiny_width").
"x".
319 $this->ilias->getSetting(
"custom_icon_tiny_height");
320 $tiny_file_name = $cont_dir.
"/icon_tiny.png";
322 if (is_file($a_tiny_icon))
328 if (is_file($cont_dir.
"/icon_tiny.png"))
345 $big_file_name = $cont_dir.
"/icon_big.png";
346 @unlink($big_file_name);
356 $small_file_name = $cont_dir.
"/icon_small.png";
357 @unlink($small_file_name);
367 $tiny_file_name = $cont_dir.
"/icon_tiny.png";
368 @unlink($tiny_file_name);
384 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
390 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
396 $new_page_object->setParentId($new_obj->getId());
397 $new_page_object->setId($new_obj->getId());
398 $new_page_object->createFromXML();
399 $new_page_object->setXMLContent($orig_page->getXMLContent());
400 $new_page_object->buildDom();
401 $new_page_object->update();
419 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
423 include_once(
"./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
444 include_once(
'./Services/Link/classes/class.ilLink.php');
445 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
452 $wizard_options->saveOwner($ilUser->getId());
453 $wizard_options->saveRoot($clone_source);
456 $wizard_options->initContainer($clone_source,
$ref_id);
458 foreach($options as $source_id => $option)
460 $wizard_options->addEntry($source_id,$option);
462 $wizard_options->read();
463 $wizard_options->storeTree($clone_source);
468 $ilLog->write(__METHOD__.
': Copy course in course...');
469 $ilLog->write(__METHOD__.
': Added mapping, source ID: '.$clone_source.
', target ID: '.
$ref_id);
470 $wizard_options->read();
471 $wizard_options->dropFirstNode();
472 $wizard_options->appendMapping($clone_source,
$ref_id);
479 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
482 $soap_client->setResponseTimeout(30);
483 $soap_client->enableWSDL(
true);
485 $ilLog->write(__METHOD__.
': Trying to call Soap client...');
486 if($soap_client->init())
488 $ilLog->write(__METHOD__.
': Calling soap clone method...');
489 $res = $soap_client->call(
'ilClone',array($new_session_id.
'::'.
$client_id, $copy_id));
493 $ilLog->write(__METHOD__.
': SOAP call failed. Calling clone method manually. ');
494 $wizard_options->disableSOAP();
495 $wizard_options->read();
496 include_once(
'./webservice/soap/include/inc.soap_functions.php');
528 $this->order_type = $a_value;
539 function getSubItems($a_admin_panel_enabled =
false, $a_include_side_block =
false,
542 global $objDefinition,
$ilBench, $tree, $ilObjDataCache,
$ilUser, $rbacsystem,
546 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
549 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
553 $objects = $tree->getChilds($this->
getRefId(),
"title");
556 $short_desc = $ilSetting->get(
"rep_shorten_description");
557 $short_desc_max_length = $ilSetting->get(
"rep_shorten_description_length");
563 foreach($objects as $key => $object)
565 $objects[$key][
"description"] =
ilUtil::shortenText($object[
"description"], $short_desc_max_length,
true);
572 foreach($objects as $key => $object)
574 $obj_ids[] = $object[
"obj_id"];
579 foreach($objects as $key => $object)
582 if($ilObjDataCache->isTranslatedDescription($object[
"obj_id"]))
584 $long_desc[$object[
"obj_id"]] = $object[
"description"];
586 if($short_desc && $short_desc_max_length)
590 $objects[$key][
"description"] =
$long_desc[$object[
"obj_id"]];
597 $all_obj_types = array();
598 $all_ref_ids = array();
599 $all_obj_ids = array();
601 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
606 include_once
'./Modules/Session/classes/class.ilEventItems.php';
609 foreach ($objects as $key => $object)
611 if ($a_get_single > 0 && $object[
"child"] != $a_get_single)
617 if ($objDefinition->getDevMode($object[
"type"]) || $object[
"type"] ==
"adm"
618 || $object[
"type"] ==
"rolf")
624 if ($objDefinition->isInactivePlugin($object[
"type"]))
630 if (in_array($object[
'type'], array(
'file',
'fold',
'cat')))
632 include_once
'Modules/File/classes/class.ilObjFileAccess.php';
636 if (!$a_admin_panel_enabled)
645 if (in_array($object[
'ref_id'],$event_items))
651 if(!$a_include_side_block && $objDefinition->isSideBlock($object[
'type']))
656 $all_obj_types[$object[
"type"]] = $object[
"type"];
657 $obj_ids_of_type[$object[
"type"]][] = $object[
"obj_id"];
658 $ref_ids_of_type[$object[
"type"]][] = $object[
"child"];
660 $all_ref_ids[] = $object[
"child"];
661 $all_obj_ids[] = $object[
"obj_id"];
665 if (!self::$data_preloaded &&
sizeof($all_ref_ids))
668 foreach ($all_obj_types as
$t)
671 include_once(
"./Services/AccessControl/classes/class.ilConditionHandler.php");
673 $obj_ids_of_type[$t]);
675 $class = $objDefinition->getClassName($t);
676 $location = $objDefinition->getLocation($t);
677 $full_class =
"ilObj".$class.
"Access";
678 include_once(
$location.
"/class.".$full_class.
".php");
679 call_user_func(array($full_class,
"_preloadData"),
680 $obj_ids_of_type[$t], $ref_ids_of_type[$t]);
684 $tree->preloadDeleted($all_ref_ids);
685 $tree->preloadDepthParent($all_ref_ids);
686 $ilObjDataCache->preloadReferenceCache($all_ref_ids,
false);
688 $rbacsystem->preloadRbacPaCache($all_ref_ids, $ilUser->getId());
690 include_once(
"./Services/Object/classes/class.ilObjectListGUI.php");
693 include_once(
"./Services/Object/classes/class.ilObjectActivation.php");
696 self::$data_preloaded =
true;
699 foreach($objects as $key => $object)
702 if(!in_array($object[
"child"], $all_ref_ids))
708 $type = $objDefinition->getGroupOfObj($object[
"type"]);
711 $type = $object[
"type"];
717 $this->items[
$type][$key] = $object;
719 $this->items[
"_all"][$key] = $object;
720 if ($object[
"type"] !=
"sess")
722 $this->items[
"_non_sess"][$key] = $object;
726 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block]
727 = $sort->sortItems($this->items);
729 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
737 if (is_array($this->items[
"_all"]) && count($this->items[
"_all"]) > 0)
759 global $objDefinition;
761 if (empty($this->type_grps))
763 $this->type_grps = $objDefinition->getGroupedRepositoryObjectTypes($this->
getType());
765 return $this->type_grps;
776 if ($ilSetting->get(
"enable_cat_page_edit"))
791 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
805 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
823 include_once(
"./Services/Container/classes/class.ilContainerSortingSettings.php");
826 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");