27require_once
"./Services/Object/classes/class.ilObject.php";
130 $this->db =
$DIC->database();
131 $this->log =
$DIC[
"ilLog"];
132 $this->access =
$DIC->access();
133 $this->
error = $DIC[
"ilErr"];
134 $this->rbacsystem =
$DIC->rbac()->system();
135 $this->tree =
$DIC->repositoryTree();
136 $this->
user = $DIC->user();
137 $this->obj_definition =
$DIC[
"objDefinition"];
140 $this->setting =
$DIC[
"ilSetting"];
141 parent::__construct($a_id, $a_reference);
142 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
144 if ($this->
getId() > 0) {
174 $cont_dir = $webspace_dir .
"/container_data";
175 if (!is_dir($cont_dir)) {
178 $obj_dir = $cont_dir .
"/obj_" . $this->
getId();
179 if (!is_dir($obj_dir)) {
211 $this->hiddenfilesfound = $a_hiddenfilesfound;
229 return $this->style_id;
237 $this->style_id = $a_style_id;
247 $this->news_timeline = $a_val;
267 $this->news_timeline_auto_entries = $a_val;
287 $this->news_timeline_landing_page = $a_val;
297 return $this->news_timeline_landing_page;
340 $this->news_block_activated = $a_val;
350 return $this->news_block_activated;
360 $this->use_news = $a_val;
370 return $this->use_news;
387 $q =
"SELECT * FROM container_settings WHERE " .
388 " id = " .
$ilDB->quote($a_id,
'integer') .
" AND " .
389 " keyword = " .
$ilDB->quote($a_keyword,
'text');
390 $set =
$ilDB->query($q);
393 if (isset($rec[
'value'])) {
394 return $rec[
"value"];
396 if ($a_default_value ===
null) {
399 return $a_default_value;
413 $query =
"DELETE FROM container_settings WHERE " .
414 "id = " .
$ilDB->quote($a_id,
'integer') .
" " .
415 "AND keyword = " .
$ilDB->quote($a_keyword,
'text');
419 $log->debug(
"Write container setting, id: " . $a_id .
", keyword: " . $a_keyword .
", value: " . $a_value);
421 $query =
"INSERT INTO container_settings (id, keyword, value) VALUES (" .
422 $ilDB->quote($a_id,
'integer') .
", " .
423 $ilDB->quote($a_keyword,
'text') .
", " .
424 $ilDB->quote($a_value,
'text') .
438 $sql =
"SELECT * FROM container_settings WHERE " .
439 " id = " .
$ilDB->quote($a_id,
'integer');
440 $set =
$ilDB->query($sql);
458 $sql =
"DELETE FROM container_settings WHERE " .
459 " id = " .
$ilDB->quote($a_id,
'integer');
461 if (!$a_keyword_like) {
462 $sql .=
" AND keyword = " .
$ilDB->quote($a_keyword,
"text");
464 $sql .=
" AND " .
$ilDB->like(
"keyword",
"text", $a_keyword);
467 $ilDB->manipulate($sql);
474 if (
sizeof($settings)) {
477 foreach ($settings as $keyword => $value) {
479 if (stristr($keyword,
"icon")) {
506 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
509 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
512 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
514 $ot->copy($new_obj->getId());
516 include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
517 #18624 - copy all sorting settings
521 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
527 $orig_page->copy($new_obj->getId(),
"cont", $new_obj->getId());
531 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
536 $new_id = $style_obj->ilClone();
537 $new_obj->setStyleSheetId($new_id);
545 include_once(
"./Services/Container/classes/class.ilContainerStartObjectsPage.php");
551 $orig_page->copy($new_obj->getId(),
"cstr", $new_obj->getId());
555 foreach (self::_getContainerSettings($this->
getId()) as $keyword => $value) {
566 $mom_noti->cloneSettings($new_obj->getRefId());
583 parent::cloneDependencies($a_target_id, $a_copy_id);
585 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
589 ilContainer::fixInternalLinksAfterCopy($a_target_id, $a_copy_id, $this->
getRefId());
592 include_once(
"./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
595 include_once(
'Services/Object/classes/class.ilObjectLP.php');
597 $collection = $olp->getCollectionInstance();
599 $collection->cloneCollection($a_target_id, $a_copy_id);
623 include_once(
'./Services/Link/classes/class.ilLink.php');
624 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
635 $wizard_options->saveOwner(
$ilUser->getId());
636 $wizard_options->saveRoot($clone_source);
639 $wizard_options->initContainer($clone_source,
$ref_id);
641 foreach (
$options as $source_id => $option) {
642 $wizard_options->addEntry($source_id, $option);
644 $wizard_options->read();
645 $wizard_options->storeTree($clone_source);
647 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
651 $wizard_options->read();
652 $wizard_options->dropFirstNode();
653 $wizard_options->appendMapping($clone_source,
$ref_id);
661 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
664 $soap_client->setResponseTimeout(5);
665 $soap_client->enableWSDL(
true);
667 $ilLog->write(__METHOD__ .
': Trying to call Soap client...');
668 if ($soap_client->init()) {
670 $res = $soap_client->call(
'ilClone', array($new_session_id .
'::' .
$client_id, $copy_id));
673 $wizard_options->disableSOAP();
674 $wizard_options->read();
675 include_once(
'./webservice/soap/include/inc.soap_functions.php');
679 'copy_id' => $copy_id,
680 'ref_id' => (
int)
$res
689 public function delete()
692 if (!parent::delete()) {
696 $this->obj_trans->delete();
719 $this->order_type = $a_value;
730 public function getSubItems($a_admin_panel_enabled =
false, $a_include_side_block =
false, $a_get_single = 0)
736 if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
738 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
747 $all_ref_ids = array();
749 if (!self::$data_preloaded) {
750 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
754 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
759 include_once
'./Modules/Session/classes/class.ilEventItems.php';
762 foreach ($objects as
$key => $object) {
763 if ($a_get_single > 0 && $object[
"child"] != $a_get_single) {
768 if (
$objDefinition->getDevMode($object[
"type"]) || $object[
"type"] ==
"adm"
769 || $object[
"type"] ==
"rolf") {
779 if (in_array($object[
'type'], array(
'file',
'fold',
'cat'))) {
780 include_once
'Modules/File/classes/class.ilObjFileAccess.php';
783 if (!$a_admin_panel_enabled) {
791 if (!self::$data_preloaded) {
792 $preloader->addItem($object[
"obj_id"], $object[
"type"], $object[
"child"]);
796 if (in_array($object[
'ref_id'], $event_items)) {
801 if (!$a_include_side_block &&
$objDefinition->isSideBlock($object[
'type'])) {
805 $all_ref_ids[] = $object[
"child"];
809 if (!self::$data_preloaded) {
810 $preloader->preload();
813 self::$data_preloaded =
true;
816 foreach ($objects as
$key => $object) {
818 if (!in_array($object[
"child"], $all_ref_ids)) {
825 $type = $object[
"type"];
833 $this->items[
"_all"][
$key] = $object;
834 if ($object[
"type"] !=
"sess") {
835 $this->items[
"_non_sess"][
$key] = $object;
839 $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block]
840 = $sort->sortItems($this->items);
842 return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
850 if (is_array($this->items[
"_all"]) && count($this->items[
"_all"]) > 0) {
873 if (empty($this->type_grps)) {
876 return $this->type_grps;
887 if (
$ilSetting->get(
"enable_cat_page_edit")) {
901 $ret = parent::create();
910 $lng->getDefaultLanguage(),
915 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
920 $log->debug(
"Create Container, id: " . $this->
getId());
925 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
937 parent::putInTree($a_parent_ref);
956 $trans->setDefaultTitle($this->
getTitle());
960 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
964 $log->debug(
"Update Container, id: " . $this->
getId());
969 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
988 include_once(
"./Services/Container/classes/class.ilContainerSortingSettings.php");
991 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1009 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
1013 $this->setting->get(
'block_activated_news',
true)
1031 $ilObjDataCache =
$DIC[
"ilObjDataCache"];
1033 $short_desc =
$ilSetting->get(
"rep_shorten_description");
1034 $short_desc_max_length =
$ilSetting->get(
"rep_shorten_description_length");
1038 foreach ($objects as
$key => $object) {
1045 foreach ($objects as
$key => $object) {
1046 $obj_ids[] = $object[
"obj_id"];
1048 if (
sizeof($obj_ids)) {
1050 foreach ($objects as
$key => $object) {
1052 if ($ilObjDataCache->isTranslatedDescription($object[
"obj_id"])) {
1053 $long_desc[$object[
"obj_id"]] = $object[
"description"];
1055 if ($short_desc && $short_desc_max_length) {
1072 protected static function fixInternalLinksAfterCopy($a_target_id, $a_copy_id, $a_source_ref_id)
1080 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
1082 include_once(
"./Services/CopyWizard/classes/class.ilCopyWizardOptions.php");
1084 $mapping = $cwo->getMappings();
1088 $pg->handleRepositoryLinksOnCopy($mapping, $a_source_ref_id);
1089 $pg->update(
true,
true);
1092 foreach ($mapping as $old_ref_id => $new_ref_id) {
1093 if (!is_numeric($old_ref_id) || !is_numeric($new_ref_id)) {
1100 $file = $loc .
'/class.' . $class .
'.php';
1102 if (is_file($file)) {
1104 $coll =
new $class();
1109 $page->handleRepositoryLinksOnCopy($mapping, $a_source_ref_id);
1110 $page->update(
true,
true);
1122 $this->obj_trans->delete();
1132 $this->obj_trans->removeLanguage($a_lang);
1133 $this->obj_trans->save();
1147 if (empty($a_title)) {
1148 $a_title =
"NO TITLE";
1151 $this->obj_trans->addLanguage($a_lang, $a_title, $a_desc, $a_lang_default,
true);
1152 $this->obj_trans->save();
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.
setObjectTranslation(ilObjectTranslation $obj_trans)
Get object translation.
const SORT_DIRECTION_DESC
deleteTranslation($a_lang)
Delete translation.
setNewsTimelineLandingPage($a_val)
Set news timline is landing page.
cloneDependencies($a_target_id, $a_copy_id)
Clone object dependencies (container sorting)
putInTree($a_parent_ref)
maybe this method should be in tree object!?role/rbac stuff
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
$news_timeline_auto_entries
getContainerDirectory()
Get the container directory.
createContainerDirectory()
Create directory for the container.
setHiddenFilesFound($a_hiddenfilesfound)
Set Found hidden files (set by getSubItems).
addTranslation($a_title, $a_desc, $a_lang, $a_lang_default)
Add translation.
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 _writeContainerSetting($a_id, $a_keyword, $a_value)
const SORT_NEW_ITEMS_POSITION_BOTTOM
getObjectTranslation()
Get object translation.
__construct($a_id=0, $a_reference=true)
Constructor @access public.
setNewsBlockActivated($a_val)
Set news block activated.
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.
removeTranslations()
Remove all translations of container.
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.
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 handles translation mode for an object.
static getInstance($a_obj_id)
Get instance.
Class ilObject Basic functions for all objects.
getType()
get object type @access public
static _lookupObjId($a_id)
getRefId()
get reference id @access public
getLongDescription()
get object long description (stored in object_description)
getDescription()
get object description
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
getTitle()
get object title @access public
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)
foreach($_POST as $key=> $value) $res