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

Public Member Functions

 getModels (DomUtil $dom_util, \ilPageObject $page)
 

Detailed Description

Definition at line 22 of file class.ilPCParagraphModelProvider.php.

Member Function Documentation

◆ getModels()

ilPCParagraphModelProvider::getModels ( DomUtil  $dom_util,
\ilPageObject  $page 
)

Implements ILIAS\COPage\Editor\Components\PageComponentModelProvider.

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

References $c, ILIAS\COPage\Dom\DomUtil\dump(), ilPageObject\getDomDoc(), ILIAS\COPage\Dom\DomUtil\path(), ilPCParagraph\xml2output(), and ilPCParagraphGUI\xml2outputJS().

27  : array {
28  $models = [];
29 
30  foreach ($dom_util->path($page->getDomDoc(), "//Paragraph") as $node) {
31  $par = $node->parentNode;
32  $pc_id = $par->getAttribute("PCID");
33 
34  $model = new \stdClass();
35  $s_text = "";
36  foreach ($node->childNodes as $c) {
37  $s_text .= $dom_util->dump($c);
38  }
39  $s_text = \ilPCParagraph::xml2output($s_text, true, false);
40  $s_text = \ilPCParagraphGUI::xml2outputJS($s_text);
41 
42  $char = (string) $node->getAttribute("Characteristic");
43  if ($char == "") {
44  $char = "Standard";
45  }
46  $model->characteristic = $char;
47  $model->text = $s_text;
48  $models[$pc_id] = $model;
49  }
50 
51  return $models;
52  }
static xml2outputJS(string $s_text)
Prepare content for js output.
static xml2output(string $a_text, bool $a_wysiwyg=false, bool $a_replace_lists=true, bool $unmask=true)
Converts xml from DB to output in edit textarea.
$c
Definition: deliver.php:25
path(\DOMDocument $doc, string $path)
+ Here is the call graph for this function:

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