27require_once
"./Services/Object/classes/class.ilObject.php";
126 $this->db =
$DIC->database();
127 $this->log =
$DIC[
"ilLog"];
128 $this->access =
$DIC->access();
129 $this->
error = $DIC[
"ilErr"];
130 $this->rbacsystem =
$DIC->rbac()->system();
131 $this->tree =
$DIC->repositoryTree();
132 $this->
user = $DIC->user();
133 $this->obj_definition =
$DIC[
"objDefinition"];
136 $this->setting =
$DIC[
"ilSetting"];
137 parent::__construct($a_id, $a_reference);
147 $cont_dir = $webspace_dir .
"/container_data";
148 if (!is_dir($cont_dir)) {
151 $obj_dir = $cont_dir .
"/obj_" . $this->
getId();
152 if (!is_dir($obj_dir)) {
228 $this->hiddenfilesfound = $a_hiddenfilesfound;
246 return $this->style_id;
254 $this->style_id = $a_style_id;
264 $this->news_timeline = $a_val;
284 $this->news_timeline_auto_entries = $a_val;
304 $this->news_timeline_landing_page = $a_val;
314 return $this->news_timeline_landing_page;
357 $this->news_block_activated = $a_val;
367 return $this->news_block_activated;
377 $this->use_news = $a_val;
387 return $this->use_news;
404 $q =
"SELECT * FROM container_settings WHERE " .
405 " id = " .
$ilDB->quote($a_id,
'integer') .
" AND " .
406 " keyword = " .
$ilDB->quote($a_keyword,
'text');
407 $set =
$ilDB->query($q);
410 if (isset($rec[
'value'])) {
411 return $rec[
"value"];
413 if ($a_default_value ===
null) {
416 return $a_default_value;
430 $query =
"DELETE FROM container_settings WHERE " .
431 "id = " .
$ilDB->quote($a_id,
'integer') .
" " .
432 "AND keyword = " .
$ilDB->quote($a_keyword,
'text');
436 $log->debug(
"Write container setting, id: " . $a_id .
", keyword: " . $a_keyword .
", value: " . $a_value);
438 $query =
"INSERT INTO container_settings (id, keyword, value) VALUES (" .
439 $ilDB->quote($a_id,
'integer') .
", " .
440 $ilDB->quote($a_keyword,
'text') .
", " .
441 $ilDB->quote($a_value,
'text') .
455 $sql =
"SELECT * FROM container_settings WHERE " .
456 " id = " .
$ilDB->quote($a_id,
'integer');
457 $set =
$ilDB->query($sql);
475 $sql =
"DELETE FROM container_settings WHERE " .
476 " id = " .
$ilDB->quote($a_id,
'integer');
478 if (!$a_keyword_like) {
479 $sql .=
" AND keyword = " .
$ilDB->quote($a_keyword,
"text");
481 $sql .=
" AND " .
$ilDB->like(
"keyword",
"text", $a_keyword);
484 $ilDB->manipulate($sql);
491 if (
sizeof($settings)) {
494 foreach ($settings as $keyword => $value) {
496 if (stristr($keyword,
"icon")) {
526 $file_name = $cont_dir .
"/icon_custom.svg";
527 if (is_file($file_name)) {
543 if ($a_custom_icon !=
"") {
544 if (is_file($cont_dir .
"/icon_custom.svg")) {
545 unlink($cont_dir .
"/icon_custom.svg");
547 $file_name = $cont_dir .
"/icon_custom.svg";
548 ilUtil::moveUploadedFile($a_custom_icon,
"icon_custom.svg", $file_name);
550 if ($file_name !=
"" && is_file($file_name)) {
564 $small_file_name = $cont_dir .
"/icon_custom.svg";
565 @unlink($small_file_name);
577 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
580 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
582 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
583 #18624 - copy all sorting settings
587 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
593 $orig_page->copy($new_obj->getId(),
"cont", $new_obj->getId());
597 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
602 $new_id = $style_obj->ilClone();
603 $new_obj->setStyleSheetId($new_id);
611 include_once(
"./Services/Container/classes/class.ilContainerStartObjectsPage.php");
617 $orig_page->copy($new_obj->getId(),
"cstr", $new_obj->getId());
621 foreach (self::_getContainerSettings($this->
getId()) as $keyword => $value) {
625 if ($keyword ==
"icon_custom" &&
628 $new_obj->createContainerDirectory();
629 $tgt_dir = $new_obj->getContainerDirectory();
631 $file =
"icon_custom.svg";
632 $src_file = $src_dir .
"/" .
$file;
633 if (file_exists($src_file)) {
634 copy($src_file, $tgt_dir .
"/" .
$file);
646 $mom_noti->cloneSettings($new_obj->getRefId());
663 parent::cloneDependencies($a_target_id, $a_copy_id);
665 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
669 ilContainer::fixInternalLinksAfterCopy($a_target_id, $a_copy_id, $this->
getRefId());
672 include_once(
"./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
675 include_once(
'Services/Object/classes/class.ilObjectLP.php');
677 $collection = $olp->getCollectionInstance();
679 $collection->cloneCollection($a_target_id, $a_copy_id);
703 include_once(
'./Services/Link/classes/class.ilLink.php');
704 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
715 $wizard_options->saveOwner(
$ilUser->getId());
716 $wizard_options->saveRoot($clone_source);
719 $wizard_options->initContainer($clone_source,
$ref_id);
721 foreach (
$options as $source_id => $option) {
722 $wizard_options->addEntry($source_id, $option);
724 $wizard_options->read();
725 $wizard_options->storeTree($clone_source);
727 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
731 $wizard_options->read();
732 $wizard_options->dropFirstNode();
733 $wizard_options->appendMapping($clone_source,
$ref_id);
741 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
744 $soap_client->setResponseTimeout(5);
745 $soap_client->enableWSDL(
true);
747 $ilLog->write(__METHOD__ .
': Trying to call Soap client...');
748 if ($soap_client->init()) {
750 $res = $soap_client->call(
'ilClone', array($new_session_id .
'::' .
$client_id, $copy_id));
753 $wizard_options->disableSOAP();
754 $wizard_options->read();
755 include_once(
'./webservice/soap/include/inc.soap_functions.php');
759 'copy_id' => $copy_id,
760 'ref_id' => (
int)
$res
782 $this->order_type = $a_value;
793 public function getSubItems($a_admin_panel_enabled =
false, $a_include_side_block =
false, $a_get_single = 0)
799 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
801 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
810 $all_ref_ids = array();
812 if (!self::$data_preloaded) {
813 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
817 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
822 include_once
'./Modules/Session/classes/class.ilEventItems.php';
825 foreach ($objects as
$key => $object) {
826 if ($a_get_single > 0 && $object[
"child"] != $a_get_single) {
831 if (
$objDefinition->getDevMode($object[
"type"]) || $object[
"type"] ==
"adm"
832 || $object[
"type"] ==
"rolf") {
842 if (in_array($object[
'type'], array(
'file',
'fold',
'cat'))) {
843 include_once
'Modules/File/classes/class.ilObjFileAccess.php';
846 if (!$a_admin_panel_enabled) {
854 if (!self::$data_preloaded) {
855 $preloader->addItem($object[
"obj_id"], $object[
"type"], $object[
"child"]);
859 if (in_array($object[
'ref_id'], $event_items)) {
864 if (!$a_include_side_block &&
$objDefinition->isSideBlock($object[
'type'])) {
868 $all_ref_ids[] = $object[
"child"];
872 if (!self::$data_preloaded) {
873 $preloader->preload();
876 self::$data_preloaded =
true;
879 foreach ($objects as
$key => $object) {
881 if (!in_array($object[
"child"], $all_ref_ids)) {
888 $type = $object[
"type"];
896 $this->items[
"_all"][
$key] = $object;
897 if ($object[
"type"] !=
"sess") {
898 $this->items[
"_non_sess"][
$key] = $object;
902 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block]
903 = $sort->sortItems($this->items);
905 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
913 if (is_array($this->items[
"_all"]) && count($this->items[
"_all"]) > 0) {
936 if (empty($this->type_grps)) {
939 return $this->type_grps;
950 if (
$ilSetting->get(
"enable_cat_page_edit")) {
960 $ret = parent::create();
963 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
968 $log->debug(
"Create Container, id: " . $this->
getId());
973 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
987 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
991 $log->debug(
"Update Container, id: " . $this->
getId());
996 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
1015 include_once(
"./Services/Container/classes/class.ilContainerSortingSettings.php");
1018 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1035 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
1039 $this->setting->get(
'block_activated_news',
true)
1057 $ilObjDataCache =
$DIC[
"ilObjDataCache"];
1059 $short_desc =
$ilSetting->get(
"rep_shorten_description");
1060 $short_desc_max_length =
$ilSetting->get(
"rep_shorten_description_length");
1064 foreach ($objects as
$key => $object) {
1071 foreach ($objects as
$key => $object) {
1072 $obj_ids[] = $object[
"obj_id"];
1074 if (
sizeof($obj_ids)) {
1076 foreach ($objects as
$key => $object) {
1078 if ($ilObjDataCache->isTranslatedDescription($object[
"obj_id"])) {
1079 $long_desc[$object[
"obj_id"]] = $object[
"description"];
1081 if ($short_desc && $short_desc_max_length) {
1098 protected static function fixInternalLinksAfterCopy($a_target_id, $a_copy_id, $a_source_ref_id)
1106 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
1108 include_once(
"./Services/CopyWizard/classes/class.ilCopyWizardOptions.php");
1110 $mapping = $cwo->getMappings();
1112 $pg->handleRepositoryLinksOnCopy($mapping, $a_source_ref_id);
1113 $pg->update(
true,
true);
1114 foreach ($mapping as $old_ref_id => $new_ref_id) {
1115 if (!is_int($old_ref_id) || !is_int($new_ref_id)) {
1121 $file = $loc .
"/class." . $class .
".php";
1122 if (is_file(
$file)) {
1123 include_once(
$file);
1125 $coll =
new $class();
1130 $page->handleRepositoryLinksOnCopy($mapping, $a_source_ref_id);
1131 $page->update(
true,
true);
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
static cloneSettingsOfBlock(string $block_type, int $block_id, int $new_block_id)
Clone block settings.
static _cloneSettings($a_old_id, $a_new_id)
Clone settings.
static _lookupSortMode($a_obj_id)
lookup sort mode
static _getInstance($a_obj_id)
get instance by obj_id
Container start objects page object.
setNewsTimeline($a_val)
Set news timeline.
const SORT_DIRECTION_DESC
saveIcons($a_custom_icon)
save container icons
setNewsTimelineLandingPage($a_val)
Set news timline is landing page.
cloneDependencies($a_target_id, $a_copy_id)
Clone object dependencies (container sorting)
getGroupedObjTypes()
Get grouped repository object types.
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
getSubItems($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
Get subitems of container.
getNewsTimeline()
Get news timeline.
getStyleSheetId()
get ID of assigned style sheet object
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
static _exportContainerSettings(ilXmlWriter $a_xml, $a_obj_id)
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
getNewsTimelineLandingPage()
Get news timline is landing page.
static _deleteContainerSettings($a_id, $a_keyword=null, $a_keyword_like=false)
const SORT_NEW_ITEMS_ORDER_ACTIVATION
getBigIconPath()
Get path for big icon.
$news_timeline_auto_entries
getContainerDirectory()
Get the container directory.
getCustomIconPath()
Get path for custom icon.
createContainerDirectory()
Create directory for the container.
setHiddenFilesFound($a_hiddenfilesfound)
Set Found hidden files (set by getSubItems).
addAdditionalSubItemInformation(&$object)
Add additional information to sub item, e.g.
static _getContainerSettings($a_id)
const SORT_NEW_ITEMS_ORDER_TITLE
getHiddenFilesFound()
Get Found hidden files (set by getSubItems).
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
const SORT_NEW_ITEMS_ORDER_CREATION
static _getContainerDirectory($a_id)
Get the container directory.
static _lookupIconPath($a_id, $a_size="big")
lookup icon path
getSmallIconPath()
Get path for small icon.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
const SORT_NEW_ITEMS_POSITION_BOTTOM
__construct($a_id=0, $a_reference=true)
Constructor @access public.
setNewsBlockActivated($a_val)
Set news block activated.
removeCustomIcon()
remove small icon
setUseNews($a_val)
Set use news.
getOrderType()
Get order type default implementation.
setNewsTimelineAutoEntries($a_val)
Set news timeline auto entries.
const SORT_NEW_ITEMS_POSITION_TOP
getNewsBlockActivated()
Get news block activated.
gotItems()
Check whether we got any items.
getNewsTimelineAutoEntries()
Get news timeline auto entries.
getViewMode()
Get container view mode.
enablePageEditing()
Check whether page editing is allowed for container.
getUseNews()
Get use news.
isNewsTimelineEffective()
Is news timeline effective?
isNewsTimelineLandingPageEffective()
Is news timeline landing page effective?
readContainerSettings()
Read container settings.
getTinyIconPath()
Get path for tiny icon.
static _allocateCopyId()
Allocate a copy for further entries.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _getItemsOfContainer($a_ref_id)
static getLogger($a_component_id)
Get component logger.
Membership notification settings.
static _isFileHidden($a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user.
static fixContainerItemGroupRefsAfterCloning($a_source_container, $a_copy_id)
Fix container item group references after a container has been cloned.
static _lookupStandard($a_id)
Lookup standard flag.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
const SUBMODE_CONTENT_ONLY
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstance($a_obj_id)
Preloader for object list GUIs.
Class ilObject Basic functions for all objects.
getType()
get object type @access public
static _lookupObjId($a_id)
getRefId()
get reference id @access public
getId()
get object id @access public
static getLongDescriptions(array $a_obj_ids)
Get long description data.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static _duplicate($a_session_id)
Duplicate session.
static ilClone($sid, $copy_identifier)
static getWebspaceDir($mode="filesystem")
get webspace directory
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
xmlEndTag($tag)
Writes an endtag.
xmlData($data, $encode=true, $escape=true)
Writes data.
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
update($pash, $contents, Config $config)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
foreach($_POST as $key=> $value) $res