68 protected \ILIAS\Container\InternalDomainService
$domain;
89 public function __construct(
int $a_id = 0,
bool $a_reference =
true)
94 $this->db = $DIC->database();
95 $this->log = $DIC[
"ilLog"];
96 $this->
access = $DIC->access();
97 $this->error = $DIC[
"ilErr"];
98 $this->rbacsystem = $DIC->rbac()->system();
99 $this->tree = $DIC->repositoryTree();
100 $this->
user = $DIC->user();
101 $this->obj_definition = $DIC[
"objDefinition"];
102 $this->news = $DIC->news();
105 $this->setting = $DIC[
"ilSetting"];
109 $this->content_style_domain = $DIC->contentStyle()->domain();
110 $this->domain = $DIC->container()->internal()->domain();
120 self::TILE_SMALL =>
$lng->
txt(
"cont_tile_size_1"),
121 self::TILE_NORMAL =>
$lng->
txt(
"cont_tile_size_0"),
122 self::TILE_LARGE =>
$lng->
txt(
"cont_tile_size_2"),
123 self::TILE_EXTRA_LARGE =>
$lng->
txt(
"cont_tile_size_3"),
124 self::TILE_FULL =>
$lng->
txt(
"cont_tile_size_4")
142 $cont_dir = $webspace_dir .
"/container_data";
143 if (!is_dir($cont_dir)) {
146 $obj_dir = $cont_dir .
"/obj_" . $this->
getId();
147 if (!is_dir($obj_dir)) {
154 return self::_getContainerDirectory($this->
getId());
165 $this->hiddenfilesfound = $a_hiddenfilesfound;
180 $this->style_id = $a_style_id;
185 $this->news_timeline = $a_val;
195 $this->news_timeline_auto_entries = $a_val;
205 $this->news_timeline_landing_page = $a_val;
215 if (!$this->news->isGloballyActivated()) {
235 $this->news_block_activated = $a_val;
245 $this->use_news = $a_val;
256 ?
string $a_default_value =
null 260 $ilDB = $DIC->database();
262 $q =
"SELECT value FROM container_settings WHERE " .
263 " id = " .
$ilDB->quote($a_id,
'integer') .
" AND " .
264 " keyword = " .
$ilDB->quote($a_keyword,
'text');
268 if (isset($rec[
'value'])) {
269 return $rec[
"value"];
272 return $a_default_value ??
'';
281 $ilDB = $DIC->database();
283 $q =
"SELECT value FROM container_settings WHERE " .
284 " id = " .
$ilDB->quote($a_id,
'integer') .
" AND " .
285 " keyword = " .
$ilDB->quote($a_keyword,
'text');
299 $ilDB = $DIC->database();
301 $query =
"DELETE FROM container_settings WHERE " .
302 "id = " .
$ilDB->quote($a_id,
'integer') .
" " .
303 "AND keyword = " .
$ilDB->quote($a_keyword,
'text');
304 $ilDB->manipulate($query);
307 $log->
debug(
"Write container setting, id: " . $a_id .
", keyword: " . $a_keyword .
", value: " . $a_value);
309 $query =
"INSERT INTO container_settings (id, keyword, value) VALUES (" .
310 $ilDB->quote($a_id,
'integer') .
", " .
311 $ilDB->quote($a_keyword,
'text') .
", " .
312 $ilDB->quote($a_value,
'text') .
315 $ilDB->manipulate($query);
326 $ilDB = $DIC->database();
330 $sql =
"SELECT keyword, value FROM container_settings WHERE " .
331 " id = " .
$ilDB->quote($a_id,
'integer');
332 $set =
$ilDB->query($sql);
333 while ($row =
$ilDB->fetchAssoc($set)) {
334 $res[$row[
"keyword"]] = $row[
"value"];
342 string $a_keyword =
"",
343 bool $a_keyword_like =
false 347 $ilDB = $DIC->database();
353 $sql =
"DELETE FROM container_settings WHERE " .
354 " id = " .
$ilDB->quote($a_id,
'integer');
355 if ($a_keyword !==
"") {
356 if (!$a_keyword_like) {
357 $sql .=
" AND keyword = " .
$ilDB->quote($a_keyword,
"text");
359 $sql .=
" AND " .
$ilDB->like(
"keyword",
"text", $a_keyword);
362 $ilDB->manipulate($sql);
370 $settings = self::_getContainerSettings($a_obj_id);
371 if (count($settings)) {
374 foreach ($settings as $keyword => $value) {
377 stripos($keyword,
"icon") !==
false 378 && $keyword !==
'hide_header_icon_and_title' 390 $a_xml->
xmlData((
string) $value);
406 public function cloneObject(
int $target_id,
int $copy_id = 0,
bool $omit_tree =
false): ?
ilObject 409 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
415 ->withDefaultTitle($new_obj->getTitle());
416 $new_obj->getObjectProperties()->storePropertyTranslations($ot);
417 $new_obj->setObjectTranslation($ot);
418 if ($ot->getDefaultDescription() !==
"") {
419 $new_obj->setDescription($ot->getDefaultDescription());
421 $log->
debug(
"**1**" . count($new_obj->getObjectTranslation()->getLanguages()));
422 $log->
debug(
"ilContainer: cloning translations from " . $this->
getId() .
" to " .
425 #18624 - copy all sorting settings 434 $orig_page->copy($new_obj->getId(),
"cont", $new_obj->getId());
438 $this->content_style_domain->styleForRefId($this->
getRefId())->cloneTo($new_obj->getId());
446 $orig_page->copy($new_obj->getId(),
"cstr", $new_obj->getId());
450 foreach (self::_getContainerSettings($this->
getId()) as $keyword => $value) {
451 self::_writeContainerSetting($new_obj->getId(), (string) $keyword, (
string) $value);
461 $mom_noti->cloneSettings($new_obj->getRefId());
465 $container_filter_service->cloneFilterFields($this->
getRefId(), $new_obj->getRefId());
482 parent::cloneDependencies($target_id, $copy_id);
487 self::fixInternalLinksAfterCopy($target_id, $copy_id, $this->
getRefId());
493 $collection = $olp->getCollectionInstance();
495 $collection->cloneCollection($target_id, $copy_id);
519 bool $soap_call =
false,
528 $wizard_options->saveOwner($ilUser->getId());
529 $wizard_options->saveRoot($clone_source);
532 $wizard_options->initContainer($clone_source, $ref_id);
534 foreach ($options as $source_id => $option) {
535 $wizard_options->addEntry($source_id, $option);
537 $wizard_options->read();
538 $wizard_options->storeTree($clone_source);
543 $wizard_options->read();
544 $wizard_options->dropFirstNode();
545 $wizard_options->appendMapping($clone_source, $ref_id);
554 $soap_client->setResponseTimeout($soap_client->getResponseTimeout());
555 $soap_client->enableWSDL(
true);
557 $ilLog->write(__METHOD__ .
': Trying to call Soap client...');
558 if ($soap_client->init()) {
560 $res = $soap_client->call(
'ilClone', [$new_session_id .
'::' . $client_id, $copy_id]);
563 $wizard_options->disableSOAP();
564 $wizard_options->read();
568 'copy_id' => $copy_id,
578 public function delete():
bool 581 if (!parent::delete()) {
592 return self::VIEW_BY_TYPE;
597 return $this->order_type ?: self::SORT_TITLE;
602 $this->order_type = $a_value;
610 $id = get_class($class_provider);
649 bool $a_admin_panel_enabled =
false,
650 bool $a_include_side_block =
false,
651 int $a_get_single = 0,
658 isset($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
659 is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
662 return $this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block];
667 $objects = self::getCompleteDescriptions($objects);
672 $id = get_class($class_provider);
675 $class_provider->setSelection($current);
676 $filtered = $class_provider->getFilteredObjects();
677 $objects = array_filter($objects,
static function (array $i) use ($filtered):
bool {
678 return (is_array($filtered) && in_array($i[
"obj_id"], $filtered));
687 if (!self::$data_preloaded) {
697 foreach ($objects as $key => $object) {
699 if (!self::$data_preloaded) {
700 if ($object[
"type"] ===
"sess") {
702 foreach ($ev_items as $ev_item) {
703 $preloader->addItem((
int) $ev_item[
"obj_id"], $ev_item[
"type"], $ev_item[
"ref_id"]);
707 if ($a_get_single > 0 && $object[
"child"] != $a_get_single) {
712 if ($object[
"type"] ===
"adm" || $object[
"type"] ===
"rolf" || $objDefinition->getDevMode($object[
"type"])) {
717 if ($objDefinition->isInactivePlugin($object[
"type"])) {
723 [
'file',
'fold',
'cat'],
727 if (!$a_admin_panel_enabled) {
733 if (!self::$data_preloaded) {
734 $preloader->addItem((
int) $object[
"obj_id"], $object[
"type"], $object[
"child"]);
738 if (!$a_include_side_block && $objDefinition->isSideBlock($object[
'type'])) {
742 $all_ref_ids[] = (
int) $object[
"child"];
746 if (!self::$data_preloaded) {
747 $preloader->preload();
750 self::$data_preloaded =
true;
753 foreach ($objects as $key => $object) {
755 if (!in_array($object[
"child"], $all_ref_ids)) {
760 $type = $objDefinition->getGroupOfObj($object[
"type"]);
762 $type = $object[
"type"];
768 $this->items[
$type][$key] = $object;
770 $this->items[
"_all"][$key] = $object;
771 if ($object[
"type"] !==
"sess") {
772 $this->items[
"_non_sess"][$key] = $object;
775 $this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]
776 = $sort->sortItems($this->items);
778 return $this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block];
786 if (isset($this->items[
"_all"]) && is_array($this->items[
"_all"]) && count($this->items[
"_all"]) > 0) {
805 if (empty($this->type_grps)) {
806 $this->type_grps = $objDefinition::getGroupedRepositoryObjectTypes($this->
getType());
816 if (
$ilSetting->get(
"enable_cat_page_edit")) {
826 $lng = $DIC->language();
828 $ret = parent::create();
848 self::_writeContainerSetting($this->
getId(),
"news_timeline", (
string) ((
int) $this->
getNewsTimeline()));
859 parent::putInTree($parent_ref_id);
862 if (self::_lookupContainerSetting(
ilObject::_lookupObjId($parent_ref_id),
"hide_header_icon_and_title")) {
863 self::_writeContainerSetting($this->
getId(),
"hide_header_icon_and_title",
'1');
866 self::_writeContainerSetting($this->
getId(),
"hide_top_actions",
'1');
872 $ret = parent::update();
879 ->withDefaultTitle($this->
getTitle())
884 $log->
debug(
":::::::::::::::::::::::::::");
892 self::_writeContainerSetting($this->
getId(),
"news_timeline", (
string) ((
int) $this->
getNewsTimeline()));
921 $this->setting->get(
'block_activated_news',
'1')
924 $this->news->isGloballyActivated());
937 $ilObjDataCache = $DIC[
"ilObjDataCache"];
940 $short_desc =
$ilSetting->get(
"rep_shorten_description");
941 $short_desc_max_length =
$ilSetting->get(
"rep_shorten_description_length");
945 foreach ($objects as $key => $object) {
947 $object[
"description"],
948 (
int) $short_desc_max_length,
956 foreach ($objects as $key => $object) {
957 $obj_ids[] = $object[
"obj_id"];
959 if (count($obj_ids)) {
961 foreach ($objects as $key => $object) {
963 if ($ilObjDataCache->isTranslatedDescription((
int) $object[
"obj_id"])) {
964 $long_desc[$object[
"obj_id"]] = $object[
"description"];
966 if ($short_desc && $short_desc_max_length) {
969 (
int) $short_desc_max_length,
973 $objects[$key][
"description"] =
$long_desc[$object[
"obj_id"]] ??
'';
981 protected static function fixInternalLinksAfterCopy(
989 $obj_definition = $DIC[
"objDefinition"];
993 $mapping = $cwo->getMappings();
997 $pg->handleRepositoryLinksOnCopy($mapping, $a_source_ref_id);
998 $pg->update(
true,
true);
1001 foreach ($mapping as $old_ref_id => $new_ref_id) {
1002 if (!is_numeric($old_ref_id) || !is_numeric($new_ref_id)) {
1009 $file = $loc .
'/class.' . $class .
'.php';
1011 if (is_file($file)) {
1013 $coll =
new $class();
1018 $page->handleRepositoryLinksOnCopy($mapping, $a_source_ref_id);
1019 $page->update(
true,
true);
1034 $this->obj_trans = $this->obj_trans->withoutLanguage($a_lang);
1042 string $a_lang_default
1044 if (empty($a_title)) {
1045 $a_title =
"NO TITLE";
1048 $this->obj_trans = $this->obj_trans->withLanguage(
1053 (
bool) $a_lang_default
1063 $filter = $this->domain->content()->filter(
1065 $container_user_filter,
1066 !self::_lookupContainerSetting($this->
getId(),
"filter_show_empty",
false)
1068 return $filter->apply();
setStyleSheetId(int $a_style_id)
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static _duplicate(string $a_session_id)
Duplicate session.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
const SORT_NEW_ITEMS_POSITION_TOP
static getLogger(string $a_component_id)
Get component logger.
ILIAS Container InternalDomainService $domain
setHiddenFilesFound(bool $a_hiddenfilesfound)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
isNewsTimelineEffective()
applyContainerUserFilter(array $objects, ?ilContainerUserFilter $container_user_filter=null)
logStack(?int $level=null, string $message='', array $context=[])
static getItemsByEvent(int $event_id)
Get session material / event items.
addTranslation(string $a_title, string $a_desc, string $a_lang, string $a_lang_default)
static ilClone(string $sid, int $copy_identifier)
getSubItems(bool $a_admin_panel_enabled=false, bool $a_include_side_block=false, int $a_get_single=0, ?ilContainerUserFilter $container_user_filter=null)
getDefaultLanguage()
Return default language.
Container start objects page object.
xmlData(string $data, bool $encode=true, bool $escape=true)
Writes data.
getChilds(int $a_node_id, string $a_order="", string $a_direction="ASC")
get child nodes of given node
getNewsTimelineLandingPage()
Class handles translation mode for an object.
filteredSubtree()
Note grp/crs currently allow to filter in their whole subtrees Catetories only their direct childs...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
putInTree(int $parent_ref_id)
static _isFileHidden(string $a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user. ...
ilObjectDefinition $obj_definition
setNewsBlockActivated(bool $a_val)
setOrderType(int $a_value)
getNewsTimelineAutoEntries()
addAdditionalSubItemInformation(array &$object)
Add additional information to sub item, e.g.
static _lookupObjId(int $ref_id)
xmlEndTag(string $tag)
Writes an endtag.
cloneDependencies(int $target_id, int $copy_id)
Clone object dependencies (container sorting)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setNewsTimelineLandingPage(bool $a_val)
static _lookupSortMode(int $a_obj_id)
static getLongDescriptions(array $obj_ids)
const SORT_NEW_ITEMS_POSITION_BOTTOM
isNewsTimelineLandingPageEffective()
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
const SORT_NEW_ITEMS_ORDER_CREATION
getClassName(string $obj_name)
static _hasContainerSetting(int $a_id, string $a_keyword)
deleteTranslation(string $a_lang)
static _allocateCopyId()
Allocate a copy for further entries.
bool $news_timeline_landing_page
static _getContainerDirectory(int $a_id)
static cloneSettingsOfBlock(string $block_type, int $block_id, int $new_block_id)
static _exportContainerSettings(ilXmlWriter $a_xml, int $a_obj_id)
setNewsTimeline(bool $a_val)
static fixContainerItemGroupRefsAfterCloning(ilContainer $a_source_container, int $a_copy_id)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
cloneAllObject(string $session_id, string $client_id, string $new_type, int $ref_id, int $clone_source, array $options, bool $soap_call=false, int $a_submode=1)
const SORT_NEW_ITEMS_ORDER_ACTIVATION
bool $news_timeline_auto_entries
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
const SORT_DIRECTION_DESC
ilRecommendedContentManager $recommended_content_manager
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
static _getInstance(int $a_obj_id)
static _cloneSettings(int $a_old_id, int $a_new_id)
setObjectTranslation(?Translations $obj_trans)
getLongDescription()
get object long description (stored in object_description)
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
isClassificationFilterActive()
setNewsTimelineAutoEntries(bool $a_val)
static _getInstance(int $a_copy_id)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
getLocation(string $obj_name)
debug(string $message, array $context=[])
ILIAS Style Content DomainService $content_style_domain
createContainerDirectory()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
bool $news_block_activated
static _lookupType(int $id, bool $reference=false)
static getValidProviders(int $a_parent_ref_id, int $a_parent_obj_id, string $a_parent_obj_type)
Get all valid providers (for parent container)
const SORT_NEW_ITEMS_ORDER_TITLE
static getInstance(int $obj_id)
Membership notification settings.
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
static _getContainerSettings(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const SUBMODE_CONTENT_ONLY
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
static _deleteContainerSettings(int $a_id, string $a_keyword="", bool $a_keyword_like=false)
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static bool $data_preloaded