ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilContainer Class Reference

Class ilContainer. More...

+ Inheritance diagram for ilContainer:
+ Collaboration diagram for ilContainer:

Public Member Functions

 __construct ($a_id=0, $a_reference=true)
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 getBigIconPath ()
 Get path for big icon. More...
 
 getSmallIconPath ()
 Get path for small icon. More...
 
 getTinyIconPath ()
 Get path for tiny icon. More...
 
 getCustomIconPath ()
 Get path for custom icon. More...
 
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems). More...
 
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems). More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 setNewsTimeline ($a_val)
 Set news timeline. More...
 
 getNewsTimeline ()
 Get news timeline. More...
 
 setNewsTimelineAutoEntries ($a_val)
 Set news timeline auto entries. More...
 
 getNewsTimelineAutoEntries ()
 Get news timeline auto entries. More...
 
 setNewsTimelineLandingPage ($a_val)
 Set news timline is landing page. More...
 
 getNewsTimelineLandingPage ()
 Get news timline is landing page. More...
 
 isNewsTimelineEffective ()
 Is news timeline effective? More...
 
 isNewsTimelineLandingPageEffective ()
 Is news timeline landing page effective? More...
 
 setNewsBlockActivated ($a_val)
 Set news block activated. More...
 
 getNewsBlockActivated ()
 Get news block activated. More...
 
 setUseNews ($a_val)
 Set use news. More...
 
 getUseNews ()
 Get use news. More...
 
 saveIcons ($a_custom_icon)
 save container icons More...
 
 removeCustomIcon ()
 remove small icon More...
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone container settings. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 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 More...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 update ()
 Update. More...
 
 read ()
 read More...
 
 readContainerSettings ()
 Read container settings. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _getContainerDirectory ($a_id)
 Get the container directory. More...
 
static _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting. More...
 
static _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
static _getContainerSettings ($a_id)
 
static _deleteContainerSettings ($a_id, $a_keyword=null, $a_keyword_like=false)
 
static _exportContainerSettings (ilXmlWriter $a_xml, $a_obj_id)
 
static _lookupIconPath ($a_id, $a_size="big")
 lookup icon path More...
 
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description) More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

const VIEW_SESSIONS = 0
 
const VIEW_OBJECTIVE = 1
 
const VIEW_TIMING = 2
 
const VIEW_ARCHIVE = 3
 
const VIEW_SIMPLE = 4
 
const VIEW_BY_TYPE = 5
 
const VIEW_INHERIT = 6
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
const SORT_CREATION = 4
 
const SORT_DIRECTION_ASC = 0
 
const SORT_DIRECTION_DESC = 1
 
const SORT_NEW_ITEMS_POSITION_TOP = 0
 
const SORT_NEW_ITEMS_POSITION_BOTTOM = 1
 
const SORT_NEW_ITEMS_ORDER_TITLE = 0
 
const SORT_NEW_ITEMS_ORDER_CREATION = 1
 
const SORT_NEW_ITEMS_ORDER_ACTIVATION = 2
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Static Public Attributes

static $data_preloaded = false
 

Static Protected Member Functions

static fixInternalLinksAfterCopy ($a_target_id, $a_copy_id, $a_source_ref_id)
 Fix internal links after copy process. More...
 

Protected Attributes

 $order_type = 0
 
 $hiddenfilesfound = false
 
 $news_timeline = false
 
 $news_timeline_auto_entries = false
 
 $setting
 

Detailed Description

Class ilContainer.

Base class for all container objects (categories, courses, groups)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 39 of file class.ilContainer.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainer::__construct (   $a_id = 0,
  $a_reference = true 
)

Definition at line 82 of file class.ilContainer.php.

References $DIC.

83  {
84  global $DIC;
85 
86  $this->setting = $DIC["ilSetting"];
87  parent::__construct($a_id, $a_reference);
88 
89  }
global $DIC

Member Function Documentation

◆ _deleteContainerSettings()

static ilContainer::_deleteContainerSettings (   $a_id,
  $a_keyword = null,
  $a_keyword_like = false 
)
static

Definition at line 422 of file class.ilContainer.php.

References $ilDB.

Referenced by ilObjCategoryGUI\updateTaxonomySettingsObject().

423  {
424  global $ilDB;
425 
426  if(!$a_id)
427  {
428  return;
429  }
430 
431  $sql = "DELETE FROM container_settings WHERE ".
432  " id = ".$ilDB->quote($a_id ,'integer');
433  if($a_keyword)
434  {
435  if(!$a_keyword_like)
436  {
437  $sql .= " AND keyword = ".$ilDB->quote($a_keyword, "text");
438  }
439  else
440  {
441  $sql .= " AND ".$ilDB->like("keyword", "text", $a_keyword);
442  }
443  }
444  $ilDB->manipulate($sql);
445  }
global $ilDB
+ Here is the caller graph for this function:

◆ _exportContainerSettings()

static ilContainer::_exportContainerSettings ( ilXmlWriter  $a_xml,
  $a_obj_id 
)
static

Definition at line 447 of file class.ilContainer.php.

References array, ilXmlWriter\xmlData(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by ilCategoryXmlWriter\export(), ilGroupXMLWriter\start(), and ilCourseXMLWriter\start().

448  {
449  // container settings
450  $settings = self::_getContainerSettings($a_obj_id);
451  if(sizeof($settings))
452  {
453  $a_xml->xmlStartTag("ContainerSettings");
454 
455  foreach($settings as $keyword => $value)
456  {
457  // :TODO: proper custom icon export/import
458  if(stristr($keyword, "icon"))
459  {
460  continue;
461  }
462 
463  $a_xml->xmlStartTag(
464  'ContainerSetting',
465  array(
466  'id' => $keyword,
467  )
468  );
469 
470  $a_xml->xmlData($value);
471  $a_xml->xmlEndTag("ContainerSetting");
472  }
473 
474  $a_xml->xmlEndTag("ContainerSettings");
475  }
476  }
xmlData($data, $encode=TRUE, $escape=TRUE)
Writes data.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlEndTag($tag)
Writes an endtag.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getContainerDirectory()

static ilContainer::_getContainerDirectory (   $a_id)
static

Get the container directory.

Returns
string container directory

Definition at line 127 of file class.ilContainer.php.

References ilUtil\getWebspaceDir().

Referenced by ilObject\_getIcon(), _lookupIconPath(), and getContainerDirectory().

128  {
129  return ilUtil::getWebspaceDir()."/container_data/obj_".$a_id;
130  }
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getContainerSettings()

static ilContainer::_getContainerSettings (   $a_id)
static

Definition at line 405 of file class.ilContainer.php.

References $ilDB, $res, $row, and array.

Referenced by ilObjCategoryGUI\getActiveBlocks(), and ilTaxonomyClassificationProvider\getActiveTaxonomiesForParentRefId().

406  {
407  global $ilDB;
408 
409  $res = array();
410 
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))
415  {
416  $res[$row["keyword"]] = $row["value"];
417  }
418 
419  return $res;
420  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupContainerSetting()

static ilContainer::_lookupContainerSetting (   $a_id,
  $a_keyword,
  $a_default_value = NULL 
)
static

Lookup a container setting.

Parameters
intcontainer id
stringsetting keyword
Returns
string setting value

Definition at line 358 of file class.ilContainer.php.

References $ilDB, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by ilObjCategoryGUI\__construct(), ilObject\_getIcon(), ilAdvancedMDRecord\_getSelectedRecordsByObject(), _lookupIconPath(), ilContainerGUI\editPageContentObject(), ilContainerGUI\editPageFrameObject(), ilContainerGUI\forwardToPageObject(), ilTaxonomyClassificationProvider\getActiveTaxonomiesForParentRefId(), ilContainerGUI\getContainerPageHTML(), ilObjCategoryListGUI\getInfoScreenStatus(), ilTaxMDGUI\getSelectableTaxonomies(), ilObjCategoryGUI\getTabs(), ilObjectMetaDataGUI\hasAdvancedMDSettings(), ilObject\hasAutoRating(), ilObjRootFolderGUI\initEditForm(), ilObjectServiceSettingsGUI\initServiceSettingsForm(), ilContainerGUI\initStylePropertiesForm(), ilObjectListGUI\insertCommands(), ilTaggingClassificationProvider\isActive(), ilColumnGUI\isGloballyActivated(), ilBadgeHandler\isObjectActive(), ilCalendarSettings\lookupCalendarActivated(), ilObjectDataSet\readData(), ilContainerGUI\savePageContentObject(), ilObjRootFolderGUI\setTitleAndDescription(), and ilContainerGUI\setTitleAndDescription().

359  {
360  global $ilDB;
361 
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);
366  $rec = $set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
367 
368  if(isset($rec['value']))
369  {
370  return $rec["value"];
371  }
372  if($a_default_value === NULL)
373  {
374  return '';
375  }
376  return $a_default_value;
377  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupIconPath()

static ilContainer::_lookupIconPath (   $a_id,
  $a_size = "big" 
)
static

lookup icon path

Parameters
int$a_idcontainer object id
string$a_size"big" | "small"

Definition at line 484 of file class.ilContainer.php.

References $size, _getContainerDirectory(), and _lookupContainerSetting().

Referenced by ilPDSelectedItemsBlockGUI\addParentRow(), ilContainerGUI\addStandardRow(), ilPDSelectedItemsBlockGUI\addStandardRow(), and ilContainerGUI\setTitleAndDescription().

485  {
486  if ($a_size == "")
487  {
488  $a_size = "big";
489  }
490  $size = $a_size;
491 
492  if (ilContainer::_lookupContainerSetting($a_id, "icon_custom"))
493  {
494  $cont_dir = ilContainer::_getContainerDirectory($a_id);
495 
496  $file_name = $cont_dir."/icon_custom.svg";
497  if (is_file($file_name))
498  {
499  return $file_name;
500  }
501  }
502 
503  return "";
504  }
$size
Definition: RandomTest.php:79
static _getContainerDirectory($a_id)
Get the container directory.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=NULL)
Lookup a container setting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _writeContainerSetting()

static ilContainer::_writeContainerSetting (   $a_id,
  $a_keyword,
  $a_value 
)
static
Parameters
$a_id
$a_keyword
$a_value

Definition at line 384 of file class.ilContainer.php.

References $ilDB, $log, $query, $res, and ilLoggerFactory\getLogger().

Referenced by ilCategoryXmlParser\handlerEndTag(), ilGroupXMLParser\handlerEndTag(), ilCourseXMLParser\handlerEndTag(), ilObjectDataSet\importRecord(), ilAdvancedMetaDataImporter\importXmlRepresentation(), removeCustomIcon(), saveIcons(), ilObjStudyProgramme\saveIcons(), ilContainerGUI\savePageContentObject(), ilObjRootFolderGUI\updateObject(), ilObjectServiceSettingsGUI\updateServiceSettingsForm(), ilObjCategoryGUI\updateTaxonomySettingsObject(), ilObjectServiceSettingsGUI\updateToolSettings(), and ilContainerGUI\useNewEditorObject().

385  {
386  global $ilDB;
387 
388  $query = "DELETE FROM container_settings WHERE ".
389  "id = ".$ilDB->quote($a_id,'integer')." ".
390  "AND keyword = ".$ilDB->quote($a_keyword,'text');
391  $res = $ilDB->manipulate($query);
392 
394  $log->debug("Write container setting, id: ".$a_id.", keyword: ".$a_keyword.", value: ".$a_value);
395 
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').
400  ")";
401 
402  $res = $ilDB->manipulate($query);
403  }
global $ilDB
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAdditionalSubItemInformation()

ilContainer::addAdditionalSubItemInformation ( $object)

Add additional information to sub item, e.g.

used in courses for timings information etc.

Definition at line 915 of file class.ilContainer.php.

Referenced by getSubItems().

916  {
917  }
+ Here is the caller graph for this function:

◆ cloneAllObject()

ilContainer::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

Parameters
string$session_id
string$client_id
string$new_type
int$ref_id
int$clone_source
array$options
boolforce soap
intsubmode 1 => copy all, 2 => copy content
Returns
new refid if clone has finished or parameter ref id if cloning is still in progress
array(copy_id => xyz, ref_id => new ref_id)

Definition at line 672 of file class.ilContainer.php.

References $client_id, $ilErr, $ilLog, $ilUser, $options, ilObject\$ref_id, $res, ilCopyWizardOptions\_allocateCopyId(), ilSession\_duplicate(), ilCopyWizardOptions\_getInstance(), array, ilLoggerFactory\getLogger(), ilSoapFunctions\ilClone(), and ilObjectCopyGUI\SUBMODE_CONTENT_ONLY.

673  {
674  global $ilLog;
675 
676  include_once('./Services/Link/classes/class.ilLink.php');
677  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
678 
679  global $ilAccess,$ilErr,$rbacsystem,$tree,$ilUser;
680 
681  // Save wizard options
683  $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
684  $wizard_options->saveOwner($ilUser->getId());
685  $wizard_options->saveRoot($clone_source);
686 
687  // add entry for source container
688  $wizard_options->initContainer($clone_source, $ref_id);
689 
690  foreach($options as $source_id => $option)
691  {
692  $wizard_options->addEntry($source_id,$option);
693  }
694  $wizard_options->read();
695  $wizard_options->storeTree($clone_source);
696 
697  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
698  if($a_submode == ilObjectCopyGUI::SUBMODE_CONTENT_ONLY)
699  {
700  ilLoggerFactory::getLogger('obj')->info('Copy content only...');
701  ilLoggerFactory::getLogger('obj')->debug('Added mapping, source ID: '.$clone_source.', target ID: '.$ref_id);
702  $wizard_options->read();
703  $wizard_options->dropFirstNode();
704  $wizard_options->appendMapping($clone_source,$ref_id);
705  }
706 
707 
708  #print_r($options);
709  // Duplicate session to avoid logout problems with backgrounded SOAP calls
710  $new_session_id = ilSession::_duplicate($session_id);
711  // Start cloning process using soap call
712  include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
713 
714  $soap_client = new ilSoapClient();
715  $soap_client->setResponseTimeout(5);
716  $soap_client->enableWSDL(true);
717 
718  $ilLog->write(__METHOD__.': Trying to call Soap client...');
719  if($soap_client->init())
720  {
721  ilLoggerFactory::getLogger('obj')->info('Calling soap clone method');
722  $res = $soap_client->call('ilClone',array($new_session_id.'::'.$client_id, $copy_id));
723  }
724  else
725  {
726  ilLoggerFactory::getLogger('obj')->warning('SOAP clone call failed. Calling clone method manually');
727  $wizard_options->disableSOAP();
728  $wizard_options->read();
729  include_once('./webservice/soap/include/inc.soap_functions.php');
730  $res = ilSoapFunctions::ilClone($new_session_id.'::'.$client_id, $copy_id);
731  }
732  return array(
733  'copy_id' => $copy_id,
734  'ref_id' => (int) $res
735  );
736  }
global $ilErr
Definition: raiseError.php:16
static ilClone($sid, $copy_identifier)
static _getInstance($a_copy_id)
Get instance of copy wizard options.
if(!is_array($argv)) $options
$ilUser
Definition: imgupload.php:18
static _allocateCopyId()
Allocate a copy for further entries.
Create styles array
The data for the language used.
static _duplicate($a_session_id)
Duplicate session.
static getLogger($a_component_id)
Get component logger.
$client_id
+ Here is the call graph for this function:

◆ cloneDependencies()

ilContainer::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone object dependencies (container sorting)

public

Parameters
inttarget ref id of new course
intcopy id return bool

Definition at line 631 of file class.ilContainer.php.

References $ilLog, ilContainerSorting\_getInstance(), ilObjItemGroup\fixContainerItemGroupRefsAfterCloning(), fixInternalLinksAfterCopy(), ilObject\getId(), ilObjectLP\getInstance(), and ilObject\getRefId().

632  {
633  global $ilLog;
634 
635  parent::cloneDependencies($a_target_id, $a_copy_id);
636 
637  include_once('./Services/Container/classes/class.ilContainerSorting.php');
638  ilContainerSorting::_getInstance($this->getId())->cloneSorting($a_target_id,$a_copy_id);
639 
640  // fix internal links to other objects
641  ilContainer::fixInternalLinksAfterCopy($a_target_id,$a_copy_id, $this->getRefId());
642 
643  // fix item group references in page content
644  include_once("./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
646 
647  include_once('Services/Object/classes/class.ilObjectLP.php');
648  $olp = ilObjectLP::getInstance($this->getId());
649  $collection = $olp->getCollectionInstance();
650  if($collection)
651  {
652  $collection->cloneCollection($a_target_id, $a_copy_id);
653  }
654 
655  return true;
656  }
getId()
get object id public
static fixContainerItemGroupRefsAfterCloning($a_source_container, $a_copy_id)
Fix container item group references after a container has been cloned.
getRefId()
get reference id public
static _getInstance($a_obj_id)
get instance by obj_id
static getInstance($a_obj_id)
static fixInternalLinksAfterCopy($a_target_id, $a_copy_id, $a_source_ref_id)
Fix internal links after copy process.
+ Here is the call graph for this function:

◆ cloneObject()

ilContainer::cloneObject (   $a_target_id,
  $a_copy_id = 0,
  $a_omit_tree = false 
)

Clone container settings.

public

Parameters
inttarget ref_id
intcopy id
Returns
object new object

Definition at line 552 of file class.ilContainer.php.

References $file, $ilLog, ilContainerSortingSettings\_cloneSettings(), ilPageObject\_exists(), ilObjStyleSheet\_lookupStandard(), getContainerDirectory(), ilObject\getId(), ilObjectFactory\getInstanceByObjId(), and getStyleSheetId().

553  {
554  global $ilLog;
555 
556  $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
557 
558  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
559  #18624 - copy all sorting settings
560  ilContainerSortingSettings::_cloneSettings($this->getId(), $new_obj->getId());
561 
562  // copy content page
563  include_once("./Services/Container/classes/class.ilContainerPage.php");
564  if (ilContainerPage::_exists("cont",
565  $this->getId()))
566  {
567  $orig_page = new ilContainerPage($this->getId());
568  $orig_page->copy($new_obj->getId(), "cont", $new_obj->getId());
569  }
570 
571  // #20614 - copy style
572  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
573  $style_id = $this->getStyleSheetId();
574  if ($style_id > 0)
575  {
576  if (!!ilObjStyleSheet::_lookupStandard($style_id))
577  {
578  $style_obj = ilObjectFactory::getInstanceByObjId($style_id);
579  $new_id = $style_obj->ilClone();
580  $new_obj->setStyleSheetId($new_id);
581  $new_obj->update();
582  }
583  else
584  {
585  $new_obj->setStyleSheetId($this->getStyleSheetId());
586  }
587  }
588 
589  // #10271 - copy start objects page
590  include_once("./Services/Container/classes/class.ilContainerStartObjectsPage.php");
592  $this->getId()))
593  {
594  $orig_page = new ilContainerStartObjectsPage($this->getId());
595  $orig_page->copy($new_obj->getId(), "cstr", $new_obj->getId());
596  }
597 
598  // #10271
599  foreach(self::_getContainerSettings($this->getId()) as $keyword => $value)
600  {
601  self::_writeContainerSetting($new_obj->getId(), $keyword, $value);
602 
603  // copy custom icons
604  if($keyword == "icon_custom" &&
605  $value)
606  {
607  // see saveIcons()
608  $new_obj->createContainerDirectory();
609  $tgt_dir = $new_obj->getContainerDirectory();
610  $src_dir = $this->getContainerDirectory();
611  $file = "icon_custom.svg";
612  $src_file = $src_dir."/".$file;
613  if(file_exists($src_file))
614  {
615  copy($src_file, $tgt_dir."/".$file);
616  }
617  }
618  }
619 
620  return $new_obj;
621  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Container start objects page object.
static _cloneSettings($a_old_id, $a_new_id)
Clone settings.
static _lookupStandard($a_id)
Lookup standard flag.
getContainerDirectory()
Get the container directory.
getId()
get object id public
Container page object.
getStyleSheetId()
get ID of assigned style sheet object
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

◆ create()

ilContainer::create ( )

Create.

Definition at line 952 of file class.ilContainer.php.

References $log, $ret, ilObject\getId(), ilLoggerFactory\getLogger(), getNewsBlockActivated(), getNewsTimeline(), getNewsTimelineAutoEntries(), getNewsTimelineLandingPage(), getStyleSheetId(), getUseNews(), ilObjectServiceSettingsGUI\NEWS_VISIBILITY, ilObjectServiceSettingsGUI\USE_NEWS, and ilObjStyleSheet\writeStyleUsage().

953  {
954  $ret = parent::create();
955 
956  if (((int) $this->getStyleSheetId()) > 0)
957  {
958  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
960  }
961 
963  $log->debug("Create Container, id: ".$this->getId());
964 
965  self::_writeContainerSetting($this->getId(), "news_timeline", (int) $this->getNewsTimeline());
966  self::_writeContainerSetting($this->getId(), "news_timeline_incl_auto", (int) $this->getNewsTimelineAutoEntries());
967  self::_writeContainerSetting($this->getId(), "news_timeline_landing_page", (int) $this->getNewsTimelineLandingPage());
968  include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
969  self::_writeContainerSetting($this->getId() ,ilObjectServiceSettingsGUI::NEWS_VISIBILITY,(int) $this->getNewsBlockActivated());
970  self::_writeContainerSetting($this->getId() ,ilObjectServiceSettingsGUI::USE_NEWS,(int) $this->getUseNews());
971 
972  return $ret;
973  }
getNewsTimelineLandingPage()
Get news timline is landing page.
getNewsTimelineAutoEntries()
Get news timeline auto entries.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getId()
get object id public
getStyleSheetId()
get ID of assigned style sheet object
getNewsTimeline()
Get news timeline.
getUseNews()
Get use news.
$ret
Definition: parser.php:6
static getLogger($a_component_id)
Get component logger.
getNewsBlockActivated()
Get news block activated.
+ Here is the call graph for this function:

◆ createContainerDirectory()

ilContainer::createContainerDirectory ( )

Create directory for the container.

It is <webspace_dir>/container_data.

Definition at line 95 of file class.ilContainer.php.

References $DIC, ilObject\getId(), ilUtil\getWebspaceDir(), and ilUtil\makeDir().

Referenced by saveIcons(), and ilObjStudyProgramme\saveIcons().

96  {
97  global $DIC;
98 
99  $webspace_dir = ilUtil::getWebspaceDir();
100  $cont_dir = $webspace_dir."/container_data";
101  if (!is_dir($cont_dir))
102  {
103  ilUtil::makeDir($cont_dir);
104  }
105  $obj_dir = $cont_dir."/obj_".$this->getId();
106  if (!is_dir($obj_dir))
107  {
108  ilUtil::makeDir($obj_dir);
109  }
110  }
getId()
get object id public
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
global $DIC
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enablePageEditing()

ilContainer::enablePageEditing ( )

Check whether page editing is allowed for container.

Definition at line 938 of file class.ilContainer.php.

References $ilSetting.

939  {
940  global $ilSetting;
941 
942  // @todo: this will need a more general approach
943  if ($ilSetting->get("enable_cat_page_edit"))
944  {
945  return true;
946  }
947  }
global $ilSetting
Definition: privfeed.php:17

◆ fixInternalLinksAfterCopy()

static ilContainer::fixInternalLinksAfterCopy (   $a_target_id,
  $a_copy_id,
  $a_source_ref_id 
)
staticprotected

Fix internal links after copy process.

Parameters
int$a_target_idref if of new container
int$a_copy_idcopy process id

Definition at line 1096 of file class.ilContainer.php.

References ilPageObject\_exists(), ilCopyWizardOptions\_getInstance(), and ilObject\_lookupObjId().

Referenced by cloneDependencies().

1097  {
1098  $obj_id = ilObject::_lookupObjId($a_target_id);
1099  include_once("./Services/Container/classes/class.ilContainerPage.php");
1100  if (ilContainerPage::_exists("cont", $obj_id))
1101  {
1102  include_once("./Services/CopyWizard/classes/class.ilCopyWizardOptions.php");
1103  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
1104  $mapping = $cwo->getMappings();
1105  $pg = new ilContainerPage($obj_id);
1106  $pg->handleRepositoryLinksOnCopy($mapping, $a_source_ref_id);
1107  $pg->update(true, true);
1108  }
1109  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Container page object.
static _lookupObjId($a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBigIconPath()

ilContainer::getBigIconPath ( )

Get path for big icon.

Returns
string icon path
Deprecated:
use _lookupIconPath instead

Definition at line 138 of file class.ilContainer.php.

References ilObject\getId().

Referenced by ilObjCategory\cloneObject(), ilObjGroup\cloneObject(), and ilObjCourse\cloneObject().

139  {
140  return self::_lookupIconPath($this->getId());
141  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCompleteDescriptions()

static ilContainer::getCompleteDescriptions ( array  $objects)
static

overwrites description fields to long or short description in an assoc array keys needed (obj_id and description)

Parameters
array$objects
Returns
array

Definition at line 1044 of file class.ilContainer.php.

References $ilSetting, ilObject\$long_desc, array, ilObject\DESC_LENGTH, ilObject\getLongDescriptions(), and ilUtil\shortenText().

Referenced by ilContainerContentGUI\renderItem(), and ilContainerContentGUI\renderItemGroup().

1045  {
1046  global $ilSetting, $ilObjDataCache;
1047  // using long descriptions?
1048  $short_desc = $ilSetting->get("rep_shorten_description");
1049  $short_desc_max_length = $ilSetting->get("rep_shorten_description_length");
1050  if(!$short_desc || $short_desc_max_length != ilObject::DESC_LENGTH)
1051  {
1052  // using (part of) shortened description
1053  if($short_desc && $short_desc_max_length && $short_desc_max_length < ilObject::DESC_LENGTH)
1054  {
1055  foreach($objects as $key => $object)
1056  {
1057  $objects[$key]["description"] = ilUtil::shortenText($object["description"], $short_desc_max_length, true);
1058  }
1059  }
1060  // using (part of) long description
1061  else
1062  {
1063  $obj_ids = array();
1064  foreach($objects as $key => $object)
1065  {
1066  $obj_ids[] = $object["obj_id"];
1067  }
1068  if(sizeof($obj_ids))
1069  {
1071  foreach($objects as $key => $object)
1072  {
1073  // #12166 - keep translation, ignore long description
1074  if($ilObjDataCache->isTranslatedDescription($object["obj_id"]))
1075  {
1076  $long_desc[$object["obj_id"]] = $object["description"];
1077  }
1078  if($short_desc && $short_desc_max_length)
1079  {
1080  $long_desc[$object["obj_id"]] = ilUtil::shortenText($long_desc[$object["obj_id"]], $short_desc_max_length, true);
1081  }
1082  $objects[$key]["description"] = $long_desc[$object["obj_id"]];
1083  }
1084  }
1085  }
1086  }
1087  return $objects;
1088  }
static getLongDescriptions(array $a_obj_ids)
Get long description data.
const DESC_LENGTH
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
Create styles array
The data for the language used.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContainerDirectory()

ilContainer::getContainerDirectory ( )

Get the container directory.

Returns
string container directory

Definition at line 117 of file class.ilContainer.php.

References _getContainerDirectory(), and ilObject\getId().

Referenced by cloneObject(), removeCustomIcon(), saveIcons(), and ilObjStudyProgramme\saveIcons().

118  {
119  return $this->_getContainerDirectory($this->getId());
120  }
static _getContainerDirectory($a_id)
Get the container directory.
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCustomIconPath()

ilContainer::getCustomIconPath ( )

Get path for custom icon.

Returns
string icon path

Definition at line 170 of file class.ilContainer.php.

References ilObject\getId().

171  {
172  return self::_lookupIconPath($this->getId());
173  }
getId()
get object id public
+ Here is the call graph for this function:

◆ getGroupedObjTypes()

ilContainer::getGroupedObjTypes ( )

Get grouped repository object types.

Returns
array array of object types

Definition at line 924 of file class.ilContainer.php.

References ilObject\getType().

Referenced by getSubItems().

925  {
926  global $objDefinition;
927 
928  if (empty($this->type_grps))
929  {
930  $this->type_grps = $objDefinition->getGroupedRepositoryObjectTypes($this->getType());
931  }
932  return $this->type_grps;
933  }
getType()
get object type public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHiddenFilesFound()

ilContainer::getHiddenFilesFound ( )

Get Found hidden files (set by getSubItems).

Returns
boolean Found hidden files (set by getSubItems)

Definition at line 191 of file class.ilContainer.php.

References $hiddenfilesfound.

192  {
194  }

◆ getNewsBlockActivated()

ilContainer::getNewsBlockActivated ( )

Get news block activated.

Returns
bool news block activated

Definition at line 325 of file class.ilContainer.php.

Referenced by create(), and update().

326  {
327  return $this->news_block_activated;
328  }
+ Here is the caller graph for this function:

◆ getNewsTimeline()

ilContainer::getNewsTimeline ( )

Get news timeline.

Returns
bool activate news timeline

Definition at line 227 of file class.ilContainer.php.

References $news_timeline.

Referenced by create(), isNewsTimelineEffective(), isNewsTimelineLandingPageEffective(), and update().

228  {
229  return $this->news_timeline;
230  }
+ Here is the caller graph for this function:

◆ getNewsTimelineAutoEntries()

ilContainer::getNewsTimelineAutoEntries ( )

Get news timeline auto entries.

Returns
bool include automatically created entries

Definition at line 247 of file class.ilContainer.php.

References $news_timeline_auto_entries.

Referenced by create(), and update().

248  {
250  }
+ Here is the caller graph for this function:

◆ getNewsTimelineLandingPage()

ilContainer::getNewsTimelineLandingPage ( )

Get news timline is landing page.

Returns
bool is news timline landing page?

Definition at line 267 of file class.ilContainer.php.

Referenced by create(), isNewsTimelineLandingPageEffective(), and update().

268  {
269  return $this->news_timeline_landing_page;
270  }
+ Here is the caller graph for this function:

◆ getOrderType()

ilContainer::getOrderType ( )

Get order type default implementation.

Definition at line 749 of file class.ilContainer.php.

References SORT_TITLE.

750  {
751  return $this->order_type ? $this->order_type : ilContainer::SORT_TITLE;
752  }

◆ getSmallIconPath()

ilContainer::getSmallIconPath ( )

Get path for small icon.

Returns
string icon path
Deprecated:
use _lookupIconPath instead

Definition at line 149 of file class.ilContainer.php.

References ilObject\getId().

Referenced by ilObjCategory\cloneObject(), ilObjGroup\cloneObject(), and ilObjCourse\cloneObject().

150  {
151  return self::_lookupIconPath($this->getId());
152  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilContainer::getStyleSheetId ( )

get ID of assigned style sheet object

Definition at line 199 of file class.ilContainer.php.

Referenced by cloneObject(), create(), and update().

200  {
201  return $this->style_id;
202  }
+ Here is the caller graph for this function:

◆ getSubItems()

ilContainer::getSubItems (   $a_admin_panel_enabled = false,
  $a_include_side_block = false,
  $a_get_single = 0 
)

Get subitems of container.

Parameters
booladministration panel enabled
boolside blocks enabled
Returns
array

Definition at line 767 of file class.ilContainer.php.

References $ilBench, $ilSetting, $ilUser, ilObject\$type, ilContainerSorting\_getInstance(), ilEventItems\_getItemsOfContainer(), ilObjFileAccess\_isFileHidden(), addAdditionalSubItemInformation(), array, ilObjectListGUI\CONTEXT_REPOSITORY, getGroupedObjTypes(), ilObject\getId(), ilObject\getRefId(), and setHiddenFilesFound().

768  {
769  global $objDefinition, $ilBench, $tree, $ilObjDataCache, $ilUser, $rbacsystem,
770  $ilSetting;
771 
772  // Caching
773  if (is_array($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block]) &&
774  !$a_get_single)
775  {
776  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
777  }
778 
779  $type_grps = $this->getGroupedObjTypes();
780  $objects = $tree->getChilds($this->getRefId(), "title");
781 
782  $objects = self::getCompleteDescriptions($objects);
783 
784  $found = false;
785  $all_ref_ids = array();
786 
787  if(!self::$data_preloaded)
788  {
789  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
791  }
792 
793  include_once('Services/Container/classes/class.ilContainerSorting.php');
794  $sort = ilContainerSorting::_getInstance($this->getId());
795 
796  // TODO: check this
797  // get items attached to a session
798  include_once './Modules/Session/classes/class.ilEventItems.php';
799  $event_items = ilEventItems::_getItemsOfContainer($this->getRefId());
800 
801  foreach ($objects as $key => $object)
802  {
803  if ($a_get_single > 0 && $object["child"] != $a_get_single)
804  {
805  continue;
806  }
807 
808  // hide object types in devmode
809  if ($objDefinition->getDevMode($object["type"]) || $object["type"] == "adm"
810  || $object["type"] == "rolf")
811  {
812  continue;
813  }
814 
815  // remove inactive plugins
816  if ($objDefinition->isInactivePlugin($object["type"]))
817  {
818  continue;
819  }
820 
821  // BEGIN WebDAV: Don't display hidden Files, Folders and Categories
822  if (in_array($object['type'], array('file','fold','cat')))
823  {
824  include_once 'Modules/File/classes/class.ilObjFileAccess.php';
825  if (ilObjFileAccess::_isFileHidden($object['title']))
826  {
827  $this->setHiddenFilesFound(true);
828  if (!$a_admin_panel_enabled)
829  {
830  continue;
831  }
832  }
833  }
834  // END WebDAV: Don't display hidden Files, Folders and Categories
835 
836  // including event items!
837  if (!self::$data_preloaded)
838  {
839  $preloader->addItem($object["obj_id"], $object["type"], $object["child"]);
840  }
841 
842  // filter out items that are attached to an event
843  if (in_array($object['ref_id'],$event_items))
844  {
845  continue;
846  }
847 
848  // filter side block items
849  if(!$a_include_side_block && $objDefinition->isSideBlock($object['type']))
850  {
851  continue;
852  }
853 
854  $all_ref_ids[] = $object["child"];
855  }
856 
857  // data preloader
858  if (!self::$data_preloaded)
859  {
860  $preloader->preload();
861  unset($preloader);
862 
863  self::$data_preloaded = true;
864  }
865 
866  foreach($objects as $key => $object)
867  {
868  // see above, objects were filtered
869  if(!in_array($object["child"], $all_ref_ids))
870  {
871  continue;
872  }
873 
874  // group object type groups together (e.g. learning resources)
875  $type = $objDefinition->getGroupOfObj($object["type"]);
876  if ($type == "")
877  {
878  $type = $object["type"];
879  }
880 
881  // this will add activation properties
882  $this->addAdditionalSubItemInformation($object);
883 
884  $this->items[$type][$key] = $object;
885 
886  $this->items["_all"][$key] = $object;
887  if ($object["type"] != "sess")
888  {
889  $this->items["_non_sess"][$key] = $object;
890  }
891  }
892 
893  $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block]
894  = $sort->sortItems($this->items);
895 
896  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
897  }
static _getItemsOfContainer($a_ref_id)
static _isFileHidden($a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user. ...
setHiddenFilesFound($a_hiddenfilesfound)
Set Found hidden files (set by getSubItems).
Preloader for object list GUIs.
getId()
get object id public
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
addAdditionalSubItemInformation(&$object)
Add additional information to sub item, e.g.
global $ilSetting
Definition: privfeed.php:17
global $ilBench
Definition: ilias.php:18
getRefId()
get reference id public
static _getInstance($a_obj_id)
get instance by obj_id
getGroupedObjTypes()
Get grouped repository object types.
+ Here is the call graph for this function:

◆ getTinyIconPath()

ilContainer::getTinyIconPath ( )

Get path for tiny icon.

Returns
string icon path
Deprecated:
use _lookupIconPath instead

Definition at line 160 of file class.ilContainer.php.

References ilObject\getId().

Referenced by ilObjCategory\cloneObject(), ilObjGroup\cloneObject(), and ilObjCourse\cloneObject().

161  {
162  return self::_lookupIconPath($this->getId());
163  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUseNews()

ilContainer::getUseNews ( )

Get use news.

Returns
bool use news system?

Definition at line 345 of file class.ilContainer.php.

Referenced by create(), isNewsTimelineEffective(), isNewsTimelineLandingPageEffective(), and update().

346  {
347  return $this->use_news;
348  }
+ Here is the caller graph for this function:

◆ getViewMode()

ilContainer::getViewMode ( )

Get container view mode.

Definition at line 741 of file class.ilContainer.php.

References VIEW_BY_TYPE.

Referenced by ilObjGroup\cloneObject(), ilObjGroup\create(), and ilObjGroup\update().

742  {
744  }
+ Here is the caller graph for this function:

◆ gotItems()

ilContainer::gotItems ( )

Check whether we got any items.

Definition at line 902 of file class.ilContainer.php.

903  {
904  if (is_array($this->items["_all"]) && count($this->items["_all"]) > 0)
905  {
906  return true;
907  }
908  return false;
909  }

◆ isNewsTimelineEffective()

ilContainer::isNewsTimelineEffective ( )

Is news timeline effective?

Returns
bool

Definition at line 277 of file class.ilContainer.php.

References getNewsTimeline(), and getUseNews().

278  {
279  if ($this->getUseNews())
280  {
281  if ($this->getNewsTimeline())
282  {
283  return true;
284  }
285  }
286  return false;
287  }
getNewsTimeline()
Get news timeline.
getUseNews()
Get use news.
+ Here is the call graph for this function:

◆ isNewsTimelineLandingPageEffective()

ilContainer::isNewsTimelineLandingPageEffective ( )

Is news timeline landing page effective?

Returns
bool

Definition at line 294 of file class.ilContainer.php.

References getNewsTimeline(), getNewsTimelineLandingPage(), and getUseNews().

295  {
296  if ($this->getUseNews())
297  {
298  if ($this->getNewsTimeline())
299  {
300  if ($this->getNewsTimelineLandingPage())
301  {
302  return true;
303  }
304  }
305  }
306  return false;
307  }
getNewsTimelineLandingPage()
Get news timline is landing page.
getNewsTimeline()
Get news timeline.
getUseNews()
Get use news.
+ Here is the call graph for this function:

◆ read()

ilContainer::read ( )

read

public

Parameters

Definition at line 1006 of file class.ilContainer.php.

References ilContainerSortingSettings\_lookupSortMode(), ilObject\getId(), ilObjStyleSheet\lookupObjectStyle(), readContainerSettings(), setOrderType(), and setStyleSheetId().

Referenced by ilObjOrgUnit\__construct().

1007  {
1008  parent::read();
1009 
1010  include_once("./Services/Container/classes/class.ilContainerSortingSettings.php");
1012 
1013  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1015 
1016  $this->readContainerSettings();
1017  }
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
static lookupObjectStyle($a_obj_id)
Lookup object style.
getId()
get object id public
readContainerSettings()
Read container settings.
setOrderType($a_value)
static _lookupSortMode($a_obj_id)
lookup sort mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readContainerSettings()

ilContainer::readContainerSettings ( )

Read container settings.

Parameters

Definition at line 1025 of file class.ilContainer.php.

References ilObject\getId(), ilObjectServiceSettingsGUI\NEWS_VISIBILITY, setNewsBlockActivated(), setNewsTimeline(), setNewsTimelineAutoEntries(), setNewsTimelineLandingPage(), setUseNews(), and ilObjectServiceSettingsGUI\USE_NEWS.

Referenced by read().

1026  {
1027  $this->setNewsTimeline(self::_lookupContainerSetting($this->getId(), "news_timeline"));
1028  $this->setNewsTimelineAutoEntries(self::_lookupContainerSetting($this->getId(), "news_timeline_incl_auto"));
1029  $this->setNewsTimelineLandingPage(self::_lookupContainerSetting($this->getId(), "news_timeline_landing_page"));
1030  include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
1031  $this->setNewsBlockActivated(self::_lookupContainerSetting($this->getId(), ilObjectServiceSettingsGUI::NEWS_VISIBILITY,
1032  $this->setting->get('block_activated_news',true)));
1033  $this->setUseNews(self::_lookupContainerSetting($this->getId(), ilObjectServiceSettingsGUI::USE_NEWS, true));
1034  }
setNewsTimelineAutoEntries($a_val)
Set news timeline auto entries.
setNewsBlockActivated($a_val)
Set news block activated.
setUseNews($a_val)
Set use news.
setNewsTimelineLandingPage($a_val)
Set news timline is landing page.
getId()
get object id public
setNewsTimeline($a_val)
Set news timeline.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeCustomIcon()

ilContainer::removeCustomIcon ( )

remove small icon

Definition at line 536 of file class.ilContainer.php.

References _writeContainerSetting(), getContainerDirectory(), and ilObject\getId().

Referenced by ilObjStudyProgramme\updateCustomIcon().

537  {
538  $cont_dir = $this->getContainerDirectory();
539  $small_file_name = $cont_dir."/icon_custom.svg";
540  @unlink($small_file_name);
541  ilContainer::_writeContainerSetting($this->getId(), "icon_custom", 0);
542  }
getContainerDirectory()
Get the container directory.
getId()
get object id public
static _writeContainerSetting($a_id, $a_keyword, $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveIcons()

ilContainer::saveIcons (   $a_custom_icon)

save container icons

Definition at line 509 of file class.ilContainer.php.

References $ilDB, _writeContainerSetting(), createContainerDirectory(), getContainerDirectory(), ilObject\getId(), and ilUtil\moveUploadedFile().

510  {
511  global $ilDB;
512 
513  $this->createContainerDirectory();
514  $cont_dir = $this->getContainerDirectory();
515 
516  $file_name = "";
517  if ($a_custom_icon != "")
518  {
519  $file_name = $cont_dir."/icon_custom.svg";
520  ilUtil::moveUploadedFile($a_custom_icon, "icon_custom.svg", $file_name);
521 
522  if ($file_name != "" && is_file($file_name))
523  {
524  ilContainer::_writeContainerSetting($this->getId(), "icon_custom", 1);
525  }
526  else
527  {
528  ilContainer::_writeContainerSetting($this->getId(), "icon_custom", 0);
529  }
530  }
531  }
getContainerDirectory()
Get the container directory.
getId()
get object id public
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
global $ilDB
static _writeContainerSetting($a_id, $a_keyword, $a_value)
createContainerDirectory()
Create directory for the container.
+ Here is the call graph for this function:

◆ setHiddenFilesFound()

ilContainer::setHiddenFilesFound (   $a_hiddenfilesfound)

Set Found hidden files (set by getSubItems).

Parameters
boolean$a_hiddenfilesfoundFound hidden files (set by getSubItems)

Definition at line 181 of file class.ilContainer.php.

Referenced by getSubItems().

182  {
183  $this->hiddenfilesfound = $a_hiddenfilesfound;
184  }
+ Here is the caller graph for this function:

◆ setNewsBlockActivated()

ilContainer::setNewsBlockActivated (   $a_val)

Set news block activated.

Parameters
bool$a_valnews block activated

Definition at line 315 of file class.ilContainer.php.

Referenced by readContainerSettings().

316  {
317  $this->news_block_activated = $a_val;
318  }
+ Here is the caller graph for this function:

◆ setNewsTimeline()

ilContainer::setNewsTimeline (   $a_val)

Set news timeline.

Parameters
bool$a_valactivate news timeline

Definition at line 217 of file class.ilContainer.php.

Referenced by readContainerSettings().

218  {
219  $this->news_timeline = $a_val;
220  }
+ Here is the caller graph for this function:

◆ setNewsTimelineAutoEntries()

ilContainer::setNewsTimelineAutoEntries (   $a_val)

Set news timeline auto entries.

Parameters
bool$a_valinclude automatically created entries

Definition at line 237 of file class.ilContainer.php.

Referenced by readContainerSettings().

238  {
239  $this->news_timeline_auto_entries = $a_val;
240  }
+ Here is the caller graph for this function:

◆ setNewsTimelineLandingPage()

ilContainer::setNewsTimelineLandingPage (   $a_val)

Set news timline is landing page.

Parameters
bool$a_valis news timline landing page?

Definition at line 257 of file class.ilContainer.php.

Referenced by readContainerSettings().

258  {
259  $this->news_timeline_landing_page = $a_val;
260  }
+ Here is the caller graph for this function:

◆ setOrderType()

ilContainer::setOrderType (   $a_value)

Definition at line 754 of file class.ilContainer.php.

Referenced by ilObjFolder\read(), ilObjCourse\read(), ilObjGroup\read(), and read().

755  {
756  $this->order_type = $a_value;
757  }
+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilContainer::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

Definition at line 207 of file class.ilContainer.php.

Referenced by read().

208  {
209  $this->style_id = $a_style_id;
210  }
+ Here is the caller graph for this function:

◆ setUseNews()

ilContainer::setUseNews (   $a_val)

Set use news.

Parameters
bool$a_valuse news system?

Definition at line 335 of file class.ilContainer.php.

Referenced by readContainerSettings().

336  {
337  $this->use_news = $a_val;
338  }
+ Here is the caller graph for this function:

◆ update()

ilContainer::update ( )

Update.

Definition at line 978 of file class.ilContainer.php.

References $log, $ret, ilObject\getId(), ilLoggerFactory\getLogger(), getNewsBlockActivated(), getNewsTimeline(), getNewsTimelineAutoEntries(), getNewsTimelineLandingPage(), getStyleSheetId(), getUseNews(), ilObjectServiceSettingsGUI\NEWS_VISIBILITY, ilObjectServiceSettingsGUI\USE_NEWS, and ilObjStyleSheet\writeStyleUsage().

979  {
980  $ret = parent::update();
981 
982  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
984 
986  $log->debug("Update Container, id: ".$this->getId());
987 
988  self::_writeContainerSetting($this->getId(), "news_timeline", (int) $this->getNewsTimeline());
989  self::_writeContainerSetting($this->getId(), "news_timeline_incl_auto", (int) $this->getNewsTimelineAutoEntries());
990  self::_writeContainerSetting($this->getId(), "news_timeline_landing_page", (int) $this->getNewsTimelineLandingPage());
991  include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
992  self::_writeContainerSetting($this->getId() ,ilObjectServiceSettingsGUI::NEWS_VISIBILITY,(int) $this->getNewsBlockActivated());
993  self::_writeContainerSetting($this->getId() ,ilObjectServiceSettingsGUI::USE_NEWS,(int) $this->getUseNews());
994 
995  return $ret;
996  }
getNewsTimelineLandingPage()
Get news timline is landing page.
getNewsTimelineAutoEntries()
Get news timeline auto entries.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getId()
get object id public
getStyleSheetId()
get ID of assigned style sheet object
getNewsTimeline()
Get news timeline.
getUseNews()
Get use news.
$ret
Definition: parser.php:6
static getLogger($a_component_id)
Get component logger.
getNewsBlockActivated()
Get news block activated.
+ Here is the call graph for this function:

Field Documentation

◆ $data_preloaded

ilContainer::$data_preloaded = false
static

Definition at line 75 of file class.ilContainer.php.

◆ $hiddenfilesfound

ilContainer::$hiddenfilesfound = false
protected

Definition at line 42 of file class.ilContainer.php.

Referenced by getHiddenFilesFound().

◆ $news_timeline

ilContainer::$news_timeline = false
protected

Definition at line 43 of file class.ilContainer.php.

Referenced by getNewsTimeline().

◆ $news_timeline_auto_entries

ilContainer::$news_timeline_auto_entries = false
protected

Definition at line 44 of file class.ilContainer.php.

Referenced by getNewsTimelineAutoEntries().

◆ $order_type

ilContainer::$order_type = 0
protected

Definition at line 41 of file class.ilContainer.php.

◆ $setting

ilContainer::$setting
protected

Definition at line 80 of file class.ilContainer.php.

◆ SORT_ACTIVATION

◆ SORT_CREATION

◆ SORT_DIRECTION_ASC

◆ SORT_DIRECTION_DESC

const ilContainer::SORT_DIRECTION_DESC = 1

◆ SORT_INHERIT

◆ SORT_MANUAL

◆ SORT_NEW_ITEMS_ORDER_ACTIVATION

◆ SORT_NEW_ITEMS_ORDER_CREATION

◆ SORT_NEW_ITEMS_ORDER_TITLE

◆ SORT_NEW_ITEMS_POSITION_BOTTOM

◆ SORT_NEW_ITEMS_POSITION_TOP

◆ SORT_TITLE

◆ VIEW_ARCHIVE

const ilContainer::VIEW_ARCHIVE = 3

Definition at line 50 of file class.ilContainer.php.

◆ VIEW_BY_TYPE

◆ VIEW_DEFAULT

const ilContainer::VIEW_DEFAULT = self::VIEW_BY_TYPE

Definition at line 55 of file class.ilContainer.php.

Referenced by ilObjGroup\getViewMode(), and ilObjGroup\translateViewMode().

◆ VIEW_INHERIT

const ilContainer::VIEW_INHERIT = 6

Definition at line 53 of file class.ilContainer.php.

Referenced by ilObjGroupGUI\initForm(), and ilObjGroup\translateViewMode().

◆ VIEW_OBJECTIVE

◆ VIEW_SESSIONS

◆ VIEW_SIMPLE

◆ VIEW_TIMING

const ilContainer::VIEW_TIMING = 2

The documentation for this class was generated from the following file: