27 require_once
"./Services/Object/classes/class.ilObject.php";
86 $this->setting = $DIC[
"ilSetting"];
87 parent::__construct($a_id, $a_reference);
100 $cont_dir = $webspace_dir.
"/container_data";
101 if (!is_dir($cont_dir))
105 $obj_dir = $cont_dir.
"/obj_".$this->
getId();
106 if (!is_dir($obj_dir))
140 return self::_lookupIconPath($this->
getId());
151 return self::_lookupIconPath($this->
getId());
162 return self::_lookupIconPath($this->
getId());
172 return self::_lookupIconPath($this->
getId());
183 $this->hiddenfilesfound = $a_hiddenfilesfound;
201 return $this->style_id;
209 $this->style_id = $a_style_id;
219 $this->news_timeline = $a_val;
239 $this->news_timeline_auto_entries = $a_val;
259 $this->news_timeline_landing_page = $a_val;
269 return $this->news_timeline_landing_page;
317 $this->news_block_activated = $a_val;
327 return $this->news_block_activated;
337 $this->use_news = $a_val;
347 return $this->use_news;
362 $q =
"SELECT * FROM container_settings WHERE ".
363 " id = ".$ilDB->quote($a_id ,
'integer').
" AND ".
364 " keyword = ".$ilDB->quote($a_keyword ,
'text');
365 $set = $ilDB->query($q);
368 if(isset($rec[
'value']))
370 return $rec[
"value"];
372 if($a_default_value === NULL)
376 return $a_default_value;
388 $query =
"DELETE FROM container_settings WHERE ".
389 "id = ".$ilDB->quote($a_id,
'integer').
" ".
390 "AND keyword = ".$ilDB->quote($a_keyword,
'text');
394 $log->debug(
"Write container setting, id: ".$a_id.
", keyword: ".$a_keyword.
", value: ".$a_value);
396 $query =
"INSERT INTO container_settings (id, keyword, value) VALUES (".
397 $ilDB->quote($a_id ,
'integer').
", ".
398 $ilDB->quote($a_keyword ,
'text').
", ".
399 $ilDB->quote($a_value ,
'text').
411 $sql =
"SELECT * FROM container_settings WHERE ".
412 " id = ".$ilDB->quote($a_id ,
'integer');
413 $set = $ilDB->query($sql);
414 while(
$row = $ilDB->fetchAssoc($set))
416 $res[
$row[
"keyword"]] = $row[
"value"];
431 $sql =
"DELETE FROM container_settings WHERE ".
432 " id = ".$ilDB->quote($a_id ,
'integer');
437 $sql .=
" AND keyword = ".$ilDB->quote($a_keyword,
"text");
441 $sql .=
" AND ".$ilDB->like(
"keyword",
"text", $a_keyword);
444 $ilDB->manipulate($sql);
450 $settings = self::_getContainerSettings($a_obj_id);
451 if(
sizeof($settings))
455 foreach($settings as $keyword => $value)
458 if(stristr($keyword,
"icon"))
496 $file_name = $cont_dir.
"/icon_custom.svg";
497 if (is_file($file_name))
517 if ($a_custom_icon !=
"")
519 $file_name = $cont_dir.
"/icon_custom.svg";
522 if ($file_name !=
"" && is_file($file_name))
539 $small_file_name = $cont_dir.
"/icon_custom.svg";
540 @unlink($small_file_name);
552 public function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree =
false)
556 $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
558 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
559 #18624 - copy all sorting settings 563 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
568 $orig_page->copy($new_obj->getId(),
"cont", $new_obj->getId());
572 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
579 $new_id = $style_obj->ilClone();
580 $new_obj->setStyleSheetId($new_id);
590 include_once(
"./Services/Container/classes/class.ilContainerStartObjectsPage.php");
595 $orig_page->copy($new_obj->getId(),
"cstr", $new_obj->getId());
599 foreach(self::_getContainerSettings($this->
getId()) as $keyword => $value)
601 self::_writeContainerSetting($new_obj->getId(), $keyword, $value);
604 if($keyword ==
"icon_custom" &&
608 $new_obj->createContainerDirectory();
609 $tgt_dir = $new_obj->getContainerDirectory();
611 $file =
"icon_custom.svg";
612 $src_file = $src_dir.
"/".
$file;
613 if(file_exists($src_file))
615 copy($src_file, $tgt_dir.
"/".
$file);
635 parent::cloneDependencies($a_target_id, $a_copy_id);
637 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
644 include_once(
"./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
647 include_once(
'Services/Object/classes/class.ilObjectLP.php');
649 $collection = $olp->getCollectionInstance();
652 $collection->cloneCollection($a_target_id, $a_copy_id);
676 include_once(
'./Services/Link/classes/class.ilLink.php');
677 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
684 $wizard_options->saveOwner($ilUser->getId());
685 $wizard_options->saveRoot($clone_source);
688 $wizard_options->initContainer($clone_source,
$ref_id);
690 foreach(
$options as $source_id => $option)
692 $wizard_options->addEntry($source_id,$option);
694 $wizard_options->read();
695 $wizard_options->storeTree($clone_source);
697 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
702 $wizard_options->read();
703 $wizard_options->dropFirstNode();
704 $wizard_options->appendMapping($clone_source,
$ref_id);
712 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
715 $soap_client->setResponseTimeout(5);
716 $soap_client->enableWSDL(
true);
718 $ilLog->write(__METHOD__.
': Trying to call Soap client...');
719 if($soap_client->init())
727 $wizard_options->disableSOAP();
728 $wizard_options->read();
729 include_once(
'./webservice/soap/include/inc.soap_functions.php');
733 'copy_id' => $copy_id,
734 'ref_id' => (
int)
$res 756 $this->order_type = $a_value;
767 public function getSubItems($a_admin_panel_enabled =
false, $a_include_side_block =
false, $a_get_single = 0)
769 global $objDefinition,
$ilBench, $tree, $ilObjDataCache,
$ilUser, $rbacsystem,
773 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
776 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
780 $objects = $tree->getChilds($this->
getRefId(),
"title");
782 $objects = self::getCompleteDescriptions($objects);
785 $all_ref_ids =
array();
787 if(!self::$data_preloaded)
789 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
793 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
798 include_once
'./Modules/Session/classes/class.ilEventItems.php';
801 foreach ($objects as $key => $object)
803 if ($a_get_single > 0 && $object[
"child"] != $a_get_single)
809 if ($objDefinition->getDevMode($object[
"type"]) || $object[
"type"] ==
"adm" 810 || $object[
"type"] ==
"rolf")
816 if ($objDefinition->isInactivePlugin($object[
"type"]))
822 if (in_array($object[
'type'],
array(
'file',
'fold',
'cat')))
824 include_once
'Modules/File/classes/class.ilObjFileAccess.php';
828 if (!$a_admin_panel_enabled)
837 if (!self::$data_preloaded)
839 $preloader->addItem($object[
"obj_id"], $object[
"type"], $object[
"child"]);
843 if (in_array($object[
'ref_id'],$event_items))
849 if(!$a_include_side_block && $objDefinition->isSideBlock($object[
'type']))
854 $all_ref_ids[] = $object[
"child"];
858 if (!self::$data_preloaded)
860 $preloader->preload();
863 self::$data_preloaded =
true;
866 foreach($objects as $key => $object)
869 if(!in_array($object[
"child"], $all_ref_ids))
875 $type = $objDefinition->getGroupOfObj($object[
"type"]);
878 $type = $object[
"type"];
884 $this->items[
$type][$key] = $object;
886 $this->items[
"_all"][$key] = $object;
887 if ($object[
"type"] !=
"sess")
889 $this->items[
"_non_sess"][$key] = $object;
893 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block]
894 = $sort->sortItems($this->items);
896 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
904 if (is_array($this->items[
"_all"]) && count($this->items[
"_all"]) > 0)
926 global $objDefinition;
928 if (empty($this->type_grps))
930 $this->type_grps = $objDefinition->getGroupedRepositoryObjectTypes($this->
getType());
932 return $this->type_grps;
943 if ($ilSetting->get(
"enable_cat_page_edit"))
954 $ret = parent::create();
958 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
963 $log->debug(
"Create Container, id: ".$this->
getId());
968 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
980 $ret = parent::update();
982 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
986 $log->debug(
"Update Container, id: ".$this->
getId());
991 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
1010 include_once(
"./Services/Container/classes/class.ilContainerSortingSettings.php");
1013 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1030 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
1032 $this->setting->get(
'block_activated_news',
true)));
1048 $short_desc = $ilSetting->get(
"rep_shorten_description");
1049 $short_desc_max_length = $ilSetting->get(
"rep_shorten_description_length");
1055 foreach($objects as $key => $object)
1057 $objects[$key][
"description"] =
ilUtil::shortenText($object[
"description"], $short_desc_max_length,
true);
1064 foreach($objects as $key => $object)
1066 $obj_ids[] = $object[
"obj_id"];
1068 if(
sizeof($obj_ids))
1071 foreach($objects as $key => $object)
1074 if($ilObjDataCache->isTranslatedDescription($object[
"obj_id"]))
1076 $long_desc[$object[
"obj_id"]] = $object[
"description"];
1078 if($short_desc && $short_desc_max_length)
1082 $objects[$key][
"description"] =
$long_desc[$object[
"obj_id"]];
1099 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
1102 include_once(
"./Services/CopyWizard/classes/class.ilCopyWizardOptions.php");
1104 $mapping = $cwo->getMappings();
1106 $pg->handleRepositoryLinksOnCopy($mapping, $a_source_ref_id);
1107 $pg->update(
true,
true);
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
setNewsTimelineAutoEntries($a_val)
Set news timeline auto entries.
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)
static _getContainerDirectory($a_id)
Get the container directory.
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.
isNewsTimelineEffective()
Is news timeline effective?
static getLongDescriptions(array $a_obj_ids)
Get long description data.
removeCustomIcon()
remove small icon
Container start objects page object.
static _getItemsOfContainer($a_ref_id)
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.
getNewsTimelineLandingPage()
Get news timline is landing page.
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.
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).
setNewsBlockActivated($a_val)
Set news block activated.
saveIcons($a_custom_icon)
save container icons
getViewMode()
Get container view mode.
setUseNews($a_val)
Set use news.
getNewsTimelineAutoEntries()
Get news timeline auto entries.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static _cloneSettings($a_old_id, $a_new_id)
Clone settings.
xmlEndTag($tag)
Writes an endtag.
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 _lookupStandard($a_id)
Lookup standard flag.
static _lookupIconPath($a_id, $a_size="big")
lookup icon path
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.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone container settings.
setNewsTimelineLandingPage($a_val)
Set news timline is landing page.
if(!is_array($argv)) $options
getId()
get object id public
isNewsTimelineLandingPageEffective()
Is news timeline landing page effective?
static _deleteContainerSettings($a_id, $a_keyword=null, $a_keyword_like=false)
setNewsTimeline($a_val)
Set news timeline.
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
getNewsTimeline()
Get news timeline.
static _lookupObjId($a_id)
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.
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
$news_timeline_auto_entries
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=NULL)
Lookup a container setting.
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.
static _duplicate($a_session_id)
Duplicate session.
readContainerSettings()
Read container settings.
addAdditionalSubItemInformation(&$object)
Add additional information to sub item, e.g.
__construct($a_id=0, $a_reference=true)
const SORT_DIRECTION_DESC
getUseNews()
Get use news.
getRefId()
get reference id public
static _writeContainerSetting($a_id, $a_keyword, $a_value)
static getLogger($a_component_id)
Get component logger.
static _lookupSortMode($a_obj_id)
lookup sort mode
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static _getInstance($a_obj_id)
get instance by obj_id
createContainerDirectory()
Create directory for the container.
getNewsBlockActivated()
Get news block activated.
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
static fixInternalLinksAfterCopy($a_target_id, $a_copy_id, $a_source_ref_id)
Fix internal links after copy process.