ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilPCLoginPageElement.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/COPage/classes/class.ilPageContent.php';
5
17{
18 public $res_node;
19
20 private static $types = array(
21 'login-form' => 'login_form',
22 'cas-login-form' => 'cas_login_form',
23 'shibboleth-login-form' => 'shib_login_form',
24 'openid-connect-login' => 'openid_connect_login',
25 'registration-link' => 'registration_link',
26 'language-selection' => 'language_selection',
27 'user-agreement' => 'user_agreement_link'
28 );
29
34 public static function getAllTypes()
35 {
36 return self::$types;
37 }
38
42 public function init()
43 {
44 $this->setType('lpe');
45 }
46
50 public function setNode($a_node)
51 {
52 parent::setNode($a_node); // this is the PageContent node
53 $this->res_node = $a_node->first_child(); // this is the login page element
54 }
55
62 public function create(&$a_pg_obj, $a_hier_id, $a_pc_id = "")
63 {
64 $this->node = $this->createPageContentNode();
65 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
66 $lpe = $this->dom->create_element('LoginPageElement');
67 $this->res_node = $this->node->append_child($lpe);
68 }
69
76 {
77 if (!empty($a_type)) {
78 $this->res_node->set_attribute('Type', $a_type);
79 }
80 }
81
87 public function getLoginPageElementType()
88 {
89 if (is_object($this->res_node)) {
90 return $this->res_node->get_attribute('Type');
91 }
92 }
93
97 public function setAlignment($a_alignment)
98 {
99 $this->res_node->set_attribute('HorizontalAlign', $a_alignment);
100 }
101
106 public function getAlignment()
107 {
108 if (is_object($this->res_node)) {
109 return $this->res_node->get_attribute('HorizontalAlign');
110 }
111 }
112
117 public static function getLangVars()
118 {
119 return array("ed_insert_login_page_element");
120 }
121}
An exception for terminatinating execution or to throw for unit testing.
const IL_INSERT_AFTER
Class ilPCLoginPageElement.
setAlignment($a_alignment)
set alignment
static getLangVars()
Get lang vars needed for editing.
init()
Init page content component.
static getAllTypes()
Get all types.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create resources node in xml.
setLoginPageElementType($a_type)
Set Type of Login Page Element.
getLoginPageElementType()
Get log page element type.
Class ilPageContent.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
setType($a_type)
Set Type.
$a_type
Definition: workflow.php:92