ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 getTabs (&$tabs_gui)
 get tabs public More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor 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 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...
 
 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 public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 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)
 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...
 

Detailed Description

Member Function Documentation

◆ displayList()

ilObjObjectFolderGUI::displayList ( )

display object list

public

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

References $_GET, ilObjectGUI\$data, and ilUtil\switchColor().

Referenced by viewObject().

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(),"icon_".$this->object->getType()."_b.png",$this->lng->txt("obj_".$this->object->getType()));
120  $tbl->setHelp("tbl_help.php","icon_help.png",$this->lng->txt("help"));
121 
122  foreach ($this->data["cols"] as $val)
123  {
124  $header_names[] = $this->lng->txt($val);
125  }
126 
127  $tbl->setHeaderNames($header_names);
128 
129  //$header_params = array("ref_id" => $this->ref_id);
130  $header_params = $this->ctrl->getParameterArray($this, "view");
131  $tbl->setHeaderVars($this->data["cols"],$header_params);
132  $tbl->setColumnWidth(array("15","75%","25%"));
133 
134  // control
135  $tbl->setOrderColumn($_GET["sort_by"]);
136  $tbl->setOrderDirection($_GET["sort_order"]);
137  $tbl->setLimit($_GET["limit"]);
138  $tbl->setOffset($_GET["offset"]);
139  $tbl->setMaxCount($this->maxcount);
140 
141  // footer
142  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
143  //$tbl->disable("footer");
144 
145  // render table
146  $tbl->render();
147 
148  if (is_array($this->data["data"][0]))
149  {
150  //table cell
151  for ($i=0; $i < count($this->data["data"]); $i++)
152  {
153  $data = $this->data["data"][$i];
154  $ctrl = $this->data["ctrl"][$i];
155 
156  // color changing
157  $css_row = ilUtil::switchColor($i+1,"tblrow1","tblrow2");
158 
159  $this->tpl->setCurrentBlock("table_cell");
160  $this->tpl->setVariable("CELLSTYLE", "tblrow1");
161  $this->tpl->parseCurrentBlock();
162 
163  foreach ($data as $key => $val)
164  {
165  //build link
166  /*
167 
168  $n = 0;
169 
170  foreach ($ctrl as $key2 => $val2)
171  {
172  $link .= $key2."=".$val2;
173 
174  if ($n < count($ctrl)-1)
175  {
176  $link .= "&";
177  $n++;
178  }
179  }
180 
181  if ($key == "title")
182  {
183  $name_field = explode("#separator#",$val);
184  }
185 
186  if ($key == "title" || $key == "type")
187  {
188  $this->tpl->setCurrentBlock("begin_link");
189  $this->tpl->setVariable("LINK_TARGET", $link);
190 
191  $this->tpl->parseCurrentBlock();
192  $this->tpl->touchBlock("end_link");
193  }
194 
195  $this->tpl->setCurrentBlock("text");
196 
197  if ($key == "type")
198  {
199  $val = ilUtil::getImageTagByType($val,$this->tpl->tplPath);
200  }
201 
202  if ($key == "title")
203  {
204  $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
205 
206  $this->tpl->setCurrentBlock("subtitle");
207  $this->tpl->setVariable("DESC", $name_field[1]);
208  $this->tpl->parseCurrentBlock();
209  }
210  else
211  {
212  $this->tpl->setVariable("TEXT_CONTENT", $val);
213  }
214 
215  $this->tpl->parseCurrentBlock();
216 
217  $this->tpl->setCurrentBlock("table_cell");
218  $this->tpl->parseCurrentBlock();
219  */
220  } //foreach
221 
222  $this->tpl->setCurrentBlock("tbl_content");
223  $this->tpl->setVariable("CSS_ROW", $css_row);
224  $this->tpl->parseCurrentBlock();
225  } //for
226 
227  } //if is_array
228  else
229  {
230  $this->tpl->setCurrentBlock("notfound");
231  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
232  $this->tpl->setVariable("NUM_COLS", $num);
233  $this->tpl->parseCurrentBlock();
234  }
235  }
$_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) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

& ilObjObjectFolderGUI::executeCommand ( )

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

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

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

◆ getTabs()

ilObjObjectFolderGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

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

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

◆ 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 public

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

References ilObjectGUI\ilObjectGUI().

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 public.
+ Here is the call graph for this function:

◆ viewObject()

ilObjObjectFolderGUI::viewObject ( )

list childs of current object

public

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

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

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
displayList()
display object list
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

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