ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjObjectFolderGUI Class Reference

Class ilObjObjectFolderGUI. More...

+ Inheritance diagram for ilObjObjectFolderGUI:
+ Collaboration diagram for ilObjObjectFolderGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference)
 Constructor. More...
 
 viewObject ()
 list childs of current object More...
 
 displayList ()
 display object list More...
 
 executeCommand ()
 execute command More...
 
 getTabs ()
 get tabs @access public More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Protected Attributes

 $rbacsystem
 
 $error
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjObjectFolderGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Constructor.

Parameters
arraybasic object data
integerref_id or obj_id (depends on referenced-flag)
booleantrue: treat id as ref_id; false: treat id as obj_id @access public

Definition at line 58 of file class.ilObjObjectFolderGUI.php.

59 {
60 global $DIC;
61
62 $this->rbacsystem = $DIC->rbac()->system();
63 $this->error = $DIC["ilErr"];
64 $this->type = "objf";
65 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
66 }
error($a_errmsg)
set error message @access public
global $DIC
Definition: saml.php:7

References $DIC, and error().

+ Here is the call graph for this function:

Member Function Documentation

◆ displayList()

ilObjObjectFolderGUI::displayList ( )

display object list

@access public

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

112 {
113 include_once "./Services/Table/classes/class.ilTableGUI.php";
114 return;
115
116 // load template for table
117 $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
118
119 // load template for table content data
120 $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
121
122 $num = 0;
123
124 $obj_str = ($this->call_by_reference) ? "" : "&obj_id=" . $this->obj_id;
125 $this->tpl->setVariable(
126 "FORMACTION",
127 $this->ctrl->getFormAction($this)
128 );
129
130 // create table
131 $tbl = new ilTableGUI();
132
133 // title & header columns
134 $tbl->setTitle($this->object->getTitle());
135
136 foreach ($this->data["cols"] as $val) {
137 $header_names[] = $this->lng->txt($val);
138 }
139
140 $tbl->setHeaderNames($header_names);
141
142 //$header_params = array("ref_id" => $this->ref_id);
143 $header_params = $this->ctrl->getParameterArray($this, "view");
144 $tbl->setHeaderVars($this->data["cols"], $header_params);
145 $tbl->setColumnWidth(array("15","75%","25%"));
146
147 // control
148 $tbl->setOrderColumn($_GET["sort_by"]);
149 $tbl->setOrderDirection($_GET["sort_order"]);
150 $tbl->setLimit($_GET["limit"]);
151 $tbl->setOffset($_GET["offset"]);
152 $tbl->setMaxCount($this->maxcount);
153
154 // footer
155 $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
156 //$tbl->disable("footer");
157
158 // render table
159 $tbl->render();
160
161 if (is_array($this->data["data"][0])) {
162 //table cell
163 for ($i=0; $i < count($this->data["data"]); $i++) {
164 $data = $this->data["data"][$i];
165 $ctrl = $this->data["ctrl"][$i];
166
167 // color changing
168 $css_row = ilUtil::switchColor($i+1, "tblrow1", "tblrow2");
169
170 $this->tpl->setCurrentBlock("table_cell");
171 $this->tpl->setVariable("CELLSTYLE", "tblrow1");
172 $this->tpl->parseCurrentBlock();
173
174 foreach ($data as $key => $val) {
175 //build link
176 /*
177
178 $n = 0;
179
180 foreach ($ctrl as $key2 => $val2)
181 {
182 $link .= $key2."=".$val2;
183
184 if ($n < count($ctrl)-1)
185 {
186 $link .= "&";
187 $n++;
188 }
189 }
190
191 if ($key == "title")
192 {
193 $name_field = explode("#separator#",$val);
194 }
195
196 if ($key == "title" || $key == "type")
197 {
198 $this->tpl->setCurrentBlock("begin_link");
199 $this->tpl->setVariable("LINK_TARGET", $link);
200
201 $this->tpl->parseCurrentBlock();
202 $this->tpl->touchBlock("end_link");
203 }
204
205 $this->tpl->setCurrentBlock("text");
206
207 if ($key == "type")
208 {
209 $val = ilUtil::getImageTagByType($val,$this->tpl->tplPath);
210 }
211
212 if ($key == "title")
213 {
214 $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
215
216 $this->tpl->setCurrentBlock("subtitle");
217 $this->tpl->setVariable("DESC", $name_field[1]);
218 $this->tpl->parseCurrentBlock();
219 }
220 else
221 {
222 $this->tpl->setVariable("TEXT_CONTENT", $val);
223 }
224
225 $this->tpl->parseCurrentBlock();
226
227 $this->tpl->setCurrentBlock("table_cell");
228 $this->tpl->parseCurrentBlock();
229 */
230 } //foreach
231
232 $this->tpl->setCurrentBlock("tbl_content");
233 $this->tpl->setVariable("CSS_ROW", $css_row);
234 $this->tpl->parseCurrentBlock();
235 } //for
236 } //if is_array
237 else {
238 $this->tpl->setCurrentBlock("notfound");
239 $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
240 $this->tpl->setVariable("NUM_COLS", $num);
241 $this->tpl->parseCurrentBlock();
242 }
243 }
$_GET["client_id"]
Class ilTableGUI.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows)
$key
Definition: croninfo.php:18
$i
Definition: disco.tpl.php:19
$tbl
Definition: example_048.php:81
$this data['403_header']

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$data, $i, $key, $tbl, data, and ilUtil\switchColor().

Referenced by viewObject().

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

◆ executeCommand()

ilObjObjectFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 245 of file class.ilObjObjectFolderGUI.php.

246 {
247 $next_class = $this->ctrl->getNextClass($this);
248 $cmd = $this->ctrl->getCmd();
249 $this->prepareOutput();
250
251 switch ($next_class) {
252 case 'ilpermissiongui':
253 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
254 $perm_gui = new ilPermissionGUI($this);
255 $ret =&$this->ctrl->forwardCommand($perm_gui);
256 break;
257
258 default:
259 if (!$cmd) {
260 $cmd = "view";
261 }
262 $cmd .= "Object";
263 $this->$cmd();
264
265 break;
266 }
267 return true;
268 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6

References $ret, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getTabs()

ilObjObjectFolderGUI::getTabs ( )

get tabs @access public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 275 of file class.ilObjObjectFolderGUI.php.

276 {
278
279 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
280 $this->tabs_gui->addTarget(
281 "settings",
282 $this->ctrl->getLinkTarget($this, "view"),
283 array("view",""),
284 "",
285 ""
286 );
287
288 $this->tabs_gui->addTarget(
289 "perm_settings",
290 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
291 array("perm","info","owner"),
292 'ilpermissiongui'
293 );
294 }
295 }

References $rbacsystem.

◆ viewObject()

ilObjObjectFolderGUI::viewObject ( )

list childs of current object

@access public

Reimplemented from ilObjectGUI.

Definition at line 73 of file class.ilObjObjectFolderGUI.php.

74 {
77
78 if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
79 $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
80 }
81
82 //prepare objectlist
83 $this->data = array();
84 $this->data["data"] = array();
85 $this->data["ctrl"] = array();
86
87 $this->data["cols"] = array("type","title","last_change");
88
89 $this->maxcount = count($this->data["data"]);
90
91 // now compute control information
92 foreach ($this->data["data"] as $key => $val) {
93 $this->data["ctrl"][$key] = array(
94 "ref_id" => $this->id,
95 "obj_id" => $val["obj_id"],
96 "type" => $val["type"],
97 );
98
99 unset($this->data["data"][$key]["obj_id"]);
100 $this->data["data"][$key]["last_change"] = ilDatePresentation::formatDate(new ilDateTime($this->data["data"][$key]["last_change"], IL_CAL_DATETIME));
101 }
102
103 $this->displayList();
104 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
displayList()
display object list

References $error, ilObjectGUI\$ilErr, $key, $rbacsystem, data, displayList(), ilDatePresentation\formatDate(), and IL_CAL_DATETIME.

+ Here is the call graph for this function:

Field Documentation

◆ $error

ilObjObjectFolderGUI::$error
protected

Definition at line 48 of file class.ilObjObjectFolderGUI.php.

Referenced by viewObject().

◆ $rbacsystem

ilObjObjectFolderGUI::$rbacsystem
protected

Definition at line 43 of file class.ilObjObjectFolderGUI.php.

Referenced by getTabs(), and viewObject().


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