ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 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)
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj, ?PageManagerInterface $page_manager=null, ?ObjectAdapterInterface $object_adapter=null)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 getDomNode ()
 
 getDomDoc ()
 
 setDomNode (DOMNode $node)
 
 getChildNode ()
 
 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...
 
 getNewPageContentNode ()
 
 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 ()
 
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)
 
- Static Public Member Functions inherited from ilPageContent
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
 getPageManager ()
 
 setType (string $a_type)
 Set Type. More...
 
 hasNode ()
 
 createInitialChildNode (string $hier_id, string $pc_id, string $child, array $child_attributes=[])
 

Protected Attributes

int $ref_id
 
ilDBInterface $db
 
ilLanguage $lng
 
- Protected Attributes inherited from ilPageContent
DOMDocument $dom_doc
 
ILIAS COPage InternalDomainService $domain
 
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link
 
string $fullscreen_link
 
string $sourcecode_download_script
 
ilLogger $log
 
string $profile_back_url = ""
 
ILIAS COPage Dom DomUtil $dom_util
 
PageManagerInterface $page_manager = null
 
ObjectAdapterInterface $object = null
 

Additional Inherited Members

- Data Fields inherited from ilPageContent
string $hier_id = ""
 
DOMNode $dom_node = 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 55 of file class.ilPCAMDForm.php.

References ilPageContent\createPageContentNode(), ilPageContent\getDomNode(), IL_INSERT_AFTER, and ilPageObject\insertContent().

59  : void {
60  $this->createPageContentNode();
61  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
62  $amdfrm_node = $this->dom_doc->createElement("AMDForm");
63  $this->getDomNode()->appendChild($amdfrm_node);
64  }
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
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) ...
+ Here is the call graph for this function:

◆ getLangVars()

static ilPCAMDForm::getLangVars ( )
static

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

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

◆ getRecordIds()

ilPCAMDForm::getRecordIds ( )

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

References ilPageContent\getChildNode().

71  : array
72  {
73  if (is_object($this->getChildNode())) {
74  return explode(",", $this->getChildNode()->getAttribute("RecordIds"));
75  }
76  return [];
77  }
+ Here is the call graph for this function:

◆ 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

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

References ilCopyWizardOptions\_getInstance(), and ILIAS\Repository\int().

122  : void {
123  if ($obj_copy_id > 0) {
124  $cp_options = ilCopyWizardOptions::_getInstance($obj_copy_id);
125  $mappings = $cp_options->getMappings();
126  $key = $new_parent_id . "_adv_rec";
127  if (is_array($mappings) && isset($mappings[$key])) {
128  $xpath = new DOMXPath($a_domdoc);
129  $nodes = $xpath->query("//AMDForm");
130  foreach ($nodes as $node) {
131  $old_ids = explode(",", (string) $node->getAttribute("RecordIds"));
132  // 36565: do not overwrite RecordIds that are not mapped
133  $new_ids = array_map(static function ($i) use ($mappings, $key) {
134  return $mappings[$key][(int) $i] ?? $i;
135  }, $old_ids);
136  $new_ids = implode(",", $new_ids);
137  if ($new_ids !== "") {
138  $node->setAttribute("RecordIds", $new_ids);
139  }
140  }
141  }
142  }
143  }
static _getInstance(int $a_copy_id)
+ Here is the call graph for this function:

◆ init()

ilPCAMDForm::init ( )

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

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

29  : void
30  {
31  global $DIC;
32 
33  $this->db = $DIC->database();
34  $this->lng = $DIC->language();
35  $this->setType("amdfrm");
36 
37  $request = $DIC->portfolio()
38  ->internal()
39  ->gui()
40  ->standardRequest();
41 
42  $this->ref_id = $request->getRefId();
43  }
setType(string $a_type)
Set Type.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ isTemplate()

ilPCAMDForm::isTemplate ( )
protected

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

References ilPageContent\getPage().

Referenced by modifyPageContentPostXsl().

50  : bool
51  {
52  return ($this->getPage()->getParentType() === "prtt");
53  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyPageContentPostXsl()

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

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

References $parts, ILIAS\Survey\Mode\getId(), ilPageContent\getPage(), and isTemplate().

84  : string {
85  $end = 0;
86  $start = strpos($a_output, "[[[[[AMDForm;");
87  if (is_int($start)) {
88  $end = strpos($a_output, "]]]]]", $start);
89  }
90  while ($end > 0) {
91  $parts = explode(";", substr($a_output, $start + 13, $end - $start - 13));
92  if ($this->isTemplate()) {
93  $portfolio = new ilObjPortfolioTemplate($this->getPage()->getPortfolioId(), false);
94  } else {
95  $portfolio = new ilObjPortfolio($this->getPage()->getPortfolioId(), false);
96  }
97 
98  $mdgui = new ilObjectMetaDataGUI($portfolio, "pfpg", $this->getPage()->getId(), false);
99  $mdgui->setRecordFilter(explode(",", $parts[0]));
100  $insert_html = $mdgui->getBlockHTML();
101 
102  $a_output = substr($a_output, 0, $start) .
103  $insert_html .
104  substr($a_output, $end + 5);
105 
106  $start = strpos($a_output, "[[[[[AMDForm;", $start + 5);
107  $end = 0;
108  if (is_int($start)) {
109  $end = strpos($a_output, "]]]]]", $start);
110  }
111  }
112 
113  return $a_output;
114  }
Class ilObjectMetaDataGUI.
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
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...
+ Here is the call graph for this function:

◆ setRecordIds()

ilPCAMDForm::setRecordIds ( array  $record_ids)

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

References ilPageContent\getChildNode().

66  : void
67  {
68  $this->getChildNode()->setAttribute("RecordIds", implode(",", $record_ids));
69  }
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilPCAMDForm::$db
protected

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

◆ $lng

ilLanguage ilPCAMDForm::$lng
protected

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

◆ $ref_id

int ilPCAMDForm::$ref_id
protected

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


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