ILIAS  release_8 Revision v8.24
ilPCAMDForm Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilPCAMDForm:
+ Collaboration diagram for ilPCAMDForm:

Public Member Functions

 init ()
 Init object. More...
 
 setNode (php4DOMElement $a_node)
 Set xml node of page content. More...
 
 create (ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
 
 setRecordIds (array $record_ids)
 
 getRecordIds ()
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 Modify page content after xsl. More...
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 setNode (php4DOMElement $a_node)
 Set xml node of page content. More...
 
 getNode ()
 
 getJavascriptFiles (string $a_mode)
 
 getCssFiles (string $a_mode)
 
 getOnloadCode (string $a_mode)
 
 setHierId (string $a_hier_id)
 
 getHierId ()
 
 lookupHierId ()
 
 readHierId ()
 
 setPcId (string $a_pcid)
 
 getPCId ()
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setProfileBackUrl (string $url)
 
 getProfileBackUrl ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 readPCId ()
 
 writePCId (string $a_pc_id)
 
 setEnabled (string $value)
 Set Enabled value for page content component. More...
 
 enable ()
 
 disable ()
 
 isEnabled ()
 
 createPageContentNode (bool $a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 Modify page content after xsl. More...
 
 getModel ()
 Get model as needed for the front-end editor. More...
 

Static Public Member Functions

static getLangVars ()
 Get lang vars needed for editing. More...
 
static handleCopiedContent (DOMDocument $a_domdoc, bool $a_self_ass=true, bool $a_clone_mobs=false, int $new_parent_id=0, int $obj_copy_id=0)
 Handle copied content. More...
 
- Static Public Member Functions inherited from ilPageContent
static incEdId (string $ed_id)
 Increases an hierarchical editing id at lowest level (last number) More...
 
static decEdId (string $ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
static sortHierIds (array $a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId (string $a, string $b)
 Check whether Hier ID $a is greater than Hier ID $b. More...
 
static getLangVars ()
 Get lang vars needed for editing. More...
 
static handleCopiedContent (DOMDocument $a_domdoc, bool $a_self_ass=true, bool $a_clone_mobs=false, int $new_parent_id=0, int $obj_copy_id=0)
 Handle copied content. More...
 
static afterPageUpdate (ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete (ilPageObject $a_page)
 Before page is being deleted. More...
 
static afterRepositoryCopy (ilPageObject $page, array $mapping, int $source_ref_id)
 After repository (container) copy action. More...
 
static afterPageHistoryEntry (ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
 After page history entry has been created. More...
 
static deleteHistoryLowerEqualThan (string $parent_type, int $page_id, string $lang, int $delete_lower_than_nr)
 Overwrite in derived classes, if old history entries are being deleted. More...
 

Protected Member Functions

 isTemplate ()
 
- Protected Member Functions inherited from ilPageContent
 setType (string $a_type)
 Set Type. More...
 

Protected Attributes

php4DOMElement $amdfrm_node
 
int $ref_id
 
ilDBInterface $db
 
ilLanguage $lng
 
- Protected Attributes inherited from ilPageContent
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link
 
string $fullscreen_link
 
string $sourcecode_download_script
 
ilLogger $log
 
string $profile_back_url = ""
 

Additional Inherited Members

- Data Fields inherited from ilPageContent
string $hier_id = ""
 
php4DOMElement $node = null
 
php4DOMDocument $dom = null
 
string $page_lang = ""
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning AMD Form Page element

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ create()

ilPCAMDForm::create ( ilPageObject  $a_pg_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Definition at line 62 of file class.ilPCAMDForm.php.

66 : void {
67 $this->node = $this->createPageContentNode();
68 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
69 $this->amdfrm_node = $this->dom->create_element("AMDForm");
70 $this->amdfrm_node = $this->node->append_child($this->amdfrm_node);
71 }
const IL_INSERT_AFTER
createPageContentNode(bool $a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
insertContent(ilPageContent $a_cont_obj, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="", bool $remove_placeholder=true)
insert a content node before/after a sibling or as first child of a parent

◆ getLangVars()

static ilPCAMDForm::getLangVars ( )
static

Get lang vars needed for editing.

Returns
string[] array of lang var keys

Reimplemented from ilPageContent.

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

46 : array
47 {
48 return array("ed_insert_amdfrm", "pc_amdfrm");
49 }

◆ getRecordIds()

ilPCAMDForm::getRecordIds ( )

Definition at line 78 of file class.ilPCAMDForm.php.

78 : array
79 {
80 if (is_object($this->amdfrm_node)) {
81 return explode(",", $this->amdfrm_node->get_attribute("RecordIds"));
82 }
83 return [];
84 }

◆ handleCopiedContent()

static ilPCAMDForm::handleCopiedContent ( DOMDocument  $a_domdoc,
bool  $a_self_ass = true,
bool  $a_clone_mobs = false,
int  $new_parent_id = 0,
int  $obj_copy_id = 0 
)
static

Handle copied content.

This function must, e.g. create copies of objects referenced within the content (e.g. question objects)

Parameters
DOMDocument$a_domdoc
bool$a_self_ass
bool$a_clone_mobs
int$new_parent_id
int$obj_copy_id

Reimplemented from ilPageContent.

Definition at line 123 of file class.ilPCAMDForm.php.

129 : void {
130 if ($obj_copy_id > 0) {
131 $cp_options = ilCopyWizardOptions::_getInstance($obj_copy_id);
132 $mappings = $cp_options->getMappings();
133 $key = $new_parent_id . "_adv_rec";
134 if (is_array($mappings) && isset($mappings[$key])) {
135 $xpath = new DOMXPath($a_domdoc);
136 $nodes = $xpath->query("//AMDForm");
137 foreach ($nodes as $node) {
138 $old_ids = explode(",", (string) $node->getAttribute("RecordIds"));
139 // 36565: do not overwrite RecordIds that are not mapped
140 $new_ids = array_map(static function ($i) use ($mappings, $key) {
141 return $mappings[$key][(int) $i] ?? $i;
142 }, $old_ids);
143 $new_ids = implode(",", $new_ids);
144 if ($new_ids !== "") {
145 $node->setAttribute("RecordIds", $new_ids);
146 }
147 }
148 }
149 }
150 }
static _getInstance(int $a_copy_id)
php4DOMElement $node
$i
Definition: metadata.php:41
string $key
Consumer key/client ID value.
Definition: System.php:193

References $i, ILIAS\LTI\ToolProvider\$key, ilCopyWizardOptions\_getInstance(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ init()

ilPCAMDForm::init ( )

Init object.

This function must be overwritten and at least set the content type.

Reimplemented from ilPageContent.

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

30 : void
31 {
32 global $DIC;
33
34 $this->db = $DIC->database();
35 $this->lng = $DIC->language();
36 $this->setType("amdfrm");
37
38 $request = $DIC->portfolio()
39 ->internal()
40 ->gui()
41 ->standardRequest();
42
43 $this->ref_id = $request->getRefId();
44 }
setType(string $a_type)
Set Type.
global $DIC
Definition: feed.php:28

References $DIC, ILIAS\Repository\lng(), and ilPageContent\setType().

+ Here is the call graph for this function:

◆ isTemplate()

ilPCAMDForm::isTemplate ( )
protected

Definition at line 57 of file class.ilPCAMDForm.php.

57 : bool
58 {
59 return ($this->getPage()->getParentType() === "prtt");
60 }

References ilPageContent\getPage().

+ Here is the call graph for this function:

◆ modifyPageContentPostXsl()

ilPCAMDForm::modifyPageContentPostXsl ( string  $a_output,
string  $a_mode,
bool  $a_abstract_only = false 
)

Modify page content after xsl.

Reimplemented from ilPageContent.

Definition at line 87 of file class.ilPCAMDForm.php.

91 : string {
92 $end = 0;
93 $start = strpos($a_output, "[[[[[AMDForm;");
94 if (is_int($start)) {
95 $end = strpos($a_output, "]]]]]", $start);
96 }
97 while ($end > 0) {
98 $parts = explode(";", substr($a_output, $start + 13, $end - $start - 13));
99 if ($this->isTemplate()) {
100 $portfolio = new ilObjPortfolioTemplate($this->getPage()->getPortfolioId(), false);
101 } else {
102 $portfolio = new ilObjPortfolio($this->getPage()->getPortfolioId(), false);
103 }
104
105 $mdgui = new ilObjectMetaDataGUI($portfolio, "pfpg", $this->getPage()->getId(), false);
106 $mdgui->setRecordFilter(explode(",", $parts[0]));
107 $insert_html = $mdgui->getBlockHTML();
108
109 $a_output = substr($a_output, 0, $start) .
110 $insert_html .
111 substr($a_output, $end + 5);
112
113 $start = strpos($a_output, "[[[[[AMDForm;", $start + 5);
114 $end = 0;
115 if (is_int($start)) {
116 $end = strpos($a_output, "]]]]]", $start);
117 }
118 }
119
120 return $a_output;
121 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64

◆ setNode()

ilPCAMDForm::setNode ( php4DOMElement  $a_node)

Set xml node of page content.

Parameters
php4DOMElement$a_nodenode object

Reimplemented from ilPageContent.

Definition at line 51 of file class.ilPCAMDForm.php.

51 : void
52 {
53 parent::setNode($a_node); // this is the PageContent node
54 $this->amdfrm_node = $a_node->first_child(); // this is the courses node
55 }

References php4DOMNode\first_child().

+ Here is the call graph for this function:

◆ setRecordIds()

ilPCAMDForm::setRecordIds ( array  $record_ids)

Definition at line 73 of file class.ilPCAMDForm.php.

73 : void
74 {
75 $this->amdfrm_node->set_attribute("RecordIds", implode(",", $record_ids));
76 }

Field Documentation

◆ $amdfrm_node

php4DOMElement ilPCAMDForm::$amdfrm_node
protected

Definition at line 25 of file class.ilPCAMDForm.php.

◆ $db

ilDBInterface ilPCAMDForm::$db
protected

Definition at line 27 of file class.ilPCAMDForm.php.

◆ $lng

ilLanguage ilPCAMDForm::$lng
protected

Definition at line 28 of file class.ilPCAMDForm.php.

◆ $ref_id

int ilPCAMDForm::$ref_id
protected

Definition at line 26 of file class.ilPCAMDForm.php.


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