ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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-login-form' => 'openid_login_form',
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 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 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
75 function setLoginPageElementType($a_type)
76 {
77 if (!empty($a_type))
78 {
79 $this->res_node->set_attribute('Type',$a_type);
80 }
81 }
82
89 {
90 if (is_object($this->res_node))
91 {
92 return $this->res_node->get_attribute('Type');
93 }
94 }
95
99 public function setAlignment($a_alignment)
100 {
101 $this->res_node->set_attribute('HorizontalAlign',$a_alignment);
102 }
103
108 public function getAlignment()
109 {
110 if(is_object($this->res_node))
111 {
112 return $this->res_node->get_attribute('HorizontalAlign');
113 }
114 }
115
120 static function getLangVars()
121 {
122 return array("ed_insert_login_page_element");
123 }
124
125}
126?>
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.