ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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-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 ?>