ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDclFieldTypePlugin Class Reference
+ Inheritance diagram for ilDclFieldTypePlugin:
+ Collaboration diagram for ilDclFieldTypePlugin:

Public Member Functions

 install ()
 
 getStorageLocation ()
 
- Public Member Functions inherited from ilPlugin
 getMessage ()
 
 __construct (\ilDBInterface $db, \ilComponentRepositoryWrite $component_repository, string $id)
 
 getPluginName ()
 
 getId ()
 
 getVersion ()
 Only very little classes seem to care about this: More...
 
 getDirectory ()
 Only very little classes seem to care about this: More...
 
 isActive ()
 Only very little classes seem to care about this: More...
 
 needsUpdate ()
 
 install ()
 
 uninstall ()
 
 activate ()
 This will update (if required) and activate the plugin. More...
 
 deactivate ()
 
 update ()
 
 loadLanguageModule ()
 Load language module for plugin. More...
 
 txt (string $a_var)
 Get Language Variable (prefix will be prepended automatically) More...
 
 getTemplate (string $a_template, bool $a_par1=true, bool $a_par2=true)
 ILIAS is moving towards UI components and plugins are expected to use these components. More...
 
 getStyleSheetLocation (string $a_css_file)
 ILIAS is moving towards UI components and plugins are expected to use these components. More...
 
 addBlockFile ($a_tpl, $a_var, $a_block, $a_tplname)
 ILIAS is moving towards UI components and plugins are expected to use these components. More...
 
 getGlobalScreenProviderCollection ()
 
 exchangeUIRendererAfterInitialization (\ILIAS\DI\Container $dic)
 This methods allows to replace the UI Renderer (see src/UI) of ILIAS after initialization by returning a closure returning a custom renderer. More...
 
 exchangeUIFactoryAfterInitialization (string $dic_key, \ILIAS\DI\Container $dic)
 This methods allows to replace some factory for UI Components (see src/UI) of ILIAS after initialization by returning a closure returning a custom factory. More...
 

Static Public Member Functions

static getDataType (string $plugin_id)
 
static getPluginId (string $datatype)
 
static isPluginDatatype (string $datatype)
 

Data Fields

const DB_TYPES = ['text', 'text', 'integer', 'date']
 
const COMPONENT_NAME = "DataCollection"
 
const SLOT_ID = "dclfth"
 
const PLUGIN_SLOT_PREFIX = 'plugin_fth_'
 

Additional Inherited Members

- Protected Member Functions inherited from ilPlugin
 init ()
 Object initialization. More...
 
 getPluginInfo ()
 
 getComponentInfo ()
 
 getPluginSlotInfo ()
 
 afterInstall ()
 If you cannot get rid of the requirement to use this, adjust the install method in your subclass instead. More...
 
 beforeUninstall ()
 If you cannot get rid of the requirement to use this, adjust the uninstall method in your subclass instead. More...
 
 afterUninstall ()
 If you cannot get rid of the requirement to use this, adjust the uninstall method in your subclass instead. More...
 
 beforeActivation ()
 If you cannot get rid of the requirement to use this, adjust the activate method in your subclass instead. More...
 
 afterActivation ()
 If you cannot get rid of the requirement to use this, adjust the activate method in your subclass instead. More...
 
 afterDeactivation ()
 If you cannot get rid of the requirement to use this, adjust the activate method in your subclass instead. More...
 
 updateDatabase ()
 
 beforeUpdate ()
 If you cannot get rid of the requirement to use this, adjust the update method in your subclass instead. More...
 
 afterUpdate ()
 
 getLanguageHandler ()
 
 buildLanguageHandler ()
 
- Protected Attributes inherited from ilPlugin
ilDBInterface $db
 
ilComponentRepositoryWrite $component_repository
 
string $id
 
ilPluginLanguage $language_handler = null
 
bool $lang_initialised = false
 
ProviderCollection $provider_collection
 
string $message = ''
 

Detailed Description

Definition at line 21 of file class.ilDclFieldTypePlugin.php.

Member Function Documentation

◆ getDataType()

static ilDclFieldTypePlugin::getDataType ( string  $plugin_id)
static

Definition at line 61 of file class.ilDclFieldTypePlugin.php.

Referenced by ilDataCollectionDBUpdateSteps9\step_16().

61  : string
62  {
63  return self::PLUGIN_SLOT_PREFIX . $plugin_id;
64  }
+ Here is the caller graph for this function:

◆ getPluginId()

static ilDclFieldTypePlugin::getPluginId ( string  $datatype)
static

Definition at line 66 of file class.ilDclFieldTypePlugin.php.

Referenced by ilDclDatatype\getAllDatatype(), ilDclFieldFactory\getClassPathByInstance(), ilDclFieldFactory\getFieldTypeByInstance(), ilDclPluginFieldModel\getPresentationDescription(), and ilDclPluginFieldModel\getPresentationTitle().

66  : string
67  {
68  if (self::isPluginDatatype($datatype)) {
69  return substr($datatype, strlen(self::PLUGIN_SLOT_PREFIX));
70  }
71  throw new ilPluginException('Invalid datatype prefix for FieldTypHook-plugin');
72  }
+ Here is the caller graph for this function:

◆ getStorageLocation()

ilDclFieldTypePlugin::getStorageLocation ( )

Definition at line 56 of file class.ilDclFieldTypePlugin.php.

Referenced by install().

56  : int
57  {
58  return 1;
59  }
+ Here is the caller graph for this function:

◆ install()

ilDclFieldTypePlugin::install ( )

Definition at line 28 of file class.ilDclFieldTypePlugin.php.

References ilDclDatatype\getAllDatatype(), ilPlugin\getId(), ilPlugin\getPluginName(), getStorageLocation(), PLUGIN_SLOT_PREFIX, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

28  : void
29  {
30  $field_type_name = ilDclFieldTypePlugin::PLUGIN_SLOT_PREFIX . $this->getId();
31  $datatypes = ilDclDatatype::getAllDatatype(true);
32  foreach ($datatypes as $datatype) {
33  if ($datatype->getTitle() === $field_type_name) {
34  parent::install();
35  return;
36  }
37  }
38 
39  $field_model_class = 'il' . $this->getPluginName() . 'FieldModel';
40  $type = (new $field_model_class())->getStorageLocationOverride() ?? $this->getStorageLocation();
41  $this->db->manipulateF(
42  'INSERT INTO il_dcl_datatype (id, title, ildb_type, storage_location, sort) SELECT GREATEST(MAX(id), 1000) + 1, %s, %s, %s, GREATEST(MAX(sort), 10000) + 10 FROM il_dcl_datatype;',
43  [
47  ],
48  [
49  $field_type_name,
50  $this::DB_TYPES[$type],
51  $type
52  ]
53  );
54  }
static getAllDatatype(bool $force=false)
Get all possible Datatypes.
+ Here is the call graph for this function:

◆ isPluginDatatype()

static ilDclFieldTypePlugin::isPluginDatatype ( string  $datatype)
static

Definition at line 74 of file class.ilDclFieldTypePlugin.php.

Referenced by ilDclDatatype\getAllDatatype(), ilDclFieldFactory\getClassPathByInstance(), ilDclFieldFactory\getFieldTypeByInstance(), and ilDataCollectionDataSet\getXmlNamespace().

74  : bool
75  {
76  return substr($datatype, 0, strlen(self::PLUGIN_SLOT_PREFIX)) === self::PLUGIN_SLOT_PREFIX;
77  }
+ Here is the caller graph for this function:

Field Documentation

◆ COMPONENT_NAME

const ilDclFieldTypePlugin::COMPONENT_NAME = "DataCollection"

Definition at line 24 of file class.ilDclFieldTypePlugin.php.

◆ DB_TYPES

const ilDclFieldTypePlugin::DB_TYPES = ['text', 'text', 'integer', 'date']

◆ PLUGIN_SLOT_PREFIX

const ilDclFieldTypePlugin::PLUGIN_SLOT_PREFIX = 'plugin_fth_'

Definition at line 26 of file class.ilDclFieldTypePlugin.php.

Referenced by install().

◆ SLOT_ID

const ilDclFieldTypePlugin::SLOT_ID = "dclfth"

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