ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilContributorTableGUI.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 
13 {
14  protected $contributor_role_id; // [int]
15  protected $contributor_ids; // [array]
16 
25  public function __construct($a_parent_obj, $a_parent_cmd, $a_contributor_role_id, array $a_contributor_ids = null)
26  {
27  global $ilCtrl;
28 
29  $this->contributor_role_id = $a_contributor_role_id;
30  $this->contributor_ids = $a_contributor_ids;
31 
32  parent::__construct($a_parent_obj, $a_parent_cmd);
33 
34  $this->addColumn("", "", 1);
35  $this->addColumn($this->lng->txt("name"), "name");
36 
37  $this->setDefaultOrderField("name");
38 
39  $this->setRowTemplate("tpl.contributor_row.html", "Modules/Blog");
40  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
41 
42  if($this->contributor_ids)
43  {
44  $this->setTitle($this->lng->txt("blog_contributor_container_add"));
45  $this->addMultiCommand("addContributorContainerAction", $this->lng->txt("add"));
46  }
47  else
48  {
49  $this->setTitle($this->lng->txt("blog_contributors"));
50  $this->addMultiCommand("confirmRemoveContributor", $this->lng->txt("remove"));
51  }
52 
53  $this->getItems();
54  }
55 
59  protected function getItems()
60  {
61  global $rbacreview;
62 
63  if($this->contributor_ids)
64  {
65  $assigned =$rbacreview->assignedUsers($this->contributor_role_id);
66  }
67  else
68  {
69  $assigned = array();
70  $this->contributor_ids = $rbacreview->assignedUsers($this->contributor_role_id);
71  }
72 
73  include_once "Services/User/classes/class.ilUserUtil.php";
74 
75  $data = array();
76  foreach($this->contributor_ids as $id)
77  {
78  if(!in_array($id, $assigned))
79  {
80  $data[] = array("id" => $id,
81  "name" => ilUserUtil::getNamePresentation($id, false, false, "", true));
82  }
83  }
84 
85  $this->setData($data);
86  }
87 
93  protected function fillRow($a_set)
94  {
95  $this->tpl->setVariable("VAL_ID", $a_set["id"]);
96  $this->tpl->setVariable("TXT_NAME", $a_set["name"]);
97  }
98 }
99 
100 ?>
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
__construct($a_parent_obj, $a_parent_cmd, $a_contributor_role_id, array $a_contributor_ids=null)
Constructor.
getItems()
Get all completed tests.
fillRow($a_set)
Fill template row.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true)
Default behaviour is:
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
List all contributors members of a blog.