ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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  'openid-connect-login' => 'openid_connect_login',
25  'registration-link' => 'registration_link',
26  'language-selection' => 'language_selection',
27  'user-agreement' => 'user_agreement_link',
28  'saml-login' => 'saml_login'
29  );
30 
35  public static function getAllTypes()
36  {
37  return self::$types;
38  }
39 
43  public function init()
44  {
45  $this->setType('lpe');
46  }
47 
51  public function setNode($a_node)
52  {
53  parent::setNode($a_node); // this is the PageContent node
54  $this->res_node = $a_node->first_child(); // this is the login page element
55  }
56 
63  public function create(&$a_pg_obj, $a_hier_id, $a_pc_id = "")
64  {
65  $this->node = $this->createPageContentNode();
66  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
67  $lpe = $this->dom->create_element('LoginPageElement');
68  $this->res_node = $this->node->append_child($lpe);
69  }
70 
76  public function setLoginPageElementType($a_type)
77  {
78  if (!empty($a_type)) {
79  $this->res_node->set_attribute('Type', $a_type);
80  }
81  }
82 
88  public function getLoginPageElementType()
89  {
90  if (is_object($this->res_node)) {
91  return $this->res_node->get_attribute('Type');
92  }
93  }
94 
98  public function setAlignment($a_alignment)
99  {
100  $this->res_node->set_attribute('HorizontalAlign', $a_alignment);
101  }
102 
107  public function getAlignment()
108  {
109  if (is_object($this->res_node)) {
110  return $this->res_node->get_attribute('HorizontalAlign');
111  }
112  }
113 
118  public static function getLangVars()
119  {
120  return array("ed_insert_login_page_element");
121  }
122 }
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.
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.
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.