ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 include_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  'registration-link' => 'registration_link',
25  'language-selection' => 'language_selection',
26  'user-agreement' => 'user_agreement_link'
27  );
28 
33  public static function getAllTypes()
34  {
35  return self::$types;
36  }
37 
41  public function init()
42  {
43  $this->setType('lpe');
44  }
45 
49  public function setNode($a_node)
50  {
51  parent::setNode($a_node); // this is the PageContent node
52  $this->res_node = $a_node->first_child(); // this is the login page element
53  }
54 
61  public function create(&$a_pg_obj, $a_hier_id, $a_pc_id = "")
62  {
63  $this->node = $this->createPageContentNode();
64  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
65  $lpe = $this->dom->create_element('LoginPageElement');
66  $this->res_node = $this->node->append_child($lpe);
67  }
68 
75  {
76  if (!empty($a_type)) {
77  $this->res_node->set_attribute('Type', $a_type);
78  }
79  }
80 
86  public function getLoginPageElementType()
87  {
88  if (is_object($this->res_node)) {
89  return $this->res_node->get_attribute('Type');
90  }
91  }
92 
96  public function setAlignment($a_alignment)
97  {
98  $this->res_node->set_attribute('HorizontalAlign', $a_alignment);
99  }
100 
105  public function getAlignment()
106  {
107  if (is_object($this->res_node)) {
108  return $this->res_node->get_attribute('HorizontalAlign');
109  }
110  }
111 
116  public static function getLangVars()
117  {
118  return array("ed_insert_login_page_element");
119  }
120 }
static getAllTypes()
Get all types.
setType($a_type)
Set Type.
setLoginPageElementType($a_type)
Set Type of Login Page Element.
setAlignment($a_alignment)
set alignment
Class ilPageContent.
$a_type
Definition: workflow.php:92
init()
Init page content component.
getLoginPageElementType()
Get log page element type.
const IL_INSERT_AFTER
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create resources node in xml.
Create styles array
The data for the language used.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
static getLangVars()
Get lang vars needed for editing.
Class ilPCLoginPageElement.