ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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.

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

References $ilUser.

Member Function Documentation

◆ applyFilter()

ilObjectOwnershipManagementGUI::applyFilter ( )

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

100 {
101 include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
102 $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id);
103 $tbl->resetOffset();
104 $tbl->writeFilterToSession();
105 $this->listObjects();
106 }

References listObjects().

+ Here is the call graph for this function:

◆ changeOwner()

ilObjectOwnershipManagementGUI::changeOwner ( )

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

187 {
188 $ref_id = (int)$_REQUEST["ownid"];
189 $this->redirectCmd($ref_id, "ilPermissionGUI", "owner");
190 }
$ref_id
Definition: sahs_server.php:39
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

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

+ Here is the call graph for this function:

◆ delete()

ilObjectOwnershipManagementGUI::delete ( )

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

169 {
170 $ref_id = (int)$_REQUEST["ownid"];
171 $this->redirectParentCmd($ref_id, "delete");
172 }

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

+ Here is the call graph for this function:

◆ executeCommand()

& ilObjectOwnershipManagementGUI::executeCommand ( )

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

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 }
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35

References $cmd, and $ilCtrl.

◆ export()

ilObjectOwnershipManagementGUI::export ( )

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

181 {
182 $ref_id = (int)$_REQUEST["ownid"];
183 $this->redirectCmd($ref_id, "ilExportGUI");
184 }

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

+ Here is the call graph for this function:

◆ listObjects()

ilObjectOwnershipManagementGUI::listObjects ( )

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

50 {
51 global $tpl, $ilToolbar, $lng, $ilCtrl, $objDefinition;
52
53
54 $objects = ilObject::getAllOwnedRepositoryObjects($this->user_id);
55
56 if(sizeof($objects))
57 {
58 include_once "Services/Form/classes/class.ilSelectInputGUI.php";
59 $sel = new ilSelectInputGUI($lng->txt("type"), "type");
60 $ilToolbar->addInputItem($sel, true);
61 $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "listObjects"));
62 $ilToolbar->addFormButton($lng->txt("ok"), "listObjects");
63
64 $options = array();
65 foreach(array_keys($objects) as $type)
66 {
67 // #11050
68 if(!$objDefinition->isPlugin($type))
69 {
70 $options[$type] = $lng->txt("obj_".$type);
71 }
72 else
73 {
74 include_once("./Services/Component/classes/class.ilPlugin.php");
75 $options[$type] = ilPlugin::lookupTxt("rep_robj", $type, "obj_".$type);
76 }
77 }
78 asort($options);
79 $sel->setOptions($options);
80
81 $sel_type = (string)$_REQUEST["type"];
82 if($sel_type)
83 {
84 $sel->setValue($sel_type);
85 }
86 else
87 {
88 $sel_type = array_keys($options);
89 $sel_type = array_shift($sel_type);
90 }
91 $ilCtrl->setParameter($this, "type", $sel_type);
92 }
93
94 include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
95 $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id, $objects[$sel_type]);
96 $tpl->setContent($tbl->getHTML());
97 }
global $tpl
Definition: ilias.php:8
static getAllOwnedRepositoryObjects($a_user_id)
Get all ids of objects user owns.
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
This class represents a selection list property in a property form.
global $lng
Definition: privfeed.php:40
if(!is_array($argv)) $options

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

Referenced by applyFilter(), and resetFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move()

ilObjectOwnershipManagementGUI::move ( )

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

175 {
176 $ref_id = (int)$_REQUEST["ownid"];
177 $this->redirectParentCmd($ref_id, "cut");
178 }

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

+ Here is the call graph for this function:

◆ redirectCmd()

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

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

129 {
130 global $ilCtrl, $tree, $objDefinition;
131
132 $node = $tree->getNodeData($a_ref_id);
133 $gui_class = "ilObj".$objDefinition->getClassName($node["type"])."GUI";
134 $path = array("ilRepositoryGUI", $gui_class, $a_class);
135
136 // #10495 - check if object type supports ilexportgui "directly"
137 if($a_class == "ilExportGUI")
138 {
139 try
140 {
141 $ilCtrl->getLinkTargetByClass($path);
142 }
143 catch(Exception $e)
144 {
145 switch($node["type"])
146 {
147 case "glo":
148 $cmd = "exportList";
149 $path = array("ilRepositoryGUI", "ilGlossaryEditorGUI", $gui_class);
150 break;
151
152 default:
153 $cmd = "export";
154 $path = array("ilRepositoryGUI", $gui_class);
155 break;
156 }
157 $ilCtrl->setParameterByClass($gui_class, "ref_id", $a_ref_id);
158 $ilCtrl->setParameterByClass($gui_class, "cmd", $cmd);
159 $ilCtrl->redirectByClass($path);
160 }
161 }
162
163 $ilCtrl->setParameterByClass($a_class, "ref_id", $a_ref_id);
164 $ilCtrl->setParameterByClass($a_class, "cmd", $a_cmd);
165 $ilCtrl->redirectByClass($path);
166 }
$path
Definition: index.php:22

References $cmd, $ilCtrl, and $path.

Referenced by changeOwner(), and export().

+ Here is the caller graph for this function:

◆ redirectParentCmd()

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

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

118 {
119 global $tree, $ilCtrl;
120
121 $parent = $tree->getParentId($a_ref_id);
122 $ilCtrl->setParameterByClass("ilRepositoryGUI", "ref_id", $parent);
123 $ilCtrl->setParameterByClass("ilRepositoryGUI", "item_ref_id", $a_ref_id);
124 $ilCtrl->setParameterByClass("ilRepositoryGUI", "cmd", $a_cmd);
125 $ilCtrl->redirectByClass("ilRepositoryGUI");
126 }

References $ilCtrl.

Referenced by delete(), and move().

+ Here is the caller graph for this function:

◆ resetFilter()

ilObjectOwnershipManagementGUI::resetFilter ( )

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

109 {
110 include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
111 $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id);
112 $tbl->resetOffset();
113 $tbl->resetFilter();
114 $this->listObjects();
115 }

References listObjects().

+ 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: