ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
 
 $ctrl
 
 $tpl
 
 $toolbar
 
 $lng
 
 $obj_definition
 
 $tree
 
 $user_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjectOwnershipManagementGUI::__construct (   $a_user_id = null)

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

References $DIC, $ilUser, and user().

54  {
55  global $DIC;
56 
57  $this->user = $DIC->user();
58  $this->ctrl = $DIC->ctrl();
59  $this->tpl = $DIC["tpl"];
60  $this->toolbar = $DIC->toolbar();
61  $this->lng = $DIC->language();
62  $this->obj_definition = $DIC["objDefinition"];
63  $this->tree = $DIC->repositoryTree();
64  $ilUser = $DIC->user();
65 
66  if ($a_user_id === null) {
67  $a_user_id = $ilUser->getId();
68  }
69  $this->user_id = (int) $a_user_id;
70  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilObjectOwnershipManagementGUI::applyFilter ( )

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

References $tbl, and listObjects().

150  {
151  include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
152  $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id);
153  $tbl->resetOffset();
154  $tbl->writeFilterToSession();
155  $this->listObjects();
156  }
$tbl
Definition: example_048.php:81
+ Here is the call graph for this function:

◆ changeOwner()

ilObjectOwnershipManagementGUI::changeOwner ( )

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

References redirectCmd().

235  {
236  $ref_id = (int) $_REQUEST["ownid"];
237  $this->redirectCmd($ref_id, "ilPermissionGUI", "owner");
238  }
+ Here is the call graph for this function:

◆ delete()

ilObjectOwnershipManagementGUI::delete ( )

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

References redirectParentCmd().

217  {
218  $ref_id = (int) $_REQUEST["ownid"];
219  $this->redirectParentCmd($ref_id, "delete");
220  }
+ Here is the call graph for this function:

◆ executeCommand()

ilObjectOwnershipManagementGUI::executeCommand ( )

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

References $ctrl, and $ilCtrl.

73  {
75 
76  $next_class = $ilCtrl->getNextClass($this);
77  $cmd = $ilCtrl->getCmd();
78 
79  switch ($next_class) {
80  default:
81  if (!$cmd) {
82  $cmd = "listObjects";
83  }
84  $this->$cmd();
85  break;
86  }
87 
88  return true;
89  }
global $ilCtrl
Definition: ilias.php:18

◆ export()

ilObjectOwnershipManagementGUI::export ( )

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

References redirectCmd().

229  {
230  $ref_id = (int) $_REQUEST["ownid"];
231  $this->redirectCmd($ref_id, "ilExportGUI");
232  }
+ Here is the call graph for this function:

◆ listObjects()

ilObjectOwnershipManagementGUI::listObjects ( )

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

References $ctrl, $ilCtrl, $lng, $obj_definition, PHPMailer\PHPMailer\$options, $tbl, $toolbar, $tpl, $type, ilObject\fixMissingTitles(), ilObject\getAllOwnedRepositoryObjects(), ilSubmitButton\getInstance(), and ilObjectPlugin\lookupTxtById().

Referenced by applyFilter(), and resetFilter().

92  {
93  $tpl = $this->tpl;
94  $ilToolbar = $this->toolbar;
95  $lng = $this->lng;
97  $objDefinition = $this->obj_definition;
98 
99  $sel_type = '';
100 
101  $objects = ilObject::getAllOwnedRepositoryObjects($this->user_id);
102 
103  if (sizeof($objects)) {
104  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "listObjects"));
105 
106  include_once "Services/Form/classes/class.ilSelectInputGUI.php";
107  $sel = new ilSelectInputGUI($lng->txt("type"), "type");
108  $ilToolbar->addStickyItem($sel, true);
109 
110  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
111  $button = ilSubmitButton::getInstance();
112  $button->setCaption("ok");
113  $button->setCommand("listObjects");
114  $ilToolbar->addStickyItem($button);
115 
116  $options = array();
117  foreach (array_keys($objects) as $type) {
118  // #11050
119  if (!$objDefinition->isPlugin($type)) {
120  $options[$type] = $lng->txt("obj_" . $type);
121  } else {
122  include_once("./Services/Component/classes/class.ilPlugin.php");
123  $options[$type] = ilObjectPlugin::lookupTxtById($type, "obj_" . $type);
124  }
125  }
126  asort($options);
127  $sel->setOptions($options);
128 
129  $sel_type = (string) $_REQUEST["type"];
130  if ($sel_type) {
131  $sel->setValue($sel_type);
132  } else {
133  $sel_type = array_keys($options);
134  $sel_type = array_shift($sel_type);
135  }
136  $ilCtrl->setParameter($this, "type", $sel_type);
137  }
138 
139  // #17751
140  if (is_array($objects[$sel_type]) && sizeof($objects[$sel_type])) {
141  ilObject::fixMissingTitles($sel_type, $objects[$sel_type]);
142  }
143 
144  include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
145  $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id, $objects[$sel_type]);
146  $tpl->setContent($tbl->getHTML());
147  }
static lookupTxtById($plugin_id, $lang_var)
This class represents a selection list property in a property form.
$type
static getAllOwnedRepositoryObjects($a_user_id)
Get all ids of objects user owns.
$tbl
Definition: example_048.php:81
global $ilCtrl
Definition: ilias.php:18
static fixMissingTitles($a_type, array &$a_obj_title_map)
Try to fix missing object titles.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move()

ilObjectOwnershipManagementGUI::move ( )

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

References redirectParentCmd().

223  {
224  $ref_id = (int) $_REQUEST["ownid"];
225  $this->redirectParentCmd($ref_id, "cut");
226  }
+ Here is the call graph for this function:

◆ redirectCmd()

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

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

References $ctrl, $ilCtrl, $obj_definition, $path, and $tree.

Referenced by changeOwner(), and export().

180  {
182  $tree = $this->tree;
183  $objDefinition = $this->obj_definition;
184 
185  $node = $tree->getNodeData($a_ref_id);
186  $gui_class = "ilObj" . $objDefinition->getClassName($node["type"]) . "GUI";
187  $path = array("ilRepositoryGUI", $gui_class, $a_class);
188 
189  // #10495 - check if object type supports ilexportgui "directly"
190  if ($a_class == "ilExportGUI") {
191  try {
192  $ilCtrl->getLinkTargetByClass($path);
193  } catch (Exception $e) {
194  switch ($node["type"]) {
195  case "glo":
196  $cmd = "exportList";
197  $path = array("ilRepositoryGUI", "ilGlossaryEditorGUI", $gui_class);
198  break;
199 
200  default:
201  $cmd = "export";
202  $path = array("ilRepositoryGUI", $gui_class);
203  break;
204  }
205  $ilCtrl->setParameterByClass($gui_class, "ref_id", $a_ref_id);
206  $ilCtrl->setParameterByClass($gui_class, "cmd", $cmd);
207  $ilCtrl->redirectByClass($path);
208  }
209  }
210 
211  $ilCtrl->setParameterByClass($a_class, "ref_id", $a_ref_id);
212  $ilCtrl->setParameterByClass($a_class, "cmd", $a_cmd);
213  $ilCtrl->redirectByClass($path);
214  }
$path
Definition: aliased.php:25
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ redirectParentCmd()

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

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

References $ctrl, $ilCtrl, and $tree.

Referenced by delete(), and move().

168  {
169  $tree = $this->tree;
171 
172  $parent = $tree->getParentId($a_ref_id);
173  $ilCtrl->setParameterByClass("ilRepositoryGUI", "ref_id", $parent);
174  $ilCtrl->setParameterByClass("ilRepositoryGUI", "item_ref_id", $a_ref_id);
175  $ilCtrl->setParameterByClass("ilRepositoryGUI", "cmd", $a_cmd);
176  $ilCtrl->redirectByClass("ilRepositoryGUI");
177  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ resetFilter()

ilObjectOwnershipManagementGUI::resetFilter ( )

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

References $tbl, and listObjects().

159  {
160  include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
161  $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id);
162  $tbl->resetOffset();
163  $tbl->resetFilter();
164  $this->listObjects();
165  }
$tbl
Definition: example_048.php:81
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilObjectOwnershipManagementGUI::$ctrl
protected

◆ $lng

ilObjectOwnershipManagementGUI::$lng
protected

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

Referenced by listObjects().

◆ $obj_definition

ilObjectOwnershipManagementGUI::$obj_definition
protected

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

Referenced by listObjects(), and redirectCmd().

◆ $toolbar

ilObjectOwnershipManagementGUI::$toolbar
protected

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

Referenced by listObjects().

◆ $tpl

ilObjectOwnershipManagementGUI::$tpl
protected

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

Referenced by listObjects().

◆ $tree

ilObjectOwnershipManagementGUI::$tree
protected

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

Referenced by redirectCmd(), and redirectParentCmd().

◆ $user

ilObjectOwnershipManagementGUI::$user
protected

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

◆ $user_id

ilObjectOwnershipManagementGUI::$user_id
protected

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


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