ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPCPRGStatusInfo Class Reference

PageComponent "Status Information" for PageEditor in PRGs. More...

+ Inheritance diagram for ilPCPRGStatusInfo:
+ Collaboration diagram for ilPCPRGStatusInfo:

Public Member Functions

 init ()
 Init object. More...
 
 create (ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
 
 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, ?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...
 

Data Fields

const PCTYPE = 'prgstatusinfo'
 
const PCELEMENT = 'PRGStatusInfo'
 
const PLACEHOLDER = '[[[PRG_STATUS_INFO]]]'
 
const PROVIDING_TYPES = ['prg']
 
- Data Fields inherited from ilPageContent
string $hier_id = ""
 
DOMNode $dom_node = null
 
string $page_lang = ""
 

Protected Member Functions

 supportsType (int $parent_obj_id)
 
 replaceWithRendered (int $obj_id, $html)
 
 getTemplate ()
 
- 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

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

- 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...
 

Detailed Description

PageComponent "Status Information" for PageEditor in PRGs.

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

Member Function Documentation

◆ create()

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

Definition at line 40 of file class.ilPCPRGStatusInfo.php.

44 : void {
45 $this->node = $this->createPageContentNode();
46 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
47 $this->cache_node = $this->dom_doc->createElement(self::PCELEMENT);
48 $this->cache_node = $this->node->appendChild($this->cache_node);
49 }
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

◆ getTemplate()

ilPCPRGStatusInfo::getTemplate ( )
protected

Definition at line 107 of file class.ilPCPRGStatusInfo.php.

107 : string
108 {
109 $template = new ilTemplate("tpl.statusinfo_poeditor_element.html", true, true, 'components/ILIAS/StudyProgramme');
110 $icon = "./assets/images/standard/icon_prg.svg";
111
112 $template->setVariable("ICON", $icon);
113 $template->setVariable("ICON_TEXT", $this->lng->txt("study_programme_icon"));
114 $template->setVariable("LABEL", $this->lng->txt("pc_prg_statusinfo_label"));
115
116 return $template->get();
117 }
special template class to simplify handling of ITX/PEAR

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ init()

ilPCPRGStatusInfo::init ( )

Init object.

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

Reimplemented from ilPageContent.

Definition at line 33 of file class.ilPCPRGStatusInfo.php.

33 : void
34 {
35 global $DIC;
36 $this->lng = $DIC->language();
37 $this->setType(self::PCTYPE);
38 }
setType(string $a_type)
Set Type.
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

◆ modifyPageContentPostXsl()

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

Modify page content after xsl.

Reimplemented from ilPageContent.

Definition at line 54 of file class.ilPCPRGStatusInfo.php.

58 : string {
59 $parent_obj_id = $this->getPage()->getParentId();
60 $end = 0;
61 $start = strpos($a_output, "[[[PRG_STATUS_INFO");
62
63 if (is_int($start)) {
64 $end = strpos($a_output, "]]]", $start);
65 }
66
67 if ($a_mode === 'edit') {
68 while ($end > 0) {
69 if ($this->supportsType($parent_obj_id)) {
70 $html = $this->getTemplate();
71
72 $a_output = substr($a_output, 0, $start) .
73 $html .
74 substr($a_output, $end + 3);
75
76 $start = strpos($a_output, "[[[PRG_STATUS_INFO", $start + 3);
77 $end = 0;
78 if (is_int($start)) {
79 $end = strpos($a_output, "]]]", $start);
80 }
81 }
82 }
83 return $a_output;
84 }
85
86 $parent_obj_id = (int) $this->getPage()->getParentId();
87 if ($this->supportsType($parent_obj_id)) {
88 $a_output = $this->replaceWithRendered($parent_obj_id, $a_output);
89 }
90 return $a_output;
91 }
supportsType(int $parent_obj_id)
replaceWithRendered(int $obj_id, $html)

◆ replaceWithRendered()

ilPCPRGStatusInfo::replaceWithRendered ( int  $obj_id,
  $html 
)
protected

Definition at line 99 of file class.ilPCPRGStatusInfo.php.

99 : string
100 {
102 $builder = $dic['pc.statusinfo'];
103 $rendered = $builder->getStatusInfoFor($obj_id);
104 return str_replace(self::PLACEHOLDER, $rendered, $html);
105 }
$dic
Definition: ltiresult.php:33

References $dic, and ilStudyProgrammeDIC\dic().

+ Here is the call graph for this function:

◆ supportsType()

ilPCPRGStatusInfo::supportsType ( int  $parent_obj_id)
protected

Definition at line 93 of file class.ilPCPRGStatusInfo.php.

93 : bool
94 {
95 $parent_obj_type = \ilObject::_lookupType($parent_obj_id);
96 return in_array($parent_obj_type, self::PROVIDING_TYPES);
97 }
static _lookupType(int $id, bool $reference=false)

References ilObject\_lookupType().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilPCPRGStatusInfo::$lng
protected

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

◆ PCELEMENT

const ilPCPRGStatusInfo::PCELEMENT = 'PRGStatusInfo'

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

Referenced by ilPRGPageObjectGUI\getPageConfig().

◆ PCTYPE

const ilPCPRGStatusInfo::PCTYPE = 'prgstatusinfo'

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

◆ PLACEHOLDER

const ilPCPRGStatusInfo::PLACEHOLDER = '[[[PRG_STATUS_INFO]]]'

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

◆ PROVIDING_TYPES

const ilPCPRGStatusInfo::PROVIDING_TYPES = ['prg']

Definition at line 31 of file class.ilPCPRGStatusInfo.php.


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