ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjectCustomIconFactory Class Reference

Class ilObjectCustomIconFactory. More...

+ Collaboration diagram for ilObjectCustomIconFactory:

Public Member Functions

 __construct (\ILIAS\Filesystem\Filesystem $webDirectory, \ILIAS\FileUpload\FileUpload $uploadService, \ilObjectDataCache $objectCache)
 ilObjectCustomIconFactory constructor. More...
 
 getConfigurationByType (string $type)
 
 getByObjId (int $objId, string $objType='')
 
 getPresenterByObjId (int $objId, string $objType)
 Get custom icon presenter. More...
 

Protected Attributes

 $webDirectory
 
 $uploadService
 
 $objectCache
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjectCustomIconFactory::__construct ( \ILIAS\Filesystem\Filesystem  $webDirectory,
\ILIAS\FileUpload\FileUpload  $uploadService,
\ilObjectDataCache  $objectCache 
)

ilObjectCustomIconFactory constructor.

Parameters
\ILIAS\Filesystem\Filesystem$webDirectory
\ILIAS\FileUpload\FileUpload$uploadService

Definition at line 30 of file class.ilObjectCustomIconFactory.php.

References $objectCache, $uploadService, and $webDirectory.

Member Function Documentation

◆ getByObjId()

ilObjectCustomIconFactory::getByObjId ( int  $objId,
string  $objType = '' 
)
Parameters
int$objIdThe obj_id of the ILIAS object.
string$objTypeAn optional type of the ILIAS object. If not passed, the type will be determined automatically.
Returns
\ilObjectCustomIcon

Definition at line 71 of file class.ilObjectCustomIconFactory.php.

72 {
73 if (0 === strlen($objType)) {
74 $objType = (string) $this->objectCache->lookupType($objId);
75 }
76
77 require_once 'Services/Object/Icon/classes/class.ilObjectCustomIconImpl.php';
78 return new \ilObjectCustomIconImpl(
79 $this->webDirectory,
80 $this->uploadService,
81 $this->getConfigurationByType($objType),
82 $objId
83 );
84 }
Interface ilObjectCustomIcon.
$objId
Definition: xapitoken.php:39

References $objId, and getConfigurationByType().

Referenced by getPresenterByObjId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getConfigurationByType()

ilObjectCustomIconFactory::getConfigurationByType ( string  $type)

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

45 {
46 switch ($type) {
47 case 'grp':
48 case 'root':
49 case 'cat':
50 case 'fold':
51 case 'crs':
52 case 'prg':
53 require_once 'Services/Object/Icon/classes/class.ilContainerCustomIconConfiguration.php';
54 $configuration = new \ilContainerCustomIconConfiguration();
55 break;
56
57 default:
58 require_once 'Services/Object/Icon/classes/class.ilObjectCustomIconConfiguration.php';
59 $configuration = new \ilObjectCustomIconConfiguration();
60 break;
61 }
62
63 return $configuration;
64 }
$type

References $type.

Referenced by getByObjId().

+ Here is the caller graph for this function:

◆ getPresenterByObjId()

ilObjectCustomIconFactory::getPresenterByObjId ( int  $objId,
string  $objType 
)

Get custom icon presenter.

Parameters
int$objId
string$objType
Returns
\ilObjectCustomIconPresenter

Definition at line 94 of file class.ilObjectCustomIconFactory.php.

95 {
96 if (0 === strlen($objType)) {
97 $objType = $this->objectCache->lookupType($objId);
98 }
99
100 $presenter = null;
101 switch ($objType) {
102 case 'catr':
103 case 'grpr':
104 case 'crsr':
105 $presenter = new \ilObjectReferenceCustomIconPresenter($objId, $this);
106 $presenter->init();
107 break;
108
109 default:
110 $presenter = new \ilObjectCustomIconPresenterImpl($this->getByObjId((int) $objId, (string) $objType));
111 break;
112
113 }
114 return $presenter;
115 }
getByObjId(int $objId, string $objType='')

References $objId, and getByObjId().

+ Here is the call graph for this function:

Field Documentation

◆ $objectCache

ilObjectCustomIconFactory::$objectCache
protected

Definition at line 22 of file class.ilObjectCustomIconFactory.php.

Referenced by __construct().

◆ $uploadService

ilObjectCustomIconFactory::$uploadService
protected

Definition at line 17 of file class.ilObjectCustomIconFactory.php.

Referenced by __construct().

◆ $webDirectory

ilObjectCustomIconFactory::$webDirectory
protected

Definition at line 12 of file class.ilObjectCustomIconFactory.php.

Referenced by __construct().


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