27require_once 
"./Services/Object/classes/class.ilObject.php";
 
   84                parent::__construct($a_id, $a_call_by_reference);
 
   96                $cont_dir = $webspace_dir.
"/container_data";
 
   97                if (!is_dir($cont_dir))
 
  101                $obj_dir = $cont_dir.
"/obj_".$this->
getId();
 
  102                if (!is_dir($obj_dir))
 
  179                $this->hiddenfilesfound = $a_hiddenfilesfound;
 
  197                return $this->style_id;
 
  205                $this->style_id = $a_style_id;
 
  220                $q = 
"SELECT * FROM container_settings WHERE ".
 
  221                                " id = ".$ilDB->quote($a_id ,
'integer').
" AND ".
 
  222                                " keyword = ".$ilDB->quote($a_keyword ,
'text');
 
  223                $set = 
$ilDB->query($q);
 
  226                if(isset($rec[
'value']))
 
  228                        return $rec[
"value"];
 
  230                if($a_default_value === NULL)
 
  234                return $a_default_value;
 
  241                $query = 
"DELETE FROM container_settings WHERE ".
 
  242                        "id = ".$ilDB->quote($a_id,
'integer').
" ".
 
  243                        "AND keyword = ".$ilDB->quote($a_keyword,
'text');
 
  246                $query = 
"INSERT INTO container_settings (id, keyword, value) VALUES (".
 
  247                        $ilDB->quote($a_id ,
'integer').
", ".
 
  248                        $ilDB->quote($a_keyword ,
'text').
", ".
 
  249                        $ilDB->quote($a_value ,
'text').
 
  260                $sql = 
"SELECT * FROM container_settings WHERE ".
 
  261                                " id = ".$ilDB->quote($a_id ,
'integer');
 
  262                $set = 
$ilDB->query($sql);
 
  280                $sql = 
"DELETE FROM container_settings WHERE ".
 
  281                                " id = ".$ilDB->quote($a_id ,
'integer');
 
  286                                $sql .= 
" AND keyword = ".$ilDB->quote($a_keyword, 
"text");
 
  290                                $sql .= 
" AND ".$ilDB->like(
"keyword", 
"text", $a_keyword);
 
  293                $ilDB->manipulate($sql);                
 
  300                if(
sizeof($settings))
 
  304                        foreach($settings as $keyword => $value)
 
  307                                if(stristr($keyword, 
"icon"))
 
  345                        $file_name = $cont_dir.
"/icon_custom.svg";
 
  346                        if (is_file($file_name))
 
  366                if ($a_custom_icon != 
"")
 
  368                        $file_name = $cont_dir.
"/icon_custom.svg";
 
  371                        if ($file_name != 
"" && is_file($file_name))
 
  388                $small_file_name = $cont_dir.
"/icon_custom.svg";
 
  389                @unlink($small_file_name);
 
  405                $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
 
  407                include_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
 
  408                #18624 - copy all sorting settings 
  412                include_once(
"./Services/Container/classes/class.ilContainerPage.php");
 
  417                        $orig_page->copy($new_obj->getId(), 
"cont", $new_obj->getId());                 
 
  421                include_once(
"./Services/Container/classes/class.ilContainerStartObjectsPage.php");
 
  426                        $orig_page->copy($new_obj->getId(), 
"cstr", $new_obj->getId());
 
  430                foreach(self::_getContainerSettings($this->
getId()) as $keyword => $value)
 
  435                        if($keyword == 
"icon_custom" && 
 
  439                                $new_obj->createContainerDirectory();
 
  440                                $tgt_dir = $new_obj->getContainerDirectory();
 
  442                                $file = 
"icon_custom.svg";
 
  443                                $src_file = $src_dir.
"/".
$file;
 
  444                                if(file_exists($src_file))
 
  446                                        copy($src_file, $tgt_dir.
"/".
$file);
 
  466                parent::cloneDependencies($a_target_id, $a_copy_id);
 
  468                include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
 
  472                include_once(
"./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
 
  475                include_once(
'Services/Object/classes/class.ilObjectLP.php');
 
  477                $collection = $olp->getCollectionInstance();
 
  480                        $collection->cloneCollection($a_target_id, $a_copy_id);         
 
  501                include_once(
'./Services/Link/classes/class.ilLink.php');
 
  502                include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
 
  509                $wizard_options->saveOwner(
$ilUser->getId());
 
  510                $wizard_options->saveRoot($clone_source);
 
  513                $wizard_options->initContainer($clone_source, 
$ref_id);
 
  515                foreach(
$options as $source_id => $option)
 
  517                        $wizard_options->addEntry($source_id,$option);
 
  519                $wizard_options->read();
 
  520                $wizard_options->storeTree($clone_source);
 
  525                        $ilLog->write(__METHOD__.
': Copy course in course...');
 
  526                        $ilLog->write(__METHOD__.
': Added mapping, source ID: '.$clone_source.
', target ID: '.
$ref_id);
 
  527                        $wizard_options->read();
 
  528                        $wizard_options->dropFirstNode();
 
  529                        $wizard_options->appendMapping($clone_source,
$ref_id);
 
  536                include_once 
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
 
  539                $soap_client->setResponseTimeout(30);
 
  540                $soap_client->enableWSDL(
true);
 
  542                $ilLog->write(__METHOD__.
': Trying to call Soap client...');
 
  543                if($soap_client->init())
 
  545                        $ilLog->write(__METHOD__.
': Calling soap clone method...');
 
  546                        $res = $soap_client->call(
'ilClone',array($new_session_id.
'::'.
$client_id, $copy_id));
 
  550                        $ilLog->write(__METHOD__.
': SOAP call failed. Calling clone method manually. ');
 
  551                        $wizard_options->disableSOAP();
 
  552                        $wizard_options->read();                        
 
  553                        include_once(
'./webservice/soap/include/inc.soap_functions.php');
 
  585                $this->order_type = $a_value;
 
  596        function getSubItems($a_admin_panel_enabled = 
false, $a_include_side_block = 
false,
 
  599                global $objDefinition, 
$ilBench, $tree, $ilObjDataCache, 
$ilUser, $rbacsystem,
 
  603                if (is_array($this->items[(
int) $a_admin_panel_enabled][(
int) $a_include_side_block]) &&
 
  606                        return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
 
  610                $objects = $tree->getChilds($this->
getRefId(), 
"title");
 
  615                $all_ref_ids = array();
 
  617                if(!self::$data_preloaded)
 
  619                        include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
 
  623                include_once(
'Services/Container/classes/class.ilContainerSorting.php');
 
  628                include_once 
'./Modules/Session/classes/class.ilEventItems.php';
 
  631                foreach ($objects as $key => $object)
 
  633                        if ($a_get_single > 0 && $object[
"child"] != $a_get_single)
 
  639                        if ($objDefinition->getDevMode($object[
"type"]) || $object[
"type"] == 
"adm" 
  640                                || $object[
"type"] == 
"rolf")
 
  646                        if ($objDefinition->isInactivePlugin($object[
"type"]))
 
  652                        if (in_array($object[
'type'], array(
'file',
'fold',
'cat')))
 
  654                                include_once 
'Modules/File/classes/class.ilObjFileAccess.php';
 
  658                                        if (!$a_admin_panel_enabled)
 
  667                        if (!self::$data_preloaded)
 
  669                                $preloader->addItem($object[
"obj_id"], $object[
"type"], $object[
"child"]);                                      
 
  673                        if (in_array($object[
'ref_id'],$event_items))
 
  679                        if(!$a_include_side_block && $objDefinition->isSideBlock($object[
'type']))
 
  684                        $all_ref_ids[] = $object[
"child"];
 
  688                if (!self::$data_preloaded)
 
  690                        $preloader->preload();
 
  693                        self::$data_preloaded = 
true;
 
  696                foreach($objects as $key => $object)
 
  699                        if(!in_array($object[
"child"], $all_ref_ids))
 
  705                        $type = $objDefinition->getGroupOfObj($object[
"type"]);
 
  708                                $type = $object[
"type"];
 
  714                        $this->items[
$type][$key] = $object;
 
  716                        $this->items[
"_all"][$key] = $object;
 
  717                        if ($object[
"type"] != 
"sess")
 
  719                                $this->items[
"_non_sess"][$key] = $object;
 
  723                $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block]
 
  724                        = $sort->sortItems($this->items);
 
  726                return $this->items[(int) $a_admin_panel_enabled][(
int) $a_include_side_block];
 
  734                if (is_array($this->items[
"_all"]) && count($this->items[
"_all"]) > 0)
 
  756                global $objDefinition;
 
  758                if (empty($this->type_grps))
 
  760                        $this->type_grps = $objDefinition->getGroupedRepositoryObjectTypes($this->
getType());
 
  762                return $this->type_grps;
 
  784                $ret = parent::create();
 
  788                        include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
  800                $ret = parent::update();
 
  802                include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
  820                include_once(
"./Services/Container/classes/class.ilContainerSortingSettings.php");
 
  823                include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
  838                $short_desc = 
$ilSetting->get(
"rep_shorten_description");
 
  839                $short_desc_max_length = 
$ilSetting->get(
"rep_shorten_description_length");
 
  845                                foreach($objects as $key => $object)
 
  847                                        $objects[$key][
"description"] = 
ilUtil::shortenText($object[
"description"], $short_desc_max_length, 
true);
 
  854                                foreach($objects as $key => $object)
 
  856                                        $obj_ids[] = $object[
"obj_id"];
 
  861                                        foreach($objects as $key => $object)
 
  864                                                if($ilObjDataCache->isTranslatedDescription($object[
"obj_id"]))
 
  866                                                        $long_desc[$object[
"obj_id"]] = $object[
"description"];
 
  868                                                if($short_desc && $short_desc_max_length)
 
  872                                                $objects[$key][
"description"] = 
$long_desc[$object[
"obj_id"]];
 
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.
_lookupIconPath($a_id, $a_size="big")
lookup icon path
const SORT_DIRECTION_DESC
saveIcons($a_custom_icon)
save container icons
cloneDependencies($a_target_id, $a_copy_id)
Clone object dependencies (container sorting)
getGroupedObjTypes()
Get grouped repository object types.
getSubItems($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
Get subitems of container.
getStyleSheetId()
get ID of assigned style sheet object
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 ...
static _deleteContainerSettings($a_id, $a_keyword=null, $a_keyword_like=false)
const SORT_NEW_ITEMS_ORDER_ACTIVATION
getBigIconPath()
Get path for big icon.
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
_lookupContainerSetting($a_id, $a_keyword, $a_default_value=NULL)
Lookup a container setting.
getHiddenFilesFound()
Get Found hidden files (set by getSubItems).
_getContainerDirectory($a_id)
Get the container directory.
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
const SORT_NEW_ITEMS_ORDER_CREATION
_writeContainerSetting($a_id, $a_keyword, $a_value)
getSmallIconPath()
Get path for small icon.
const SORT_NEW_ITEMS_POSITION_BOTTOM
removeCustomIcon()
remove small icon
getOrderType()
Get order type default implementation.
const SORT_NEW_ITEMS_POSITION_TOP
ilContainer($a_id=0, $a_call_by_reference=true)
Constructor @access public.
gotItems()
Check whether we got any items.
getViewMode()
Get container view mode.
cloneAllObject($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false)
clone all objects according to this container
enablePageEditing()
Check whether page editing is allowed for container.
cloneObject($a_target_id, $a_copy_id=0)
Clone 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 _isFinished($a_copy_id)
check if copy is finished
_getItemsOfContainer($a_ref_id)
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 lookupObjectStyle($a_obj_id)
Lookup object style.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
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 _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
static _duplicate($a_session_id)
Duplicate session.
static ilClone($sid, $copy_identifier)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static getWebspaceDir($mode="filesystem")
get webspace directory
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.
if(!is_array($argv)) $options