ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilOrgUnitTreeGUI.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 require_once "./classes/class.ilObjectGUI.php";
5 
6 
17 class ilOrgUnitTreeGUI //extends ilObjectGUI
18 {
19  public function executeCommand()
20  {
21  global $ilCtrl;
22 
23  $next_class = $ilCtrl->getNextClass($this);
24  $cmd = $ilCtrl->getCmd();
25  #$this->prepareOutput();
26 
27  switch($next_class)
28  {
29  /*case 'ilpermissiongui':
30  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
31  $perm_gui =& new ilPermissionGUI($this);
32  $ret =& $this->ctrl->forwardCommand($perm_gui);
33  break;*/
34 
35  default:
36  if(!$cmd)
37  {
38  $cmd = "viewTree";
39  }
40  $cmd .= "Object";
41 
42  $this->$cmd();
43 
44  break;
45  }
46  return true;
47  }
48 
49  public function viewTreeObject()
50  {
51  global $tpl, $lng;
52 
53  require_once('Services/OrgUnit/classes/class.ilOrgUnitTree.php');
54  $tree = new ilOrgUnitTree();
55 
56  $root_unit = $tree->getRecursiveOrgUnitTree();
57 
58  $debug = '<pre>'.print_r($nodes,1).'</pre>';
59 
60  require_once('Services/OrgUnit/classes/class.ilOrgUnitTreeExplorerGUI.php');
61  $exp = new ilOrgUnitTreeExplorerGUI($root_unit);
62 
63  $tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.org_unit_tree.html', 'Services/OrgUnit');
64 
65  $tpl->setCurrentBlock('adm_content');
66 
67  $tpl->setVariable('ORG_UNIT_TREE_HEADER', $lng->txt('org_unit_tree_header'));
68 
69  $tpl->setVariable('ORG_UNIT_TREE_EXPLORER', $exp->getHTML());
70 
71  $tpl->parseCurrentBlock();
72  }
73 
74 
75  public function viewAssignedUnitsObject()
76  {
77  global $tpl, $lng;
78 
79  $user_id = (int)$_GET['obj_id'];
80 
81  require_once('Services/OrgUnit/classes/class.ilOrgUnitAssignmentTableGUI.php');
82  $tbl = new ilOrgUnitAssignmentTableGUI($this, 'viewAssignedUnits',$user_id);
83 
84  $tpl->setVariable('ADM_CONTENT', $tbl->getHTML());
85  }
86 
87 }
88 
89 ?>