ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCOPageDefinitionProcessor Class Reference
+ Inheritance diagram for ilCOPageDefinitionProcessor:
+ Collaboration diagram for ilCOPageDefinitionProcessor:

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 = null
 
string $type = null
 

Detailed Description

Definition at line 7 of file class.ilCOPageDefinitionProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ilCOPageDefinitionProcessor::__construct ( \ilDBInterface  $db)

Definition at line 13 of file class.ilCOPageDefinitionProcessor.php.

References $db.

14  {
15  $this->db = $db;
16  }

Member Function Documentation

◆ beginComponent()

ilCOPageDefinitionProcessor::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 24 of file class.ilCOPageDefinitionProcessor.php.

References $component, and $type.

24  : void
25  {
26  $this->component = $component;
27  $this->type = $type;
28  }

◆ beginTag()

ilCOPageDefinitionProcessor::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 36 of file class.ilCOPageDefinitionProcessor.php.

36  : void
37  {
38  switch ($name) {
39  case "pagecontent":
40  $this->db->manipulate("INSERT INTO copg_pc_def " .
41  "(pc_type, name, component, directory, int_links, style_classes, xsl, def_enabled, top_item, order_nr) VALUES (" .
42  $this->db->quote($attributes["pc_type"], "text") . "," .
43  $this->db->quote($attributes["name"], "text") . "," .
44  $this->db->quote($this->type . "/" . $this->component, "text") . "," .
45  $this->db->quote($attributes["directory"], "text") . "," .
46  $this->db->quote($attributes["int_links"], "integer") . "," .
47  $this->db->quote($attributes["style_classes"], "integer") . "," .
48  $this->db->quote($attributes["xsl"], "integer") . "," .
49  $this->db->quote($attributes["def_enabled"], "integer") . "," .
50  $this->db->quote($attributes["top_item"], "integer") . "," .
51  $this->db->quote($attributes["order_nr"], "integer") .
52  ")");
53  break;
54 
55  case "pageobject":
56  $this->db->manipulate("INSERT INTO copg_pobj_def " .
57  "(parent_type, class_name, component, directory) VALUES (" .
58  $this->db->quote($attributes["parent_type"], "text") . "," .
59  $this->db->quote($attributes["class_name"], "text") . "," .
60  $this->db->quote($this->type . "/" . $this->component, "text") . "," .
61  $this->db->quote($attributes["directory"], "text") .
62  ")");
63  break;
64  }
65  }
$attributes
Definition: metadata.php:248
if($format !==null) $name
Definition: metadata.php:247

◆ endComponent()

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

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

Implements ilComponentDefinitionProcessor.

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

30  : void
31  {
32  $this->component = null;
33  $this->type = null;
34  }

◆ endTag()

ilCOPageDefinitionProcessor::endTag ( string  $name)

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

Implements ilComponentDefinitionProcessor.

Definition at line 67 of file class.ilCOPageDefinitionProcessor.php.

67  : void
68  {
69  }

◆ purge()

ilCOPageDefinitionProcessor::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 18 of file class.ilCOPageDefinitionProcessor.php.

18  : void
19  {
20  $this->db->manipulate("DELETE FROM copg_pc_def");
21  $this->db->manipulate("DELETE FROM copg_pobj_def");
22  }

Field Documentation

◆ $component

string ilCOPageDefinitionProcessor::$component = null
protected

Definition at line 10 of file class.ilCOPageDefinitionProcessor.php.

Referenced by beginComponent().

◆ $db

ilDBInterface ilCOPageDefinitionProcessor::$db
protected

Definition at line 9 of file class.ilCOPageDefinitionProcessor.php.

Referenced by __construct().

◆ $type

string ilCOPageDefinitionProcessor::$type = null
protected

Definition at line 11 of file class.ilCOPageDefinitionProcessor.php.

Referenced by beginComponent().


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