ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  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  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  {
78  $this->res_node->set_attribute('Type',$a_type);
79  }
80  }
81 
88  {
89  if (is_object($this->res_node))
90  {
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  {
111  return $this->res_node->get_attribute('HorizontalAlign');
112  }
113  }
114 
119  static function getLangVars()
120  {
121  return array("ed_insert_login_page_element");
122  }
123 
124 }
125 ?>
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:93
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.