ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPCParagraphModelProvider.php
Go to the documentation of this file.
1<?php
2
21
23{
24 public function getModels(
25 DomUtil $dom_util,
26 \ilPageObject $page
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 }
53}
path(\DOMDocument $doc, string $path)
static xml2outputJS(string $s_text)
Prepare content for js output.
getModels(DomUtil $dom_util, \ilPageObject $page)
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.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
getDomDoc()
Get dom doc (DOMDocument)
$c
Definition: deliver.php:25