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);
382 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
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());
430 parent::cloneDependencies($a_target_id, $a_copy_id);
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");
576 $objects = self::getCompleteDescriptions($objects);
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"))
748 $ret = parent::create();
752 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
764 $ret = parent::update();
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"]];
cloneDependencies($a_target_id, $a_copy_id)
Clone object dependencies (container sorting)
saveIcons($a_big_icon, $a_small_icon, $a_tiny_icon)
save container icons
setSortMode($a_mode)
set sort mode
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
static getLongDescriptions(array $a_obj_ids)
Get long description data.
removeSmallIcon()
remove small icon
static ilClone($sid, $copy_identifier)
static _isFileHidden($a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user. ...
Class ilObject Basic functions for all objects.
_getItemsOfContainer($a_ref_id)
getBigIconPath()
Get path for big icon.
getTinyIconPath()
Get path for tiny icon.
_getContainerDirectory($a_id)
Get the container directory.
_writeContainerSetting($a_id, $a_keyword, $a_value)
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
setHiddenFilesFound($a_hiddenfilesfound)
Set Found hidden files (set by getSubItems).
removeBigIcon()
remove big icon
getViewMode()
Get container view mode.
static lookupObjectStyle($a_obj_id)
Lookup object style.
cloneObject($a_target_id, $a_copy_id=0)
Clone container settings.
_lookupIconPath($a_id, $a_size="big")
lookup icon path
getOrderType()
Get order type default implementation.
getSubItems($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
Get subitems of container.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
static _isFinished($a_copy_id)
check if copy is finished
Preloader for object list GUIs.
cloneAllObject($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false)
clone all objects according to this container
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getContainerDirectory()
Get the container directory.
static execConvert($args)
execute convert command
if(!is_array($argv)) $options
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getId()
get object id public
getStyleSheetId()
get ID of assigned style sheet object
static _lookupObjId($a_id)
enablePageEditing()
Check whether page editing is allowed for container.
gotItems()
Check whether we got any items.
getHiddenFilesFound()
Get Found hidden files (set by getSubItems).
redirection script todo: (a better solution should control the processing via a xml file) ...
static _allocateCopyId()
Allocate a copy for further entries.
getType()
get object type public
static _lookupType($a_id, $a_reference=false)
lookup object type
ilContainer($a_id=0, $a_call_by_reference=true)
Constructor public.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static fixContainerItemGroupRefsAfterCloning($a_source_container, $a_copy_id)
Fix container item group references after a container has been cloned.
getSmallIconPath()
Get path for small icon.
static _duplicate($a_session_id)
Duplicate session.
addAdditionalSubItemInformation(&$object)
Add additional information to sub item, e.g.
static escapeShellArg($a_arg)
_lookupContainerSetting($a_id, $a_keyword, $a_default_value=NULL)
Lookup a container setting.
getRefId()
get reference id public
static _lookupSortMode($a_obj_id)
lookup sort mode
static _getInstance($a_obj_id)
get instance by obj_id
createContainerDirectory()
Create directory for the container.
getGroupedObjTypes()
Get grouped repository object types.
static getInstance($a_obj_id)
static getWebspaceDir($mode="filesystem")
get webspace directory
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
removeTinyIcon()
remove tiny icon