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

Public Member Functions

 __construct (protected ilDBInterface $db)
 
 purge ()
 This methods is supposed to purge existing data in the provider of the component, so new components can be added to a clean slate. More...
 
 beginComponent (string $component, string $type)
 This method is called when parsing of component.xml for the given component starts. More...
 
 endComponent (string $component, string $type)
 This method is called when parsing of component.xml for the given component ends. More...
 
 beginTag (string $name, array $attributes)
 This is called when a tag starts in the context of the given component. More...
 
 endTag (string $name)
 This is called when a tag ends in the context of the given component. More...
 

Protected Attributes

string $component = null
 
bool $in_mailtemplates = false
 
array $mail_templates = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailTemplateContextDefinitionProcessor::__construct ( protected ilDBInterface  $db)

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

32  {
33  }

Member Function Documentation

◆ beginComponent()

ilMailTemplateContextDefinitionProcessor::beginComponent ( string  $component,
string  $type 
)

This method is called when parsing of component.xml for the given component starts.

This is supposed to reset any internal parsing state.

Implements ilComponentDefinitionProcessor.

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

References $component.

39  : void
40  {
41  $this->component = $type . '/' . $component;
42  $this->in_mailtemplates = false;
43  $this->mail_templates = [];
44  }

◆ beginTag()

ilMailTemplateContextDefinitionProcessor::beginTag ( string  $name,
array  $attributes 
)

This is called when a tag starts in the context of the given component.

Parameters
string[]$attributes

Implements ilComponentDefinitionProcessor.

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

References $component, ilMailTemplateContextService\insertFromXML(), and null.

53  : void
54  {
55  if ($name === 'mailtemplates') {
56  $this->in_mailtemplates = true;
57  return;
58  }
59  if ($name !== 'context' || !$this->in_mailtemplates) {
60  return;
61  }
62 
63  $component = $attributes['component'] ?? null;
64  if (!$component) {
66  }
67 
69  $component,
70  $attributes['id'],
71  $attributes['class'],
72  $attributes['path'] ?? null
73  );
74  $this->mail_templates[] = $attributes['id'];
75  }
static insertFromXML(string $a_component, string $a_id, string $a_class, ?string $a_path)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ endComponent()

ilMailTemplateContextDefinitionProcessor::endComponent ( string  $component,
string  $type 
)

This method is called when parsing of component.xml for the given component ends.

Implements ilComponentDefinitionProcessor.

Definition at line 46 of file class.ilMailTemplateContextDefinitionProcessor.php.

References null.

46  : void
47  {
48  $this->component = null;
49  $this->in_mailtemplates = false;
50  $this->mail_templates = [];
51  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ endTag()

ilMailTemplateContextDefinitionProcessor::endTag ( string  $name)

This is called when a tag ends in the context of the given component.

Implements ilComponentDefinitionProcessor.

Definition at line 77 of file class.ilMailTemplateContextDefinitionProcessor.php.

References ilMailTemplateContextService\clearFromXml().

77  : void
78  {
79  if ($name === 'mailtemplates') {
80  $this->in_mailtemplates = false;
81  return;
82  }
83 
84  if ($name !== 'module' && $name !== 'service') {
85  return;
86  }
87 
88  ilMailTemplateContextService::clearFromXml($this->component, $this->mail_templates);
89  }
static clearFromXml(string $a_component, array $a_new_templates)
+ Here is the call graph for this function:

◆ purge()

ilMailTemplateContextDefinitionProcessor::purge ( )

This methods is supposed to purge existing data in the provider of the component, so new components can be added to a clean slate.

Implements ilComponentDefinitionProcessor.

Definition at line 35 of file class.ilMailTemplateContextDefinitionProcessor.php.

35  : void
36  {
37  }

Field Documentation

◆ $component

string ilMailTemplateContextDefinitionProcessor::$component = null
protected

Definition at line 23 of file class.ilMailTemplateContextDefinitionProcessor.php.

Referenced by beginComponent(), and beginTag().

◆ $in_mailtemplates

bool ilMailTemplateContextDefinitionProcessor::$in_mailtemplates = false
protected

◆ $mail_templates

array ilMailTemplateContextDefinitionProcessor::$mail_templates = []
protected

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