27 require_once
"./Services/Object/classes/class.ilObject.php";
83 parent::__construct($a_id, $a_call_by_reference);
95 $cont_dir = $webspace_dir.
"/container_data";
96 if (!is_dir($cont_dir))
100 $obj_dir = $cont_dir.
"/obj_".$this->
getId();
101 if (!is_dir($obj_dir))
135 return self::_lookupIconPath($this->
getId());
146 return self::_lookupIconPath($this->
getId());
157 return self::_lookupIconPath($this->
getId());
167 return self::_lookupIconPath($this->
getId());
178 $this->hiddenfilesfound = $a_hiddenfilesfound;
196 return $this->style_id;
204 $this->style_id = $a_style_id;
219 $q =
"SELECT * FROM container_settings WHERE ".
220 " id = ".$ilDB->quote($a_id ,
'integer').
" AND ".
221 " keyword = ".$ilDB->quote($a_keyword ,
'text');
222 $set = $ilDB->query($q);
225 if(isset($rec[
'value']))
227 return $rec[
"value"];
229 if($a_default_value === NULL)
233 return $a_default_value;
240 $query =
"DELETE FROM container_settings WHERE ".
241 "id = ".$ilDB->quote($a_id,
'integer').
" ".
242 "AND keyword = ".$ilDB->quote($a_keyword,
'text');
245 $query =
"INSERT INTO container_settings (id, keyword, value) VALUES (".
246 $ilDB->quote($a_id ,
'integer').
", ".
247 $ilDB->quote($a_keyword ,
'text').
", ".
248 $ilDB->quote($a_value ,
'text').
259 $sql =
"SELECT * FROM container_settings WHERE ".
260 " id = ".$ilDB->quote($a_id ,
'integer');
261 $set = $ilDB->query($sql);
262 while(
$row = $ilDB->fetchAssoc($set))
264 $res[
$row[
"keyword"]] = $row[
"value"];
279 $sql =
"DELETE FROM container_settings WHERE ".
280 " id = ".$ilDB->quote($a_id ,
'integer');
285 $sql .=
" AND keyword = ".$ilDB->quote($a_keyword,
"text");
289 $sql .=
" AND ".$ilDB->like(
"keyword",
"text", $a_keyword);
292 $ilDB->manipulate($sql);
298 $settings = self::_getContainerSettings($a_obj_id);
299 if(
sizeof($settings))
303 foreach($settings as $keyword => $value)
306 if(stristr($keyword,
"icon"))
344 $file_name = $cont_dir.
"/icon_custom.svg";
345 if (is_file($file_name))
365 if ($a_custom_icon !=
"")
367 $file_name = $cont_dir.
"/icon_custom.svg";
370 if ($file_name !=
"" && is_file($file_name))
387 $small_file_name = $cont_dir.
"/icon_custom.svg";
388 @unlink($small_file_name);
404 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
406 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
407 #18624 - copy all sorting settings 411 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
416 $orig_page->copy($new_obj->getId(),
"cont", $new_obj->getId());
420 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
426 $new_id = $style_obj->ilClone();
427 $new_obj->setStyleSheetId($new_id);
432 include_once(
"./Services/Container/classes/class.ilContainerStartObjectsPage.php");
437 $orig_page->copy($new_obj->getId(),
"cstr", $new_obj->getId());
441 foreach(self::_getContainerSettings($this->
getId()) as $keyword => $value)
443 self::_writeContainerSetting($new_obj->getId(), $keyword, $value);
446 if($keyword ==
"icon_custom" &&
450 $new_obj->createContainerDirectory();
451 $tgt_dir = $new_obj->getContainerDirectory();
453 $file =
"icon_custom.svg";
454 $src_file = $src_dir.
"/".
$file;
455 if(file_exists($src_file))
457 copy($src_file, $tgt_dir.
"/".
$file);
477 parent::cloneDependencies($a_target_id, $a_copy_id);
479 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
483 include_once(
"./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
486 include_once(
'Services/Object/classes/class.ilObjectLP.php');
488 $collection = $olp->getCollectionInstance();
491 $collection->cloneCollection($a_target_id, $a_copy_id);
515 include_once(
'./Services/Link/classes/class.ilLink.php');
516 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
523 $wizard_options->saveOwner($ilUser->getId());
524 $wizard_options->saveRoot($clone_source);
527 $wizard_options->initContainer($clone_source,
$ref_id);
529 foreach(
$options as $source_id => $option)
531 $wizard_options->addEntry($source_id,$option);
533 $wizard_options->read();
534 $wizard_options->storeTree($clone_source);
536 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
541 $wizard_options->read();
542 $wizard_options->dropFirstNode();
543 $wizard_options->appendMapping($clone_source,
$ref_id);
551 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
554 $soap_client->setResponseTimeout(5);
555 $soap_client->enableWSDL(
true);
557 $ilLog->write(__METHOD__.
': Trying to call Soap client...');
558 if($soap_client->init())
561 $res = $soap_client->call(
'ilClone',array($new_session_id.
'::'.
$client_id, $copy_id));
566 $wizard_options->disableSOAP();
567 $wizard_options->read();
568 include_once(
'./webservice/soap/include/inc.soap_functions.php');
572 'copy_id' => $copy_id,
573 'ref_id' => (
int)
$res 595 $this->order_type = $a_value;
606 function getSubItems($a_admin_panel_enabled =
false, $a_include_side_block =
false,
609 global $objDefinition,
$ilBench, $tree, $ilObjDataCache,
$ilUser, $rbacsystem,
613 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
616 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
620 $objects = $tree->getChilds($this->
getRefId(),
"title");
622 $objects = self::getCompleteDescriptions($objects);
625 $all_ref_ids = array();
627 if(!self::$data_preloaded)
629 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
633 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
638 include_once
'./Modules/Session/classes/class.ilEventItems.php';
641 foreach ($objects as $key => $object)
643 if ($a_get_single > 0 && $object[
"child"] != $a_get_single)
649 if ($objDefinition->getDevMode($object[
"type"]) || $object[
"type"] ==
"adm" 650 || $object[
"type"] ==
"rolf")
656 if ($objDefinition->isInactivePlugin($object[
"type"]))
662 if (in_array($object[
'type'], array(
'file',
'fold',
'cat')))
664 include_once
'Modules/File/classes/class.ilObjFileAccess.php';
668 if (!$a_admin_panel_enabled)
677 if (!self::$data_preloaded)
679 $preloader->addItem($object[
"obj_id"], $object[
"type"], $object[
"child"]);
683 if (in_array($object[
'ref_id'],$event_items))
689 if(!$a_include_side_block && $objDefinition->isSideBlock($object[
'type']))
694 $all_ref_ids[] = $object[
"child"];
698 if (!self::$data_preloaded)
700 $preloader->preload();
703 self::$data_preloaded =
true;
706 foreach($objects as $key => $object)
709 if(!in_array($object[
"child"], $all_ref_ids))
715 $type = $objDefinition->getGroupOfObj($object[
"type"]);
718 $type = $object[
"type"];
724 $this->items[
$type][$key] = $object;
726 $this->items[
"_all"][$key] = $object;
727 if ($object[
"type"] !=
"sess")
729 $this->items[
"_non_sess"][$key] = $object;
733 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block]
734 = $sort->sortItems($this->items);
736 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
744 if (is_array($this->items[
"_all"]) && count($this->items[
"_all"]) > 0)
766 global $objDefinition;
768 if (empty($this->type_grps))
770 $this->type_grps = $objDefinition->getGroupedRepositoryObjectTypes($this->
getType());
772 return $this->type_grps;
783 if ($ilSetting->get(
"enable_cat_page_edit"))
794 $ret = parent::create();
798 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
810 $ret = parent::update();
812 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
830 include_once(
"./Services/Container/classes/class.ilContainerSortingSettings.php");
833 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
848 $short_desc = $ilSetting->get(
"rep_shorten_description");
849 $short_desc_max_length = $ilSetting->get(
"rep_shorten_description_length");
855 foreach($objects as $key => $object)
857 $objects[$key][
"description"] =
ilUtil::shortenText($object[
"description"], $short_desc_max_length,
true);
864 foreach($objects as $key => $object)
866 $obj_ids[] = $object[
"obj_id"];
871 foreach($objects as $key => $object)
874 if($ilObjDataCache->isTranslatedDescription($object[
"obj_id"]))
876 $long_desc[$object[
"obj_id"]] = $object[
"description"];
878 if($short_desc && $short_desc_max_length)
882 $objects[$key][
"description"] =
$long_desc[$object[
"obj_id"]];
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static _exportContainerSettings(ilXmlWriter $a_xml, $a_obj_id)
getCustomIconPath()
Get path for custom icon.
cloneDependencies($a_target_id, $a_copy_id)
Clone object dependencies (container sorting)
const SORT_NEW_ITEMS_POSITION_TOP
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
xmlData($data, $encode=TRUE, $escape=TRUE)
Writes data.
static getLongDescriptions(array $a_obj_ids)
Get long description data.
removeCustomIcon()
remove small icon
Container start objects page object.
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)
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
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).
saveIcons($a_custom_icon)
save container icons
getViewMode()
Get container view mode.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static _cloneSettings($a_old_id, $a_new_id)
Clone settings.
xmlEndTag($tag)
Writes an endtag.
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.
Preloader for object list GUIs.
const SORT_NEW_ITEMS_POSITION_BOTTOM
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getContainerDirectory()
Get the container directory.
if(!is_array($argv)) $options
getId()
get object id public
static _deleteContainerSettings($a_id, $a_keyword=null, $a_keyword_like=false)
const SORT_NEW_ITEMS_ORDER_CREATION
getStyleSheetId()
get ID of assigned style sheet object
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static _getContainerSettings($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).
static _allocateCopyId()
Allocate a copy for further entries.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
cloneAllObject($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false, $a_submode=1)
clone all objects according to this container
getType()
get object type public
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 ...
const SORT_NEW_ITEMS_ORDER_ACTIVATION
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.
_lookupStandard($a_id)
Lookup standard flag.
static _duplicate($a_session_id)
Duplicate session.
addAdditionalSubItemInformation(&$object)
Add additional information to sub item, e.g.
const SORT_DIRECTION_DESC
_lookupContainerSetting($a_id, $a_keyword, $a_default_value=NULL)
Lookup a container setting.
getRefId()
get reference id public
static getLogger($a_component_id)
Get component logger.
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)
const SORT_NEW_ITEMS_ORDER_TITLE
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 ...
const SUBMODE_CONTENT_ONLY