ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjObjectFolderGUI Class Reference

Class ilObjObjectFolderGUI. More...

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

Public Member Functions

 ilObjObjectFolderGUI ($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 (&$tabs_gui)
 get tabs @access public More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 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...
 

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
 
 $ilias
 
 $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 ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 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...
 
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Member Function Documentation

◆ displayList()

ilObjObjectFolderGUI::displayList ( )

display object list

@access public

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

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

References $_GET, ilObjectGUI\$data, $tbl, 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 236 of file class.ilObjObjectFolderGUI.php.

237 {
238 $next_class = $this->ctrl->getNextClass($this);
239 $cmd = $this->ctrl->getCmd();
240 $this->prepareOutput();
241
242 switch($next_class)
243 {
244 case 'ilpermissiongui':
245 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
246 $perm_gui =& new ilPermissionGUI($this);
247 $ret =& $this->ctrl->forwardCommand($perm_gui);
248 break;
249
250 default:
251 if(!$cmd)
252 {
253 $cmd = "view";
254 }
255 $cmd .= "Object";
256 $this->$cmd();
257
258 break;
259 }
260 return true;
261 }
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getTabs()

ilObjObjectFolderGUI::getTabs ( $tabs_gui)

get tabs @access public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

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

269 {
270 global $rbacsystem;
271
272 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
273 {
274 $tabs_gui->addTarget("settings",
275 $this->ctrl->getLinkTarget($this, "view"), array("view",""), "", "");
276
277 $tabs_gui->addTarget("perm_settings",
278 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
279 }
280 }

◆ ilObjObjectFolderGUI()

ilObjObjectFolderGUI::ilObjObjectFolderGUI (   $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 48 of file class.ilObjObjectFolderGUI.php.

49 {
50 $this->type = "objf";
51 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
52 }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

References ilObjectGUI\ilObjectGUI().

+ Here is the call graph for this function:

◆ viewObject()

ilObjObjectFolderGUI::viewObject ( )

list childs of current object

@access public

Reimplemented from ilObjectGUI.

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

60 {
61 global $rbacsystem;
62
63 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
64 {
65 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
66 }
67
68 //prepare objectlist
69 $this->data = array();
70 $this->data["data"] = array();
71 $this->data["ctrl"] = array();
72
73 $this->data["cols"] = array("type","title","last_change");
74
75 $this->maxcount = count($this->data["data"]);
76
77 // now compute control information
78 foreach ($this->data["data"] as $key => $val)
79 {
80 $this->data["ctrl"][$key] = array(
81 "ref_id" => $this->id,
82 "obj_id" => $val["obj_id"],
83 "type" => $val["type"],
84 );
85
86 unset($this->data["data"][$key]["obj_id"]);
87 $this->data["data"][$key]["last_change"] = ilDatePresentation::formatDate(new ilDateTime($this->data["data"][$key]["last_change"],IL_CAL_DATETIME));
88 }
89
90 $this->displayList();
91 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
displayList()
display object list
redirection script todo: (a better solution should control the processing via a xml file)

References displayList(), ilDatePresentation\formatDate(), and IL_CAL_DATETIME.

+ Here is the call graph for this function:

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