ILIAS  release_8 Revision v8.23
ilCOPagePCDef Class Reference

COPage PC elements definition handler. More...

+ Collaboration diagram for ilCOPagePCDef:

Static Public Member Functions

static init ()
 
static getPCDefinitions ()
 
static getPCDefinitionByType (string $a_pc_type)
 Get PC definition by type. More...
 
static getPCDefinitionByName (string $a_pc_name)
 Get PC definition by name. More...
 
static getPCDefinitionByGUIClassName (string $a_gui_class_name)
 Get PC definition by name. More...
 
static isPCGUIClassName (string $a_class_name, bool $a_lower_case=false)
 
static getPCEditorInstanceByName (string $a_name)
 Get instance. More...
 

Static Public Attributes

static array $pc_def = []
 
static array $pc_def_by_name = []
 
static array $pc_gui_classes = array()
 
static array $pc_gui_classes_lc = array()
 
static array $pc_def_by_gui_class_cl = array()
 

Detailed Description

COPage PC elements definition handler.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ getPCDefinitionByGUIClassName()

static ilCOPagePCDef::getPCDefinitionByGUIClassName ( string  $a_gui_class_name)
static

Get PC definition by name.

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

Referenced by ilPageEditorGUI\executeCommand().

84  : array {
85  self::init();
86  $a_gui_class_name = strtolower($a_gui_class_name);
87  return self::$pc_def_by_gui_class_cl[$a_gui_class_name];
88  }
+ Here is the caller graph for this function:

◆ getPCDefinitionByName()

static ilCOPagePCDef::getPCDefinitionByName ( string  $a_pc_name)
static

Get PC definition by name.

Definition at line 72 of file class.ilCOPagePCDef.php.

Referenced by ilPageEditorGUI\executeCommand(), and ilPageObject\getContentObject().

74  : array {
75  self::init();
76  return self::$pc_def_by_name[$a_pc_name];
77  }
+ Here is the caller graph for this function:

◆ getPCDefinitionByType()

static ilCOPagePCDef::getPCDefinitionByType ( string  $a_pc_type)
static

Get PC definition by type.

Definition at line 63 of file class.ilCOPagePCDef.php.

Referenced by ilPageEditorGUI\executeCommand().

63  : ?array
64  {
65  self::init();
66  return (self::$pc_def[$a_pc_type] ?? null);
67  }
+ Here is the caller graph for this function:

◆ getPCDefinitions()

◆ getPCEditorInstanceByName()

static ilCOPagePCDef::getPCEditorInstanceByName ( string  $a_name)
static

Get instance.

Definition at line 104 of file class.ilCOPagePCDef.php.

Referenced by ILIAS\COPage\Editor\Components\Page\PageQueryActionHandler\componentEditFormResponse(), and ILIAS\COPage\Editor\Components\Page\PageQueryActionHandler\getComponentsEditorUI().

107  $pc_def = self::getPCDefinitionByName($a_name);
108  $pc_class = "ilPC" . $pc_def["name"] . "EditorGUI";
109  if (class_exists($pc_class)) {
110  return new $pc_class();
111  }
112  return null;
113  }
static array $pc_def
+ Here is the caller graph for this function:

◆ init()

static ilCOPagePCDef::init ( )
static

Definition at line 34 of file class.ilCOPagePCDef.php.

References $DIC.

34  : void
35  {
36  global $DIC;
37 
38  $db = $DIC->database();
39 
40  if (self::$pc_def == null) {
41  $set = $db->query("SELECT * FROM copg_pc_def ORDER BY order_nr");
42  while ($rec = $db->fetchAssoc($set)) {
43  $rec["pc_class"] = "ilPC" . $rec["name"];
44  $rec["pc_gui_class"] = "ilPC" . $rec["name"] . "GUI";
45  self::$pc_gui_classes[] = $rec["pc_gui_class"];
46  self::$pc_gui_classes_lc[] = strtolower($rec["pc_gui_class"]);
47  self::$pc_def[$rec["pc_type"]] = $rec;
48  self::$pc_def_by_name[$rec["name"]] = $rec;
49  self::$pc_def_by_gui_class_cl[strtolower($rec["pc_gui_class"])] = $rec;
50  }
51  }
52  }
global $DIC
Definition: feed.php:28

◆ isPCGUIClassName()

static ilCOPagePCDef::isPCGUIClassName ( string  $a_class_name,
bool  $a_lower_case = false 
)
static

Definition at line 90 of file class.ilCOPagePCDef.php.

Referenced by ilPageEditorGUI\executeCommand().

93  : bool {
94  if ($a_lower_case) {
95  return in_array($a_class_name, self::$pc_gui_classes_lc);
96  } else {
97  return in_array($a_class_name, self::$pc_gui_classes);
98  }
99  }
+ Here is the caller graph for this function:

Field Documentation

◆ $pc_def

array ilCOPagePCDef::$pc_def = []
static

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

◆ $pc_def_by_gui_class_cl

array ilCOPagePCDef::$pc_def_by_gui_class_cl = array()
static

Definition at line 32 of file class.ilCOPagePCDef.php.

◆ $pc_def_by_name

array ilCOPagePCDef::$pc_def_by_name = []
static

Definition at line 29 of file class.ilCOPagePCDef.php.

◆ $pc_gui_classes

array ilCOPagePCDef::$pc_gui_classes = array()
static

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

◆ $pc_gui_classes_lc

array ilCOPagePCDef::$pc_gui_classes_lc = array()
static

Definition at line 31 of file class.ilCOPagePCDef.php.


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