ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPCLoginPageElements.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 $dom;
19  public $res_node;
20 
21  private static $types = array(
22  'login-form' => 'login_form',
23  'cas-login-form' => 'cas_login_form',
24  'shibboleth-login-form' => 'shib_login_form',
25  'openid-login-form' => 'openid_login_form',
26  'registration-link' => 'registration_link',
27  'language-selection' => 'language_selection',
28  'user-agreement' => 'user_agreement_link'
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  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  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  function setLoginPageElementType($a_type)
77  {
78  if (!empty($a_type))
79  {
80  $this->res_node->set_attribute('Type',$a_type);
81  }
82  }
83 
90  {
91  if (is_object($this->res_node))
92  {
93  return $this->res_node->get_attribute('Type');
94  }
95  }
96 
100  public function setAlignment($a_alignment)
101  {
102  $this->res_node->set_attribute('HorizontalAlign',$a_alignment);
103  }
104 
109  public function getAlignment()
110  {
111  if(is_object($this->res_node))
112  {
113  return $this->res_node->get_attribute('HorizontalAlign');
114  }
115  }
116 }
117 ?>