ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContainer Class Reference

Class ilContainer. More...

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

Public Member Functions

 ilContainer ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 _getContainerDirectory ($a_id)
 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...
 
 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...
 
 _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting. More...
 
 _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
 _lookupIconPath ($a_id, $a_size="big")
 lookup icon path More...
 
 saveIcons ($a_big_icon, $a_small_icon, $a_tiny_icon)
 save container icons More...
 
 removeBigIcon ()
 remove big icon More...
 
 removeSmallIcon ()
 remove small icon More...
 
 removeTinyIcon ()
 remove tiny icon More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 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)
 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...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 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 ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 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...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) 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...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object 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...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. 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...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Static Public Member Functions

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 _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id 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 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_ILINC = 7
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
- 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
 
 $obj_data_record
 object_data record More...
 

Static Public Attributes

static $data_preloaded = false
 

Protected Attributes

 $order_type = 0
 
 $hiddenfilesfound = false
 

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.

Member Function Documentation

◆ _getContainerDirectory()

ilContainer::_getContainerDirectory (   $a_id)

Get the container directory.

Returns
string container directory

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

References ilUtil\getWebspaceDir().

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

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

◆ _lookupContainerSetting()

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

Lookup a container setting.

Parameters
intcontainer id
stringsetting keyword
Returns
string setting value

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

References DB_FETCHMODE_ASSOC.

Referenced by ilObject\_getIcon(), _lookupIconPath(), ilContainerGUI\editPageContentObject(), ilContainerGUI\editPageFrameObject(), ilContainerGUI\forwardToPageObject(), ilContainerGUI\getContainerPageHTML(), ilObjCategoryListGUI\getInfoScreenStatus(), ilObject\hasAutoRating(), ilObjCategoryGUI\ilObjCategoryGUI(), ilObjRootFolderGUI\initEditForm(), ilObjectServiceSettingsGUI\initServiceSettingsForm(), ilContainerGUI\initStylePropertiesForm(), ilObjectListGUI\insertCommands(), ilColumnGUI\isGloballyActivated(), ilCalendarSettings\lookupCalendarActivated(), ilContainerGUI\savePageContentObject(), ilObjRootFolderGUI\setTitleAndDescription(), and ilContainerGUI\setTitleAndDescription().

192  {
193  global $ilDB;
194 
195  $q = "SELECT * FROM container_settings WHERE ".
196  " id = ".$ilDB->quote($a_id ,'integer')." AND ".
197  " keyword = ".$ilDB->quote($a_keyword ,'text');
198  $set = $ilDB->query($q);
199  $rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
200 
201  if(isset($rec['value']))
202  {
203  return $rec["value"];
204  }
205  if($a_default_value === NULL)
206  {
207  return '';
208  }
209  return $a_default_value;
210  }
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
+ Here is the caller graph for this function:

◆ _lookupIconPath()

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

lookup icon path

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

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

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

Referenced by ilPDSelectedItemsBlockGUI\addParentRow(), ilShopPurchaseGUI\addStandardRow(), ilContainerGUI\addStandardRow(), ilPDSelectedItemsBlockGUI\addStandardRow(), getBigIconPath(), getSmallIconPath(), getTinyIconPath(), ilUtil\getTypeIconPath(), and ilContainerGUI\setTitleAndDescription().

236  {
237  if ($a_size == "")
238  {
239  $a_size = "big";
240  }
241 
242  $size = $a_size;
243 
244  if (ilContainer::_lookupContainerSetting($a_id, "icon_".$size))
245  {
246  $cont_dir = ilContainer::_getContainerDirectory($a_id);
247 
248  // png version? (introduced with ILIAS 4.3)
249  $file_name = $cont_dir."/icon_".$a_size.".png";
250  if (is_file($file_name))
251  {
252  return $file_name;
253  }
254 
255  // gif version? (prior to ILIAS 4.3)
256  $file_name = $cont_dir."/icon_".$a_size.".gif";
257  if (is_file($file_name))
258  {
259  return $file_name;
260  }
261  }
262 
263  return "";
264  }
$size
Definition: RandomTest.php:79
_getContainerDirectory($a_id)
Get the container directory.
_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()

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

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

References $query, and $res.

Referenced by removeBigIcon(), removeSmallIcon(), removeTinyIcon(), saveIcons(), ilContainerGUI\savePageContentObject(), ilObjRootFolderGUI\updateObject(), ilObjectServiceSettingsGUI\updateServiceSettingsForm(), ilObjectServiceSettingsGUI\updateToolSettings(), and ilContainerGUI\useNewEditorObject().

213  {
214  global $ilDB;
215 
216  $query = "DELETE FROM container_settings WHERE ".
217  "id = ".$ilDB->quote($a_id,'integer')." ".
218  "AND keyword = ".$ilDB->quote($a_keyword,'text');
219  $res = $ilDB->manipulate($query);
220 
221  $query = "INSERT INTO container_settings (id, keyword, value) VALUES (".
222  $ilDB->quote($a_id ,'integer').", ".
223  $ilDB->quote($a_keyword ,'text').", ".
224  $ilDB->quote($a_value ,'text').
225  ")";
226  $res = $ilDB->manipulate($query);
227  }
+ 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 709 of file class.ilContainer.php.

Referenced by getSubItems().

710  {
711  }
+ 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 
)

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
Returns
new refid if clone has finished or parameter ref id if cloning is still in progress

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

References $client_id, $ilErr, $ilLog, $ilUser, $options, ilObject\$ref_id, $res, ilCopyWizardOptions\_allocateCopyId(), ilSession\_duplicate(), ilCopyWizardOptions\_getInstance(), ilCopyWizardOptions\_isFinished(), ilObject\_lookupObjId(), ilObject\_lookupType(), and ilSoapFunctions\ilClone().

462  {
463  global $ilLog;
464 
465  include_once('./Services/Link/classes/class.ilLink.php');
466  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
467 
468  global $ilAccess,$ilErr,$rbacsystem,$tree,$ilUser;
469 
470  // Save wizard options
472  $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
473  $wizard_options->saveOwner($ilUser->getId());
474  $wizard_options->saveRoot($clone_source);
475 
476  // add entry for source container
477  $wizard_options->initContainer($clone_source, $ref_id);
478 
479  foreach($options as $source_id => $option)
480  {
481  $wizard_options->addEntry($source_id,$option);
482  }
483  $wizard_options->read();
484  $wizard_options->storeTree($clone_source);
485 
486  // Special handling for course in existing courses
487  if($new_type == 'crs' and ilObject::_lookupType(ilObject::_lookupObjId($ref_id)) == 'crs')
488  {
489  $ilLog->write(__METHOD__.': Copy course in course...');
490  $ilLog->write(__METHOD__.': Added mapping, source ID: '.$clone_source.', target ID: '.$ref_id);
491  $wizard_options->read();
492  $wizard_options->dropFirstNode();
493  $wizard_options->appendMapping($clone_source,$ref_id);
494  }
495 
496  #print_r($options);
497  // Duplicate session to avoid logout problems with backgrounded SOAP calls
498  $new_session_id = ilSession::_duplicate($session_id);
499  // Start cloning process using soap call
500  include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
501 
502  $soap_client = new ilSoapClient();
503  $soap_client->setResponseTimeout(30);
504  $soap_client->enableWSDL(true);
505 
506  $ilLog->write(__METHOD__.': Trying to call Soap client...');
507  if($soap_client->init())
508  {
509  $ilLog->write(__METHOD__.': Calling soap clone method...');
510  $res = $soap_client->call('ilClone',array($new_session_id.'::'.$client_id, $copy_id));
511  }
512  else
513  {
514  $ilLog->write(__METHOD__.': SOAP call failed. Calling clone method manually. ');
515  $wizard_options->disableSOAP();
516  $wizard_options->read();
517  include_once('./webservice/soap/include/inc.soap_functions.php');
518  $res = ilSoapFunctions::ilClone($new_session_id.'::'.$client_id, $copy_id);
519  }
520  // Check if copy is in progress or if this has been called by soap (don't wait for finishing)
521  if($soap_call || ilCopyWizardOptions::_isFinished($copy_id))
522  {
523  return $res;
524  }
525  else
526  {
527  return $ref_id;
528  }
529  }
static ilClone($sid, $copy_identifier)
static _isFinished($a_copy_id)
check if copy is finished
static _getInstance($a_copy_id)
Get instance of copy wizard options.
if(!is_array($argv)) $options
static _lookupObjId($a_id)
static _allocateCopyId()
Allocate a copy for further entries.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _duplicate($a_session_id)
Duplicate session.
global $ilUser
Definition: imgupload.php:15
$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 426 of file class.ilContainer.php.

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

427  {
428  global $ilLog;
429 
430  parent::cloneDependencies($a_target_id, $a_copy_id);
431 
432  include_once('./Services/Container/classes/class.ilContainerSorting.php');
433  ilContainerSorting::_getInstance($this->getId())->cloneSorting($a_target_id,$a_copy_id);
434 
435  // fix item group references in page content
436  include_once("./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
438 
439  include_once('Services/Object/classes/class.ilObjectLP.php');
440  $olp = ilObjectLP::getInstance($this->getId());
441  $collection = $olp->getCollectionInstance();
442  if($collection)
443  {
444  $collection->cloneCollection($a_target_id, $a_copy_id);
445  }
446 
447  return true;
448  }
getId()
get object id public
static fixContainerItemGroupRefsAfterCloning($a_source_container, $a_copy_id)
Fix container item group references after a container has been cloned.
static _getInstance($a_obj_id)
get instance by obj_id
static getInstance($a_obj_id)
+ Here is the call graph for this function:

◆ cloneObject()

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

Clone container settings.

public

Parameters
inttarget ref_id
intcopy id
Returns
object new object

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

References $ilLog, ilPageObject\_exists(), ilObject\getId(), getOrderType(), and ilContainerSortingSettings\setSortMode().

379  {
380  global $ilLog;
381 
382  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
383 
384  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
385  $sorting = new ilContainerSortingSettings($new_obj->getId());
386  $sorting->setSortMode($this->getOrderType());
387  $sorting->update();
388 
389  // copy content page
390 // $ilLog->write("copy container, lookup page");
391  include_once("./Services/Container/classes/class.ilContainerPage.php");
392  if (ilContainerPage::_exists("cont",
393  $this->getId()))
394  {
395  //$ilLog->write("...page found");
396  $orig_page = new ilContainerPage($this->getId());
397  $orig_page->copy($new_obj->getId(), "cont", $new_obj->getId());
398  /*$new_page_object = new ilContainerPage();
399  $new_page_object->setParentId($new_obj->getId());
400  $new_page_object->setId($new_obj->getId());
401  $new_page_object->createFromXML();
402  $new_page_object->setXMLContent($orig_page->getXMLContent());
403  $new_page_object->buildDom(true);
404  $new_page_object->update();*/
405 
406  //$ilLog->write("...copy ml");
407 
408  // copy (page) multilang settings
409  /*include_once("./Services/COPage/classes/class.ilPageMultiLang.php");
410  $ml = new ilPageMultiLang("cont", $this->getId());
411  $ml->copy("cont", $new_obj->getId());*/
412 
413  }
414 
415  return $new_obj;
416  }
getOrderType()
Get order type default implementation.
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getId()
get object id public
Container page object.
+ Here is the call graph for this function:

◆ create()

ilContainer::create ( )

Create.

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

References $ret, ilObject\getId(), getStyleSheetId(), and ilObjStyleSheet\writeStyleUsage().

747  {
748  $ret = parent::create();
749 
750  if (((int) $this->getStyleSheetId()) > 0)
751  {
752  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
754  }
755 
756  return $ret;
757  }
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getId()
get object id public
getStyleSheetId()
get ID of assigned style sheet object
+ 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 81 of file class.ilContainer.php.

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

Referenced by saveIcons().

82  {
83  $webspace_dir = ilUtil::getWebspaceDir();
84  $cont_dir = $webspace_dir."/container_data";
85  if (!is_dir($cont_dir))
86  {
87  ilUtil::makeDir($cont_dir);
88  }
89  $obj_dir = $cont_dir."/obj_".$this->getId();
90  if (!is_dir($obj_dir))
91  {
92  ilUtil::makeDir($obj_dir);
93  }
94  }
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 ...
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 732 of file class.ilContainer.php.

References $ilSetting.

733  {
734  global $ilSetting;
735 
736  // @todo: this will need a more general approach
737  if ($ilSetting->get("enable_cat_page_edit"))
738  {
739  return true;
740  }
741  }
global $ilSetting
Definition: privfeed.php:40

◆ getBigIconPath()

ilContainer::getBigIconPath ( )

Get path for big icon.

Returns
string icon path

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

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

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

122  {
123  return ilContainer::_lookupIconPath($this->getId(), "big");
124  }
_lookupIconPath($a_id, $a_size="big")
lookup icon path
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 798 of file class.ilContainer.php.

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

Referenced by ilContainerContentGUI\renderItem().

799  {
800  global $ilSetting, $ilObjDataCache;
801  // using long descriptions?
802  $short_desc = $ilSetting->get("rep_shorten_description");
803  $short_desc_max_length = $ilSetting->get("rep_shorten_description_length");
804  if(!$short_desc || $short_desc_max_length != ilObject::DESC_LENGTH)
805  {
806  // using (part of) shortened description
807  if($short_desc && $short_desc_max_length && $short_desc_max_length < ilObject::DESC_LENGTH)
808  {
809  foreach($objects as $key => $object)
810  {
811  $objects[$key]["description"] = ilUtil::shortenText($object["description"], $short_desc_max_length, true);
812  }
813  }
814  // using (part of) long description
815  else
816  {
817  $obj_ids = array();
818  foreach($objects as $key => $object)
819  {
820  $obj_ids[] = $object["obj_id"];
821  }
822  if(sizeof($obj_ids))
823  {
825  foreach($objects as $key => $object)
826  {
827  // #12166 - keep translation, ignore long description
828  if($ilObjDataCache->isTranslatedDescription($object["obj_id"]))
829  {
830  $long_desc[$object["obj_id"]] = $object["description"];
831  }
832  if($short_desc && $short_desc_max_length)
833  {
834  $long_desc[$object["obj_id"]] = ilUtil::shortenText($long_desc[$object["obj_id"]], $short_desc_max_length, true);
835  }
836  $objects[$key]["description"] = $long_desc[$object["obj_id"]];
837  }
838  }
839  }
840  }
841  return $objects;
842  }
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.
global $ilSetting
Definition: privfeed.php:40
+ 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 101 of file class.ilContainer.php.

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

Referenced by removeBigIcon(), removeSmallIcon(), removeTinyIcon(), and saveIcons().

102  {
103  return $this->_getContainerDirectory($this->getId());
104  }
_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:

◆ getGroupedObjTypes()

ilContainer::getGroupedObjTypes ( )

Get grouped repository object types.

Returns
array array of object types

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

References ilObject\getType().

Referenced by getSubItems().

719  {
720  global $objDefinition;
721 
722  if (empty($this->type_grps))
723  {
724  $this->type_grps = $objDefinition->getGroupedRepositoryObjectTypes($this->getType());
725  }
726  return $this->type_grps;
727  }
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 162 of file class.ilContainer.php.

References $hiddenfilesfound.

163  {
165  }

◆ getOrderType()

ilContainer::getOrderType ( )

Get order type default implementation.

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

References SORT_TITLE.

Referenced by cloneObject(), ilObjCourse\cloneSettings(), and ilObjCourse\update().

543  {
544  return $this->order_type ? $this->order_type : ilContainer::SORT_TITLE;
545  }
+ Here is the caller graph for this function:

◆ getSmallIconPath()

ilContainer::getSmallIconPath ( )

Get path for small icon.

Returns
string icon path

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

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

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

132  {
133  return ilContainer::_lookupIconPath($this->getId(), "small");
134  }
_lookupIconPath($a_id, $a_size="big")
lookup icon path
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 170 of file class.ilContainer.php.

Referenced by create(), and update().

171  {
172  return $this->style_id;
173  }
+ 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 560 of file class.ilContainer.php.

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

562  {
563  global $objDefinition, $ilBench, $tree, $ilObjDataCache, $ilUser, $rbacsystem,
564  $ilSetting;
565 
566  // Caching
567  if (is_array($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block]) &&
568  !$a_get_single)
569  {
570  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
571  }
572 
573  $type_grps = $this->getGroupedObjTypes();
574  $objects = $tree->getChilds($this->getRefId(), "title");
575 
576  $objects = self::getCompleteDescriptions($objects);
577 
578  $found = false;
579  $all_ref_ids = array();
580 
581  if(!self::$data_preloaded)
582  {
583  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
585  }
586 
587  include_once('Services/Container/classes/class.ilContainerSorting.php');
588  $sort = ilContainerSorting::_getInstance($this->getId());
589 
590  // TODO: check this
591  // get items attached to a session
592  include_once './Modules/Session/classes/class.ilEventItems.php';
593  $event_items = ilEventItems::_getItemsOfContainer($this->getRefId());
594 
595  foreach ($objects as $key => $object)
596  {
597  if ($a_get_single > 0 && $object["child"] != $a_get_single)
598  {
599  continue;
600  }
601 
602  // hide object types in devmode
603  if ($objDefinition->getDevMode($object["type"]) || $object["type"] == "adm"
604  || $object["type"] == "rolf")
605  {
606  continue;
607  }
608 
609  // remove inactive plugins
610  if ($objDefinition->isInactivePlugin($object["type"]))
611  {
612  continue;
613  }
614 
615  // BEGIN WebDAV: Don't display hidden Files, Folders and Categories
616  if (in_array($object['type'], array('file','fold','cat')))
617  {
618  include_once 'Modules/File/classes/class.ilObjFileAccess.php';
619  if (ilObjFileAccess::_isFileHidden($object['title']))
620  {
621  $this->setHiddenFilesFound(true);
622  if (!$a_admin_panel_enabled)
623  {
624  continue;
625  }
626  }
627  }
628  // END WebDAV: Don't display hidden Files, Folders and Categories
629 
630  // including event items!
631  if (!self::$data_preloaded)
632  {
633  $preloader->addItem($object["obj_id"], $object["type"], $object["child"]);
634  }
635 
636  // filter out items that are attached to an event
637  if (in_array($object['ref_id'],$event_items))
638  {
639  continue;
640  }
641 
642  // filter side block items
643  if(!$a_include_side_block && $objDefinition->isSideBlock($object['type']))
644  {
645  continue;
646  }
647 
648  $all_ref_ids[] = $object["child"];
649  }
650 
651  // data preloader
652  if (!self::$data_preloaded)
653  {
654  $preloader->preload();
655  unset($preloader);
656 
657  self::$data_preloaded = true;
658  }
659 
660  foreach($objects as $key => $object)
661  {
662  // see above, objects were filtered
663  if(!in_array($object["child"], $all_ref_ids))
664  {
665  continue;
666  }
667 
668  // group object type groups together (e.g. learning resources)
669  $type = $objDefinition->getGroupOfObj($object["type"]);
670  if ($type == "")
671  {
672  $type = $object["type"];
673  }
674 
675  // this will add activation properties
676  $this->addAdditionalSubItemInformation($object);
677 
678  $this->items[$type][$key] = $object;
679 
680  $this->items["_all"][$key] = $object;
681  if ($object["type"] != "sess")
682  {
683  $this->items["_non_sess"][$key] = $object;
684  }
685  }
686 
687  $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block]
688  = $sort->sortItems($this->items);
689 
690  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
691  }
static _isFileHidden($a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user. ...
_getItemsOfContainer($a_ref_id)
setHiddenFilesFound($a_hiddenfilesfound)
Set Found hidden files (set by getSubItems).
Preloader for object list GUIs.
getId()
get object id public
global $ilUser
Definition: imgupload.php:15
addAdditionalSubItemInformation(&$object)
Add additional information to sub item, e.g.
global $ilSetting
Definition: privfeed.php:40
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

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

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

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

142  {
143  return ilContainer::_lookupIconPath($this->getId(), "tiny");
144  }
_lookupIconPath($a_id, $a_size="big")
lookup icon path
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewMode()

ilContainer::getViewMode ( )

Get container view mode.

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

References VIEW_BY_TYPE.

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

535  {
537  }
+ Here is the caller graph for this function:

◆ gotItems()

ilContainer::gotItems ( )

Check whether we got any items.

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

697  {
698  if (is_array($this->items["_all"]) && count($this->items["_all"]) > 0)
699  {
700  return true;
701  }
702  return false;
703  }

◆ ilContainer()

ilContainer::ilContainer (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

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

Referenced by ilObjOrgUnit\__construct(), and ilObjCategory\ilObjCategory().

71  {
72  parent::__construct($a_id, $a_call_by_reference);
73  }
+ Here is the caller graph for this function:

◆ read()

ilContainer::read ( )

read

public

Parameters

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

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

781  {
782  parent::read();
783 
784  include_once("./Services/Container/classes/class.ilContainerSortingSettings.php");
786 
787  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
789  }
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
static lookupObjectStyle($a_obj_id)
Lookup object style.
getId()
get object id public
setOrderType($a_value)
static _lookupSortMode($a_obj_id)
lookup sort mode
+ Here is the call graph for this function:

◆ removeBigIcon()

ilContainer::removeBigIcon ( )

remove big icon

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

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

341  {
342  $cont_dir = $this->getContainerDirectory();
343  $big_file_name = $cont_dir."/icon_big.png";
344  @unlink($big_file_name);
345  ilContainer::_writeContainerSetting($this->getId(), "icon_big", 0);
346  }
_writeContainerSetting($a_id, $a_keyword, $a_value)
getContainerDirectory()
Get the container directory.
getId()
get object id public
+ Here is the call graph for this function:

◆ removeSmallIcon()

ilContainer::removeSmallIcon ( )

remove small icon

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

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

352  {
353  $cont_dir = $this->getContainerDirectory();
354  $small_file_name = $cont_dir."/icon_small.png";
355  @unlink($small_file_name);
356  ilContainer::_writeContainerSetting($this->getId(), "icon_small", 0);
357  }
_writeContainerSetting($a_id, $a_keyword, $a_value)
getContainerDirectory()
Get the container directory.
getId()
get object id public
+ Here is the call graph for this function:

◆ removeTinyIcon()

ilContainer::removeTinyIcon ( )

remove tiny icon

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

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

363  {
364  $cont_dir = $this->getContainerDirectory();
365  $tiny_file_name = $cont_dir."/icon_tiny.png";
366  @unlink($tiny_file_name);
367  ilContainer::_writeContainerSetting($this->getId(), "icon_tiny", 0);
368  }
_writeContainerSetting($a_id, $a_keyword, $a_value)
getContainerDirectory()
Get the container directory.
getId()
get object id public
+ Here is the call graph for this function:

◆ saveIcons()

ilContainer::saveIcons (   $a_big_icon,
  $a_small_icon,
  $a_tiny_icon 
)

save container icons

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

References _writeContainerSetting(), createContainerDirectory(), ilUtil\escapeShellArg(), ilUtil\execConvert(), getContainerDirectory(), and ilObject\getId().

270  {
271  global $ilDB;
272 
273  $this->createContainerDirectory();
274  $cont_dir = $this->getContainerDirectory();
275 
276  // save big icon
277  $big_geom = $this->ilias->getSetting("custom_icon_big_width")."x".
278  $this->ilias->getSetting("custom_icon_big_height");
279  $big_file_name = $cont_dir."/icon_big.png";
280 
281  if (is_file($a_big_icon))
282  {
283  $a_big_icon = ilUtil::escapeShellArg($a_big_icon);
284  $big_file_name = ilUtil::escapeShellArg($big_file_name);
285  ilUtil::execConvert($a_big_icon."[0] -geometry ".$big_geom." PNG:".$big_file_name);
286  }
287  if (is_file($cont_dir."/icon_big.png"))
288  {
289  ilContainer::_writeContainerSetting($this->getId(), "icon_big", 1);
290  }
291  else
292  {
293  ilContainer::_writeContainerSetting($this->getId(), "icon_big", 0);
294  }
295  // save small icon
296  $small_geom = $this->ilias->getSetting("custom_icon_small_width")."x".
297  $this->ilias->getSetting("custom_icon_small_height");
298  $small_file_name = $cont_dir."/icon_small.png";
299 
300  if (is_file($a_small_icon))
301  {
302  $a_small_icon = ilUtil::escapeShellArg($a_small_icon);
303  $small_file_name = ilUtil::escapeShellArg($small_file_name);
304  ilUtil::execConvert($a_small_icon."[0] -geometry ".$small_geom." PNG:".$small_file_name);
305  }
306  if (is_file($cont_dir."/icon_small.png"))
307  {
308  ilContainer::_writeContainerSetting($this->getId(), "icon_small", 1);
309  }
310  else
311  {
312  ilContainer::_writeContainerSetting($this->getId(), "icon_small", 0);
313  }
314 
315  // save tiny icon
316  $tiny_geom = $this->ilias->getSetting("custom_icon_tiny_width")."x".
317  $this->ilias->getSetting("custom_icon_tiny_height");
318  $tiny_file_name = $cont_dir."/icon_tiny.png";
319 
320  if (is_file($a_tiny_icon))
321  {
322  $a_tiny_icon = ilUtil::escapeShellArg($a_tiny_icon);
323  $tiny_file_name = ilUtil::escapeShellArg($tiny_file_name);
324  ilUtil::execConvert($a_tiny_icon."[0] -geometry ".$tiny_geom." PNG:".$tiny_file_name);
325  }
326  if (is_file($cont_dir."/icon_tiny.png"))
327  {
328  ilContainer::_writeContainerSetting($this->getId(), "icon_tiny", 1);
329  }
330  else
331  {
332  ilContainer::_writeContainerSetting($this->getId(), "icon_tiny", 0);
333  }
334 
335  }
_writeContainerSetting($a_id, $a_keyword, $a_value)
getContainerDirectory()
Get the container directory.
static execConvert($args)
execute convert command
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
static escapeShellArg($a_arg)
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 152 of file class.ilContainer.php.

Referenced by getSubItems().

153  {
154  $this->hiddenfilesfound = $a_hiddenfilesfound;
155  }
+ Here is the caller graph for this function:

◆ setOrderType()

ilContainer::setOrderType (   $a_value)

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

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

548  {
549  $this->order_type = $a_value;
550  }
+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilContainer::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

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

Referenced by read().

179  {
180  $this->style_id = $a_style_id;
181  }
+ Here is the caller graph for this function:

◆ update()

ilContainer::update ( )

Update.

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

References $ret, ilObject\getId(), getStyleSheetId(), and ilObjStyleSheet\writeStyleUsage().

763  {
764  $ret = parent::update();
765 
766  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
768 
769  return $ret;
770  }
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getId()
get object id public
getStyleSheetId()
get ID of assigned style sheet object
+ Here is the call graph for this function:

Field Documentation

◆ $data_preloaded

ilContainer::$data_preloaded = false
static

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

◆ $hiddenfilesfound

ilContainer::$hiddenfilesfound = false
protected

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

Referenced by getHiddenFilesFound().

◆ $order_type

ilContainer::$order_type = 0
protected

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

◆ SORT_ACTIVATION

◆ SORT_INHERIT

◆ SORT_MANUAL

◆ SORT_TITLE

◆ VIEW_ARCHIVE

const ilContainer::VIEW_ARCHIVE = 3

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

◆ VIEW_BY_TYPE

◆ VIEW_DEFAULT

const ilContainer::VIEW_DEFAULT = self::VIEW_BY_TYPE

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

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

◆ VIEW_ILINC

const ilContainer::VIEW_ILINC = 7

◆ VIEW_INHERIT

const ilContainer::VIEW_INHERIT = 6

◆ VIEW_OBJECTIVE

const ilContainer::VIEW_OBJECTIVE = 1

◆ VIEW_SESSIONS

◆ VIEW_SIMPLE

◆ VIEW_TIMING

const ilContainer::VIEW_TIMING = 2

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