ILIAS  release_8 Revision v8.23
ilMailTemplateContextDefinitionProcessor Class Reference
+ Inheritance diagram for ilMailTemplateContextDefinitionProcessor:
+ Collaboration diagram for ilMailTemplateContextDefinitionProcessor:

Public Member Functions

 __construct (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

ilDBInterface $db
 
string $component
 
bool $in_mailtemplates = false
 
array $mail_templates = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailTemplateContextDefinitionProcessor::__construct ( ilDBInterface  $db)

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

References $db.

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 41 of file class.ilMailTemplateContextDefinitionProcessor.php.

References $component.

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

◆ 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 55 of file class.ilMailTemplateContextDefinitionProcessor.php.

References $component, and ilMailTemplateContextService\insertFromXML().

55  : void
56  {
57  if ($name === 'mailtemplates') {
58  $this->in_mailtemplates = true;
59  return;
60  }
61  if ($name !== 'context' || !$this->in_mailtemplates) {
62  return;
63  }
64 
65  $component = $attributes['component'] ?? null;
66  if (!$component) {
68  }
69 
71  $component,
72  $attributes['id'],
73  $attributes['class'],
74  $attributes['path'] ?? null
75  );
76  $this->mail_templates[] = $attributes['id'];
77  }
$attributes
Definition: metadata.php:248
static insertFromXML(string $a_component, string $a_id, string $a_class, ?string $a_path)
if($format !==null) $name
Definition: metadata.php:247
+ 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 48 of file class.ilMailTemplateContextDefinitionProcessor.php.

48  : void
49  {
50  $this->component = null;
51  $this->in_mailtemplates = false;
52  $this->mail_templates = [];
53  }

◆ endTag()

ilMailTemplateContextDefinitionProcessor::endTag ( string  $name)

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

Implements ilComponentDefinitionProcessor.

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

References ilMailTemplateContextService\clearFromXml().

79  : void
80  {
81  if ($name === 'mailtemplates') {
82  $this->in_mailtemplates = false;
83  return;
84  }
85 
86  if ($name !== 'module' && $name !== 'service') {
87  return;
88  }
89 
90  ilMailTemplateContextService::clearFromXml($this->component, $this->mail_templates);
91  }
if($format !==null) $name
Definition: metadata.php:247
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 37 of file class.ilMailTemplateContextDefinitionProcessor.php.

37  : void
38  {
39  }

Field Documentation

◆ $component

string ilMailTemplateContextDefinitionProcessor::$component
protected

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

Referenced by beginComponent(), and beginTag().

◆ $db

ilDBInterface ilMailTemplateContextDefinitionProcessor::$db
protected

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

Referenced by __construct().

◆ $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: