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))
287 if (is_file($cont_dir.
"/icon_big.png"))
296 $small_geom = $this->ilias->getSetting(
"custom_icon_small_width").
"x".
297 $this->ilias->getSetting(
"custom_icon_small_height");
298 $small_file_name = $cont_dir.
"/icon_small.png";
300 if (is_file($a_small_icon))
306 if (is_file($cont_dir.
"/icon_small.png"))
316 $tiny_geom = $this->ilias->getSetting(
"custom_icon_tiny_width").
"x".
317 $this->ilias->getSetting(
"custom_icon_tiny_height");
318 $tiny_file_name = $cont_dir.
"/icon_tiny.png";
320 if (is_file($a_tiny_icon))
326 if (is_file($cont_dir.
"/icon_tiny.png"))
343 $big_file_name = $cont_dir.
"/icon_big.png";
344 @unlink($big_file_name);
354 $small_file_name = $cont_dir.
"/icon_small.png";
355 @unlink($small_file_name);
365 $tiny_file_name = $cont_dir.
"/icon_tiny.png";
366 @unlink($tiny_file_name);
384 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
391 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
397 $orig_page->copy($new_obj->getId(),
"cont", $new_obj->getId());
432 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
436 include_once(
"./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
439 include_once(
'Services/Object/classes/class.ilObjectLP.php');
441 $collection = $olp->getCollectionInstance();
444 $collection->cloneCollection($a_target_id, $a_copy_id);
465 include_once(
'./Services/Link/classes/class.ilLink.php');
466 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
473 $wizard_options->saveOwner($ilUser->getId());
474 $wizard_options->saveRoot($clone_source);
477 $wizard_options->initContainer($clone_source,
$ref_id);
479 foreach(
$options as $source_id => $option)
481 $wizard_options->addEntry($source_id,$option);
483 $wizard_options->read();
484 $wizard_options->storeTree($clone_source);
489 $ilLog->write(__METHOD__.
': Copy course in course...');
490 $ilLog->write(__METHOD__.
': Added mapping, source ID: '.$clone_source.
', target ID: '.
$ref_id);
491 $wizard_options->read();
492 $wizard_options->dropFirstNode();
493 $wizard_options->appendMapping($clone_source,
$ref_id);
500 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
503 $soap_client->setResponseTimeout(30);
504 $soap_client->enableWSDL(
true);
506 $ilLog->write(__METHOD__.
': Trying to call Soap client...');
507 if($soap_client->init())
509 $ilLog->write(__METHOD__.
': Calling soap clone method...');
510 $res = $soap_client->call(
'ilClone',array($new_session_id.
'::'.
$client_id, $copy_id));
514 $ilLog->write(__METHOD__.
': SOAP call failed. Calling clone method manually. ');
515 $wizard_options->disableSOAP();
516 $wizard_options->read();
517 include_once(
'./webservice/soap/include/inc.soap_functions.php');
549 $this->order_type = $a_value;
560 function getSubItems($a_admin_panel_enabled =
false, $a_include_side_block =
false,
563 global $objDefinition,
$ilBench, $tree, $ilObjDataCache,
$ilUser, $rbacsystem,
567 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
570 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
574 $objects = $tree->getChilds($this->
getRefId(),
"title");
579 $all_ref_ids = array();
581 if(!self::$data_preloaded)
583 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
587 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
592 include_once
'./Modules/Session/classes/class.ilEventItems.php';
595 foreach ($objects as $key => $object)
597 if ($a_get_single > 0 && $object[
"child"] != $a_get_single)
603 if ($objDefinition->getDevMode($object[
"type"]) || $object[
"type"] ==
"adm"
604 || $object[
"type"] ==
"rolf")
610 if ($objDefinition->isInactivePlugin($object[
"type"]))
616 if (in_array($object[
'type'], array(
'file',
'fold',
'cat')))
618 include_once
'Modules/File/classes/class.ilObjFileAccess.php';
622 if (!$a_admin_panel_enabled)
631 if (!self::$data_preloaded)
633 $preloader->addItem($object[
"obj_id"], $object[
"type"], $object[
"child"]);
637 if (in_array($object[
'ref_id'],$event_items))
643 if(!$a_include_side_block && $objDefinition->isSideBlock($object[
'type']))
648 $all_ref_ids[] = $object[
"child"];
652 if (!self::$data_preloaded)
654 $preloader->preload();
657 self::$data_preloaded =
true;
660 foreach($objects as $key => $object)
663 if(!in_array($object[
"child"], $all_ref_ids))
669 $type = $objDefinition->getGroupOfObj($object[
"type"]);
672 $type = $object[
"type"];
678 $this->items[
$type][$key] = $object;
680 $this->items[
"_all"][$key] = $object;
681 if ($object[
"type"] !=
"sess")
683 $this->items[
"_non_sess"][$key] = $object;
687 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block]
688 = $sort->sortItems($this->items);
690 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
698 if (is_array($this->items[
"_all"]) && count($this->items[
"_all"]) > 0)
720 global $objDefinition;
722 if (empty($this->type_grps))
724 $this->type_grps = $objDefinition->getGroupedRepositoryObjectTypes($this->
getType());
726 return $this->type_grps;
737 if ($ilSetting->get(
"enable_cat_page_edit"))
752 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
766 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
784 include_once(
"./Services/Container/classes/class.ilContainerSortingSettings.php");
787 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
802 $short_desc = $ilSetting->get(
"rep_shorten_description");
803 $short_desc_max_length = $ilSetting->get(
"rep_shorten_description_length");
809 foreach($objects as $key => $object)
811 $objects[$key][
"description"] =
ilUtil::shortenText($object[
"description"], $short_desc_max_length,
true);
818 foreach($objects as $key => $object)
820 $obj_ids[] = $object[
"obj_id"];
825 foreach($objects as $key => $object)
828 if($ilObjDataCache->isTranslatedDescription($object[
"obj_id"]))
830 $long_desc[$object[
"obj_id"]] = $object[
"description"];
832 if($short_desc && $short_desc_max_length)
836 $objects[$key][
"description"] =
$long_desc[$object[
"obj_id"]];