27 require_once
"./Services/Object/classes/class.ilObject.php";
84 parent::__construct($a_id, $a_call_by_reference);
96 $cont_dir = $webspace_dir.
"/container_data";
97 if (!is_dir($cont_dir))
101 $obj_dir = $cont_dir.
"/obj_".$this->
getId();
102 if (!is_dir($obj_dir))
179 $this->hiddenfilesfound = $a_hiddenfilesfound;
197 return $this->style_id;
205 $this->style_id = $a_style_id;
220 $q =
"SELECT * FROM container_settings WHERE ".
221 " id = ".$ilDB->quote($a_id ,
'integer').
" AND ".
222 " keyword = ".$ilDB->quote($a_keyword ,
'text');
223 $set = $ilDB->query($q);
226 if(isset($rec[
'value']))
228 return $rec[
"value"];
230 if($a_default_value === NULL)
234 return $a_default_value;
241 $query =
"DELETE FROM container_settings WHERE ".
242 "id = ".$ilDB->quote($a_id,
'integer').
" ".
243 "AND keyword = ".$ilDB->quote($a_keyword,
'text');
246 $query =
"INSERT INTO container_settings (id, keyword, value) VALUES (".
247 $ilDB->quote($a_id ,
'integer').
", ".
248 $ilDB->quote($a_keyword ,
'text').
", ".
249 $ilDB->quote($a_value ,
'text').
260 $sql =
"SELECT * FROM container_settings WHERE ".
261 " id = ".$ilDB->quote($a_id ,
'integer');
262 $set = $ilDB->query($sql);
263 while(
$row = $ilDB->fetchAssoc($set))
265 $res[
$row[
"keyword"]] = $row[
"value"];
280 $sql =
"DELETE FROM container_settings WHERE ".
281 " id = ".$ilDB->quote($a_id ,
'integer');
286 $sql .=
" AND keyword = ".$ilDB->quote($a_keyword,
"text");
290 $sql .=
" AND ".$ilDB->like(
"keyword",
"text", $a_keyword);
293 $ilDB->manipulate($sql);
300 if(
sizeof($settings))
304 foreach($settings as $keyword => $value)
307 if(stristr($keyword,
"icon"))
345 $file_name = $cont_dir.
"/icon_custom.svg";
346 if (is_file($file_name))
366 if ($a_custom_icon !=
"")
368 $file_name = $cont_dir.
"/icon_custom.svg";
371 if ($file_name !=
"" && is_file($file_name))
388 $small_file_name = $cont_dir.
"/icon_custom.svg";
389 @unlink($small_file_name);
407 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
413 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
418 $orig_page->copy($new_obj->getId(),
"cont", $new_obj->getId());
422 include_once(
"./Services/Container/classes/class.ilContainerStartObjectsPage.php");
427 $orig_page->copy($new_obj->getId(),
"cstr", $new_obj->getId());
431 foreach(self::_getContainerSettings($this->
getId()) as $keyword => $value)
436 if($keyword ==
"icon_custom" &&
440 $new_obj->createContainerDirectory();
441 $tgt_dir = $new_obj->getContainerDirectory();
443 $file =
"icon_custom.svg";
444 $src_file = $src_dir.
"/".
$file;
445 if(file_exists($src_file))
447 copy($src_file, $tgt_dir.
"/".
$file);
469 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
473 include_once(
"./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
476 include_once(
'Services/Object/classes/class.ilObjectLP.php');
478 $collection = $olp->getCollectionInstance();
481 $collection->cloneCollection($a_target_id, $a_copy_id);
502 include_once(
'./Services/Link/classes/class.ilLink.php');
503 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
510 $wizard_options->saveOwner($ilUser->getId());
511 $wizard_options->saveRoot($clone_source);
514 $wizard_options->initContainer($clone_source,
$ref_id);
516 foreach(
$options as $source_id => $option)
518 $wizard_options->addEntry($source_id,$option);
520 $wizard_options->read();
521 $wizard_options->storeTree($clone_source);
526 $ilLog->write(__METHOD__.
': Copy course in course...');
527 $ilLog->write(__METHOD__.
': Added mapping, source ID: '.$clone_source.
', target ID: '.
$ref_id);
528 $wizard_options->read();
529 $wizard_options->dropFirstNode();
530 $wizard_options->appendMapping($clone_source,
$ref_id);
537 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
540 $soap_client->setResponseTimeout(30);
541 $soap_client->enableWSDL(
true);
543 $ilLog->write(__METHOD__.
': Trying to call Soap client...');
544 if($soap_client->init())
546 $ilLog->write(__METHOD__.
': Calling soap clone method...');
547 $res = $soap_client->call(
'ilClone',array($new_session_id.
'::'.
$client_id, $copy_id));
551 $ilLog->write(__METHOD__.
': SOAP call failed. Calling clone method manually. ');
552 $wizard_options->disableSOAP();
553 $wizard_options->read();
554 include_once(
'./webservice/soap/include/inc.soap_functions.php');
586 $this->order_type = $a_value;
597 function getSubItems($a_admin_panel_enabled =
false, $a_include_side_block =
false,
600 global $objDefinition,
$ilBench, $tree, $ilObjDataCache,
$ilUser, $rbacsystem,
604 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
607 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
611 $objects = $tree->getChilds($this->
getRefId(),
"title");
616 $all_ref_ids = array();
618 if(!self::$data_preloaded)
620 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
624 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
629 include_once
'./Modules/Session/classes/class.ilEventItems.php';
632 foreach ($objects as $key => $object)
634 if ($a_get_single > 0 && $object[
"child"] != $a_get_single)
640 if ($objDefinition->getDevMode($object[
"type"]) || $object[
"type"] ==
"adm"
641 || $object[
"type"] ==
"rolf")
647 if ($objDefinition->isInactivePlugin($object[
"type"]))
653 if (in_array($object[
'type'], array(
'file',
'fold',
'cat')))
655 include_once
'Modules/File/classes/class.ilObjFileAccess.php';
659 if (!$a_admin_panel_enabled)
668 if (!self::$data_preloaded)
670 $preloader->addItem($object[
"obj_id"], $object[
"type"], $object[
"child"]);
674 if (in_array($object[
'ref_id'],$event_items))
680 if(!$a_include_side_block && $objDefinition->isSideBlock($object[
'type']))
685 $all_ref_ids[] = $object[
"child"];
689 if (!self::$data_preloaded)
691 $preloader->preload();
694 self::$data_preloaded =
true;
697 foreach($objects as $key => $object)
700 if(!in_array($object[
"child"], $all_ref_ids))
706 $type = $objDefinition->getGroupOfObj($object[
"type"]);
709 $type = $object[
"type"];
715 $this->items[
$type][$key] = $object;
717 $this->items[
"_all"][$key] = $object;
718 if ($object[
"type"] !=
"sess")
720 $this->items[
"_non_sess"][$key] = $object;
724 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block]
725 = $sort->sortItems($this->items);
727 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
735 if (is_array($this->items[
"_all"]) && count($this->items[
"_all"]) > 0)
757 global $objDefinition;
759 if (empty($this->type_grps))
761 $this->type_grps = $objDefinition->getGroupedRepositoryObjectTypes($this->
getType());
763 return $this->type_grps;
774 if ($ilSetting->get(
"enable_cat_page_edit"))
789 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
803 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
821 include_once(
"./Services/Container/classes/class.ilContainerSortingSettings.php");
824 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
839 $short_desc = $ilSetting->get(
"rep_shorten_description");
840 $short_desc_max_length = $ilSetting->get(
"rep_shorten_description_length");
846 foreach($objects as $key => $object)
848 $objects[$key][
"description"] =
ilUtil::shortenText($object[
"description"], $short_desc_max_length,
true);
855 foreach($objects as $key => $object)
857 $obj_ids[] = $object[
"obj_id"];
862 foreach($objects as $key => $object)
865 if($ilObjDataCache->isTranslatedDescription($object[
"obj_id"]))
867 $long_desc[$object[
"obj_id"]] = $object[
"description"];
869 if($short_desc && $short_desc_max_length)
873 $objects[$key][
"description"] =
$long_desc[$object[
"obj_id"]];