ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjectOwnershipManagementGUI Class Reference

Class ilObjectOwnershipManagementGUI. More...

+ Collaboration diagram for ilObjectOwnershipManagementGUI:

Public Member Functions

 __construct ($a_user_id=null)
 
 executeCommand ()
 
 listObjects ()
 
 applyFilter ()
 
 resetFilter ()
 
 delete ()
 
 move ()
 
 export ()
 
 changeOwner ()
 

Protected Member Functions

 redirectParentCmd ($a_ref_id, $a_cmd)
 
 redirectCmd ($a_ref_id, $a_class, $a_cmd=null)
 

Protected Attributes

 $user_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjectOwnershipManagementGUI::__construct (   $a_user_id = null)

Definition at line 18 of file class.ilObjectOwnershipManagementGUI.php.

References $ilUser.

19  {
20  global $ilUser;
21 
22  if($a_user_id === null)
23  {
24  $a_user_id = $ilUser->getId();
25  }
26  $this->user_id = (int)$a_user_id;
27  }
$ilUser
Definition: imgupload.php:18

Member Function Documentation

◆ applyFilter()

ilObjectOwnershipManagementGUI::applyFilter ( )

Definition at line 111 of file class.ilObjectOwnershipManagementGUI.php.

References $tbl, and listObjects().

112  {
113  include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
114  $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id);
115  $tbl->resetOffset();
116  $tbl->writeFilterToSession();
117  $this->listObjects();
118  }
$tbl
Definition: example_048.php:81
+ Here is the call graph for this function:

◆ changeOwner()

ilObjectOwnershipManagementGUI::changeOwner ( )

Definition at line 198 of file class.ilObjectOwnershipManagementGUI.php.

References $ref_id, and redirectCmd().

199  {
200  $ref_id = (int)$_REQUEST["ownid"];
201  $this->redirectCmd($ref_id, "ilPermissionGUI", "owner");
202  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ delete()

ilObjectOwnershipManagementGUI::delete ( )

Definition at line 180 of file class.ilObjectOwnershipManagementGUI.php.

References $ref_id, and redirectParentCmd().

181  {
182  $ref_id = (int)$_REQUEST["ownid"];
183  $this->redirectParentCmd($ref_id, "delete");
184  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ executeCommand()

ilObjectOwnershipManagementGUI::executeCommand ( )

Definition at line 29 of file class.ilObjectOwnershipManagementGUI.php.

References $cmd, and $ilCtrl.

30  {
31  global $ilCtrl;
32 
33  $next_class =$ilCtrl->getNextClass($this);
34  $cmd = $ilCtrl->getCmd();
35 
36  switch($next_class)
37  {
38  default:
39  if(!$cmd)
40  {
41  $cmd = "listObjects";
42  }
43  $this->$cmd();
44  break;
45  }
46 
47  return true;
48  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18

◆ export()

ilObjectOwnershipManagementGUI::export ( )

Definition at line 192 of file class.ilObjectOwnershipManagementGUI.php.

References $ref_id, and redirectCmd().

193  {
194  $ref_id = (int)$_REQUEST["ownid"];
195  $this->redirectCmd($ref_id, "ilExportGUI");
196  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ listObjects()

ilObjectOwnershipManagementGUI::listObjects ( )

Definition at line 50 of file class.ilObjectOwnershipManagementGUI.php.

References $ilCtrl, $lng, $options, $tbl, $tpl, array, ilObject\fixMissingTitles(), ilObject\getAllOwnedRepositoryObjects(), ilSubmitButton\getInstance(), ilObjectPlugin\lookupTxtById(), and string.

Referenced by applyFilter(), and resetFilter().

51  {
52  global $tpl, $ilToolbar, $lng, $ilCtrl, $objDefinition;
53 
54  $objects = ilObject::getAllOwnedRepositoryObjects($this->user_id);
55 
56  if(sizeof($objects))
57  {
58  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "listObjects"));
59 
60  include_once "Services/Form/classes/class.ilSelectInputGUI.php";
61  $sel = new ilSelectInputGUI($lng->txt("type"), "type");
62  $ilToolbar->addStickyItem($sel, true);
63 
64  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
65  $button = ilSubmitButton::getInstance();
66  $button->setCaption("ok");
67  $button->setCommand("listObjects");
68  $ilToolbar->addStickyItem($button);
69 
70  $options = array();
71  foreach(array_keys($objects) as $type)
72  {
73  // #11050
74  if(!$objDefinition->isPlugin($type))
75  {
76  $options[$type] = $lng->txt("obj_".$type);
77  }
78  else
79  {
80  include_once("./Services/Component/classes/class.ilPlugin.php");
81  $options[$type] = ilObjectPlugin::lookupTxtById($type, "obj_".$type);
82  }
83  }
84  asort($options);
85  $sel->setOptions($options);
86 
87  $sel_type = (string)$_REQUEST["type"];
88  if($sel_type)
89  {
90  $sel->setValue($sel_type);
91  }
92  else
93  {
94  $sel_type = array_keys($options);
95  $sel_type = array_shift($sel_type);
96  }
97  $ilCtrl->setParameter($this, "type", $sel_type);
98  }
99 
100  // #17751
101  if(sizeof($objects[$sel_type]))
102  {
103  ilObject::fixMissingTitles($sel_type, $objects[$sel_type]);
104  }
105 
106  include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
107  $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id, $objects[$sel_type]);
108  $tpl->setContent($tbl->getHTML());
109  }
static lookupTxtById($plugin_id, $lang_var)
This class represents a selection list property in a property form.
static getAllOwnedRepositoryObjects($a_user_id)
Get all ids of objects user owns.
$tbl
Definition: example_048.php:81
Add rich text string
The name of the decorator.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
if(!is_array($argv)) $options
Create styles array
The data for the language used.
static fixMissingTitles($a_type, array &$a_obj_title_map)
Try to fix missing object titles.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move()

ilObjectOwnershipManagementGUI::move ( )

Definition at line 186 of file class.ilObjectOwnershipManagementGUI.php.

References $ref_id, and redirectParentCmd().

187  {
188  $ref_id = (int)$_REQUEST["ownid"];
189  $this->redirectParentCmd($ref_id, "cut");
190  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ redirectCmd()

ilObjectOwnershipManagementGUI::redirectCmd (   $a_ref_id,
  $a_class,
  $a_cmd = null 
)
protected

Definition at line 140 of file class.ilObjectOwnershipManagementGUI.php.

References $cmd, $ilCtrl, $path, and array.

Referenced by changeOwner(), and export().

141  {
142  global $ilCtrl, $tree, $objDefinition;
143 
144  $node = $tree->getNodeData($a_ref_id);
145  $gui_class = "ilObj".$objDefinition->getClassName($node["type"])."GUI";
146  $path = array("ilRepositoryGUI", $gui_class, $a_class);
147 
148  // #10495 - check if object type supports ilexportgui "directly"
149  if($a_class == "ilExportGUI")
150  {
151  try
152  {
153  $ilCtrl->getLinkTargetByClass($path);
154  }
155  catch(Exception $e)
156  {
157  switch($node["type"])
158  {
159  case "glo":
160  $cmd = "exportList";
161  $path = array("ilRepositoryGUI", "ilGlossaryEditorGUI", $gui_class);
162  break;
163 
164  default:
165  $cmd = "export";
166  $path = array("ilRepositoryGUI", $gui_class);
167  break;
168  }
169  $ilCtrl->setParameterByClass($gui_class, "ref_id", $a_ref_id);
170  $ilCtrl->setParameterByClass($gui_class, "cmd", $cmd);
171  $ilCtrl->redirectByClass($path);
172  }
173  }
174 
175  $ilCtrl->setParameterByClass($a_class, "ref_id", $a_ref_id);
176  $ilCtrl->setParameterByClass($a_class, "cmd", $a_cmd);
177  $ilCtrl->redirectByClass($path);
178  }
$path
Definition: aliased.php:25
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ redirectParentCmd()

ilObjectOwnershipManagementGUI::redirectParentCmd (   $a_ref_id,
  $a_cmd 
)
protected

Definition at line 129 of file class.ilObjectOwnershipManagementGUI.php.

References $ilCtrl.

Referenced by delete(), and move().

130  {
131  global $tree, $ilCtrl;
132 
133  $parent = $tree->getParentId($a_ref_id);
134  $ilCtrl->setParameterByClass("ilRepositoryGUI", "ref_id", $parent);
135  $ilCtrl->setParameterByClass("ilRepositoryGUI", "item_ref_id", $a_ref_id);
136  $ilCtrl->setParameterByClass("ilRepositoryGUI", "cmd", $a_cmd);
137  $ilCtrl->redirectByClass("ilRepositoryGUI");
138  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ resetFilter()

ilObjectOwnershipManagementGUI::resetFilter ( )

Definition at line 120 of file class.ilObjectOwnershipManagementGUI.php.

References $tbl, and listObjects().

121  {
122  include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
123  $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id);
124  $tbl->resetOffset();
125  $tbl->resetFilter();
126  $this->listObjects();
127  }
$tbl
Definition: example_048.php:81
+ Here is the call graph for this function:

Field Documentation

◆ $user_id

ilObjectOwnershipManagementGUI::$user_id
protected

Definition at line 16 of file class.ilObjectOwnershipManagementGUI.php.


The documentation for this class was generated from the following file: