ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 17 of file class.ilObjectOwnershipManagementGUI.php.

References $ilUser.

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

Member Function Documentation

◆ applyFilter()

ilObjectOwnershipManagementGUI::applyFilter ( )

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

References $tbl, and listObjects().

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

◆ changeOwner()

ilObjectOwnershipManagementGUI::changeOwner ( )

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

References $_REQUEST, $ref_id, and redirectCmd().

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

◆ delete()

ilObjectOwnershipManagementGUI::delete ( )

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

References $_REQUEST, $ref_id, and redirectParentCmd().

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

◆ executeCommand()

& ilObjectOwnershipManagementGUI::executeCommand ( )

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

References $cmd, and $ilCtrl.

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

◆ export()

ilObjectOwnershipManagementGUI::export ( )

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

References $_REQUEST, $ref_id, and redirectCmd().

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

◆ listObjects()

ilObjectOwnershipManagementGUI::listObjects ( )

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

References $_REQUEST, $ilCtrl, $lng, $options, $tbl, $tpl, ilObject\fixMissingTitles(), ilObject\getAllOwnedRepositoryObjects(), ilSubmitButton\getInstance(), and ilPlugin\lookupTxt().

Referenced by applyFilter(), and resetFilter().

50  {
51  global $tpl, $ilToolbar, $lng, $ilCtrl, $objDefinition;
52 
53  $objects = ilObject::getAllOwnedRepositoryObjects($this->user_id);
54 
55  if(sizeof($objects))
56  {
57  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "listObjects"));
58 
59  include_once "Services/Form/classes/class.ilSelectInputGUI.php";
60  $sel = new ilSelectInputGUI($lng->txt("type"), "type");
61  $ilToolbar->addStickyItem($sel, true);
62 
63  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
64  $button = ilSubmitButton::getInstance();
65  $button->setCaption("ok");
66  $button->setCommand("listObjects");
67  $ilToolbar->addStickyItem($button);
68 
69  $options = array();
70  foreach(array_keys($objects) as $type)
71  {
72  // #11050
73  if(!$objDefinition->isPlugin($type))
74  {
75  $options[$type] = $lng->txt("obj_".$type);
76  }
77  else
78  {
79  include_once("./Services/Component/classes/class.ilPlugin.php");
80  $options[$type] = ilPlugin::lookupTxt("rep_robj", $type, "obj_".$type);
81  }
82  }
83  asort($options);
84  $sel->setOptions($options);
85 
86  $sel_type = (string)$_REQUEST["type"];
87  if($sel_type)
88  {
89  $sel->setValue($sel_type);
90  }
91  else
92  {
93  $sel_type = array_keys($options);
94  $sel_type = array_shift($sel_type);
95  }
96  $ilCtrl->setParameter($this, "type", $sel_type);
97  }
98 
99  // #17751
100  if(sizeof($objects[$sel_type]))
101  {
102  ilObject::fixMissingTitles($sel_type, $objects[$sel_type]);
103  }
104 
105  include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
106  $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id, $objects[$sel_type]);
107  $tpl->setContent($tbl->getHTML());
108  }
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
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
if(!is_array($argv)) $options
static fixMissingTitles($a_type, array &$a_obj_title_map)
Try to fix missing object titles.
global $lng
Definition: privfeed.php:40
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move()

ilObjectOwnershipManagementGUI::move ( )

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

References $_REQUEST, $ref_id, and redirectParentCmd().

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

◆ redirectCmd()

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

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

References $cmd, $ilCtrl, and $path.

Referenced by changeOwner(), and export().

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

◆ redirectParentCmd()

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

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

References $ilCtrl.

Referenced by delete(), and move().

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

◆ resetFilter()

ilObjectOwnershipManagementGUI::resetFilter ( )

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

References $tbl, and listObjects().

120  {
121  include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
122  $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id);
123  $tbl->resetOffset();
124  $tbl->resetFilter();
125  $this->listObjects();
126  }
$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 15 of file class.ilObjectOwnershipManagementGUI.php.


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