ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilOpenIdProviderTableGUI.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/Table/classes/class.ilTable2GUI.php');
5 include_once './Services/OpenId/classes/class.ilOpenIdProviders.php';
6 
15 {
16  private $ctrl = null;
17 
22  public function __construct($a_parent_class,$a_parent_cmd)
23  {
24  global $lng,$ilCtrl;
25 
26  $this->ctrl = $ilCtrl;
27 
28  parent::__construct($a_parent_class,$a_parent_cmd);
29 
30  $this->setTitle($this->lng->txt('auth_openid_provider_tbl'));
31 
32  $this->addColumn('','f',1);
33  $this->addColumn($this->lng->txt('title'),'title',"50%");
34  $this->addColumn($this->lng->txt('url'),'url',"40%");
35  $this->addColumn('','',"10%");
36 
37  $this->setFormAction($this->ctrl->getFormAction($a_parent_class));
38  $this->setRowTemplate("tpl.openid_provider_row.html","Services/OpenId");
39  $this->setDefaultOrderField('title');
40  $this->setDefaultOrderDirection("asc");
41 
42  $this->addMultiCommand('deleteProvider',$this->lng->txt('delete'));
43  $this->addCommandButton('addProvider', $this->lng->txt('auth_openid_provider_add'));
44 
45  $this->setSelectAllCheckbox('provider_ids');
46  }
47 
52  public function fillRow($set)
53  {
54  $this->tpl->setVariable('VAL_ID',$set['provider_id']);
55  $this->tpl->setVariable('VAL_TITLE',$set['title']);
56  $this->tpl->setVariable('VAL_URL',$set['url']);
57  $this->tpl->setVariable('TXT_EDIT',$this->lng->txt('edit'));
58  $this->ctrl->setParameter($this->getParentObject(),'provider_id',$set['provider_id']);
59  $this->tpl->setVariable('EDIT_LINK',$this->ctrl->getLinkTarget($this->getParentObject(),'editProvider'));
60 
61  }
62 
67  public function parse()
68  {
69  $providers = ilOpenIdProviders::getInstance()->getProvider();
70 
71  $data = array();
72  for($i = 0; $i < count($providers); $i++)
73  {
74  $data[$i]['provider_id'] = $providers[$i]->getId();
75  $data[$i]['title'] = $providers[$i]->getName();
76  $data[$i]['url'] = $providers[$i]->getURL();
77  }
78  $this->setData($data);
79  }
80 }
81 ?>