ILIAS  release_8 Revision v8.24
class.ilPCLoginPageElement.php
Go to the documentation of this file.
1<?php
2
26{
28
29 private static array $types = array(
30 'login-form' => 'login_form',
31 'cas-login-form' => 'cas_login_form',
32 'shibboleth-login-form' => 'shib_login_form',
33 'openid-connect-login' => 'openid_connect_login',
34 'registration-link' => 'registration_link',
35 'user-agreement' => 'user_agreement_link',
36 'saml-login' => 'saml_login'
37 );
38
42 public static function getAllTypes(): array
43 {
44 return self::$types;
45 }
46
47 public function init(): void
48 {
49 $this->setType('lpe');
50 }
51
55 public function setNode(php4DOMElement $a_node): void
56 {
57 parent::setNode($a_node); // this is the PageContent node
58 $this->res_node = $a_node->first_child(); // this is the login page element
59 }
60
61 public function create(
62 ilPageObject $a_pg_obj,
63 string $a_hier_id,
64 string $a_pc_id = ""
65 ): void {
66 $this->node = $this->createPageContentNode();
67 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
68 $lpe = $this->dom->create_element('LoginPageElement');
69 $this->res_node = $this->node->append_child($lpe);
70 }
71
72 public function setLoginPageElementType(string $a_type): void
73 {
74 if (!empty($a_type)) {
75 $this->res_node->set_attribute('Type', $a_type);
76 }
77 }
78
79 public function getLoginPageElementType(): string
80 {
81 if (is_object($this->res_node)) {
82 return $this->res_node->get_attribute('Type');
83 }
84 return "";
85 }
86
87 public function setAlignment(string $a_alignment): void
88 {
89 $this->res_node->set_attribute('HorizontalAlign', $a_alignment);
90 }
91
92 public function getAlignment(): string
93 {
94 if (isset($this->res_node) && is_object($this->res_node)) {
95 return $this->res_node->get_attribute('HorizontalAlign');
96 }
97 return "";
98 }
99
100 public static function getLangVars(): array
101 {
102 return array("ed_insert_login_page_element");
103 }
104}
const IL_INSERT_AFTER
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLangVars()
Get lang vars needed for editing.
static getAllTypes()
Get all types.
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
setNode(php4DOMElement $a_node)
Set node.
setAlignment(string $a_alignment)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
createPageContentNode(bool $a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
setType(string $a_type)
Set Type.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
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