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

Class ilCourseArchivesGUI. More...

+ Inheritance diagram for ilCourseArchivesGUI:
+ Collaboration diagram for ilCourseArchivesGUI:

Public Member Functions

 ilCourseArchivesGUI (&$content_gui)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 view ()
 
 confirmDeleteArchives ()
 
 delete ()
 
 selectXMLArchiveItems ()
 Select items for archive. More...
 
 addXMLArchive ()
 
 selectArchiveLanguage ()
 
 addHTMLArchive ()
 
 downloadArchives ()
 
 __showArchivesMenu ()
 
 __initCourseObject ()
 
- 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...
 

Data Fields

 $container_obj
 
 $course_obj
 
 $tpl
 
 $ctrl
 
 $lng
 
 $tabs_gui
 
- 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
 

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...
 
- 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

Class ilCourseArchivesGUI.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

@ilCtrl_Calls ilCourseArchivesGUI: ilObjectCopyGUI

Definition at line 35 of file class.ilCourseArchivesGUI.php.

Member Function Documentation

◆ __initCourseObject()

ilCourseArchivesGUI::__initCourseObject ( )

Definition at line 492 of file class.ilCourseArchivesGUI.php.

493 {
494 global $tree;
495
496 if($this->content_obj->getType() == 'crs')
497 {
498 // Container is course
499 $this->course_obj =& $this->content_obj;
500 }
501 else
502 {
503 $course_ref_id = $tree->checkForParentType($this->content_obj->getRefId(),'crs');
504 $this->course_obj =& ilObjectFactory::getInstanceByRefId($course_ref_id);
505 }
506 return true;
507 }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id

References ilObjectGUI\$tree, and ilObjectFactory\getInstanceByRefId().

Referenced by ilCourseArchivesGUI().

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

◆ __showArchivesMenu()

ilCourseArchivesGUI::__showArchivesMenu ( )

Definition at line 455 of file class.ilCourseArchivesGUI.php.

456 {
457 if(!$this->is_tutor)
458 {
459 return false;
460 }
461 $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
462
463 if(!PATH_TO_ZIP)
464 {
465 ilUtil::sendFailure($this->lng->txt('zip_test_failed'));
466 return true;
467 }
468 /*
469 $this->tpl->setCurrentBlock("btn_cell");
470 $link = $this->ctrl->getLinkTargetByClass(
471 'ilobjectcopygui',
472 'initSourceSelection'
473 );
474 $this->tpl->setVariable('BTN_LINK',$link);
475 $this->tpl->setVariable("BTN_TXT", $this->lng->txt("clone_existing_course"));
476 $this->tpl->parseCurrentBlock();
477 */
478 // create xml archive button
479 $this->tpl->setCurrentBlock("btn_cell");
480 $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "selectXMLArchiveItems"));
481 $this->tpl->setVariable("BTN_TXT", $this->lng->txt("crs_add_archive_xml"));
482 $this->tpl->parseCurrentBlock();
483
484 $this->tpl->setCurrentBlock("btn_cell");
485 $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "selectArchiveLanguage"));
486 $this->tpl->setVariable("BTN_TXT", $this->lng->txt("crs_add_archive_html"));
487 $this->tpl->parseCurrentBlock();
488
489 return true;
490 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References ilUtil\sendFailure().

Referenced by view().

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

◆ addHTMLArchive()

ilCourseArchivesGUI::addHTMLArchive ( )

Definition at line 399 of file class.ilCourseArchivesGUI.php.

400 {
401 global $ilAccess;
402
403 // MINIMUM ACCESS LEVEL = 'write'
404 if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
405 {
406 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->MESSAGE);
407 }
408
409 $this->course_obj->initCourseArchiveObject();
410 $this->course_obj->archives_obj->setLanguage($_POST['lang']);
411 $this->course_obj->archives_obj->addHTML();
412
413 ilUtil::sendSuccess($this->lng->txt("crs_added_new_archive"));
414 $this->view();
415
416 return true;
417 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12

References $_POST, $ilErr, ilUtil\sendSuccess(), and view().

+ Here is the call graph for this function:

◆ addXMLArchive()

ilCourseArchivesGUI::addXMLArchive ( )

Definition at line 347 of file class.ilCourseArchivesGUI.php.

348 {
349 global $ilAccess;
350
351 // MINIMUM ACCESS LEVEL = 'write'
352 if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
353 {
354 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->MESSAGE);
355 }
356
357 $this->course_obj->initCourseArchiveObject();
358 $this->course_obj->archives_obj->addXML($_POST["sel"]);
359
360 ilUtil::sendSuccess($this->lng->txt("crs_added_new_archive"));
361 $this->view();
362
363 return true;
364 }

References $_POST, $ilErr, ilUtil\sendSuccess(), and view().

+ Here is the call graph for this function:

◆ confirmDeleteArchives()

ilCourseArchivesGUI::confirmDeleteArchives ( )

Definition at line 262 of file class.ilCourseArchivesGUI.php.

263 {
264 global $ilAccess,$ilErr;
265
266 // MINIMUM ACCESS LEVEL = 'write'
267 if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
268 {
269 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->MESSAGE);
270 }
271
272 if(!$_POST['archives'])
273 {
274 ilUtil::sendFailure($this->lng->txt("crs_no_archives_selected"));
275 $this->view();
276 return false;
277 }
278 $_SESSION["crs_archives"] = $_POST["archives"];
279 ilUtil::sendQuestion($this->lng->txt("crs_sure_delete_selected_archives"));
280
281 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_confirm_delete_archives.html','Modules/Course');
282 $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
283 $this->tpl->setVariable("TXT_ARCHIVE_NAME",$this->lng->txt('crs_file_name'));
284
285 $this->course_obj->initCourseArchiveObject();
286 $counter = 0;
287
288 foreach($_POST['archives'] as $archive_id)
289 {
290 $archive = $this->course_obj->archives_obj->getArchive($archive_id);
291 $this->tpl->setCurrentBlock("archives");
292
293 $this->tpl->setVariable("ARCHIVE_NAME",$archive['archive_name']);
294 $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
295 $this->tpl->parseCurrentBlock();
296 }
297
298 $this->tpl->setVariable("DELETE",$this->lng->txt('delete'));
299 $this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
300
301 return true;
302 }
$_SESSION["AccountId"]
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows)

References $_POST, $_SESSION, $ilErr, ilUtil\sendFailure(), ilUtil\sendQuestion(), ilUtil\switchColor(), and view().

+ Here is the call graph for this function:

◆ delete()

ilCourseArchivesGUI::delete ( )

Definition at line 304 of file class.ilCourseArchivesGUI.php.

305 {
306 global $ilAccess,$ilErr;
307
308 // MINIMUM ACCESS LEVEL = 'write'
309 if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
310 {
311 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->MESSAGE);
312 }
313
314 if(!$_SESSION['crs_archives'])
315 {
316 ilUtil::sendFailure($this->lng->txt("crs_no_archives_selected"));
317 $this->view();
318 }
319
320 $this->course_obj->initCourseArchiveObject();
321 foreach($_SESSION['crs_archives'] as $archive_id)
322 {
323 $this->course_obj->archives_obj->delete($archive_id);
324 }
325
326 ilUtil::sendSuccess($this->lng->txt('crs_archives_deleted'));
327 unset($_SESSION["crs_archives"]);
328
329 $this->view();
330 return true;
331 }

References $_SESSION, $ilErr, ilUtil\sendFailure(), ilUtil\sendSuccess(), and view().

+ Here is the call graph for this function:

◆ downloadArchives()

ilCourseArchivesGUI::downloadArchives ( )

Definition at line 419 of file class.ilCourseArchivesGUI.php.

420 {
421 global $ilAccess;
422
423 // MINIMUM ACCESS LEVEL = 'write'
424 if(!$ilAccess->checkAccess("read",'',$this->course_obj->getRefId()))
425 {
426 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->MESSAGE);
427 }
428
429 $_POST["archives"] = $_POST["archives"] ? $_POST["archives"] : array();
430
431 if(!count($_POST['archives']))
432 {
433 ilUtil::sendFailure($this->lng->txt('crs_no_archive_selected'));
434 $this->view();
435
436 return false;
437 }
438 if(count($_POST['archives']) > 1)
439 {
440 ilUtil::sendFailure($this->lng->txt('crs_select_one_archive'));
441 $this->view();
442
443 return false;
444 }
445
446 $this->course_obj->initCourseArchiveObject();
447
448 $abs_path = $this->course_obj->archives_obj->getArchiveFile((int) $_POST['archives'][0]);
449 $basename = basename($abs_path);
450
451 ilUtil::deliverFile($abs_path,$basename);
452 }
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

References $_POST, $ilErr, ilUtil\deliverFile(), ilUtil\sendFailure(), and view().

+ Here is the call graph for this function:

◆ executeCommand()

& ilCourseArchivesGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 66 of file class.ilCourseArchivesGUI.php.

67 {
68 switch($this->ctrl->getNextClass($this))
69 {
70 case 'ilobjectcopygui':
71 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
72 $cp = new ilObjectCopyGUI($this);
73 $cp->setType('crs');
74 $this->ctrl->forwardCommand($cp);
75 break;
76
77 default:
78 $cmd = $this->ctrl->getCmd();
79 if (!$cmd = $this->ctrl->getCmd())
80 {
81 $cmd = "view";
82 }
83 $this->$cmd();
84 break;
85 }
86 }
GUI class for the workflow of copying objects.
$cmd
Definition: sahs_server.php:35

References $cmd.

◆ ilCourseArchivesGUI()

ilCourseArchivesGUI::ilCourseArchivesGUI ( $content_gui)

Constructor @access public.

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

50 {
51 global $tpl,$ilCtrl,$lng,$ilObjDataCache,$ilTabs;
52
53 $this->tpl =& $tpl;
54 $this->ctrl =& $ilCtrl;
55 $this->lng =& $lng;
56 $this->tabs_gui =& $ilTabs;
57
58 $this->content_gui =& $content_gui;
59 $this->content_obj =& $this->content_gui->object;
60
61 $this->__initCourseObject();
62 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $lng, $tpl, and __initCourseObject().

+ Here is the call graph for this function:

◆ selectArchiveLanguage()

ilCourseArchivesGUI::selectArchiveLanguage ( )

Definition at line 366 of file class.ilCourseArchivesGUI.php.

367 {
368 global $ilAccess;
369
370 // MINIMUM ACCESS LEVEL = 'write'
371 if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
372 {
373 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->MESSAGE);
374 }
375
376 foreach($this->lng->getInstalledLanguages() as $lang_code)
377 {
378 $actions["$lang_code"] = $this->lng->txt('lang_'.$lang_code);
379
380 if($this->lng->getLangKey() == $lang_code)
381 {
382 $selected = $lang_code;
383 }
384 }
385
386 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_selectLanguage.html",'Modules/Course');
387
388 $this->tpl->setVariable("LANGUAGE_SELECTION",$this->lng->txt('crs_archive_language_selection'));
389 $this->tpl->setVariable("LANGUAGE",$this->lng->txt('obj_lng'));
390 $this->tpl->setVariable("INFO_TXT",$this->lng->txt('crs_select_archive_language'));
391 $this->tpl->setVariable("SELECT_FORMACTION",$this->ctrl->getFormAction($this));
392 $this->tpl->setVariable("LANG_SELECTOR",ilUtil::formSelect($selected,'lang',$actions,false,true));
393 $this->tpl->setVariable("TXT_CANCEL",$this->lng->txt('cancel'));
394 $this->tpl->setVariable("TXT_SUBMIT",$this->lng->txt('crs_add_html_archive'));
395
396 return true;
397 }
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.

References ilObjectGUI\$actions, $ilErr, and ilUtil\formSelect().

+ Here is the call graph for this function:

◆ selectXMLArchiveItems()

ilCourseArchivesGUI::selectXMLArchiveItems ( )

Select items for archive.

Definition at line 336 of file class.ilCourseArchivesGUI.php.

337 {
338 global $tpl;
339
340 include_once("./Services/Export/classes/class.ilSubItemSelectionTableGUI.php");
341 $sel_table = new ilSubItemSelectionTableGUI($this, "selectXMlArchiveItems",
342 $this->course_obj->getRefId(), "addXMLArchive",
343 $this->lng->txt("crs_add_archive_xml"));
344 $tpl->setContent($sel_table->getHTML());
345 }

References $tpl.

◆ view()

ilCourseArchivesGUI::view ( )

Definition at line 88 of file class.ilCourseArchivesGUI.php.

89 {
90 global $ilAccess,$ilErr;
91
92 // MINIMUM ACCESS LEVEL = 'write'
93 if(!$ilAccess->checkAccess("read",'',$this->course_obj->getRefId()))
94 {
95 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->MESSAGE);
96 }
97
98
99 $this->is_tutor = $ilAccess->checkAccess('write','',$this->course_obj->getRefId());
100 $this->download_allowed = ($this->is_tutor or $this->course_obj->getArchiveType() == $this->course_obj->ARCHIVE_DOWNLOAD);
101
102 $this->course_obj->initCourseArchiveObject();
103 $this->course_obj->archives_obj->initCourseFilesObject();
104
105
106 $archives = $this->is_tutor ?
107 $this->course_obj->archives_obj->getArchives() :
108 $this->course_obj->archives_obj->getPublicArchives();
109
110 require_once("./Services/Table/classes/class.ilTableGUI.php");
111 $tbl = new ilTableGUI();
112
113 $this->__showArchivesMenu();
114 $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
115 $this->tpl->addBlockfile("TBL_CONTENT","tbl_content","tpl.crs_archives_row.html",'Modules/Course');
116
117 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
118
119 $tbl->setTitle($this->lng->txt("crs_header_archives"));
120
121
122 if($this->download_allowed or $this->is_tutor)
123 {
124 $header_names = array('',
125 $this->lng->txt("type"),
126 $this->lng->txt("crs_file_name"),
127 $this->lng->txt("crs_size"),
128 $this->lng->txt("crs_create_date"),
129 $this->lng->txt("crs_archive_lang"));
130
131 $header_vars = array("",
132 "type",
133 "name",
134 "size",
135 "date",
136 "lang");
137 $column_width = array("1%","9%","30%","20%","20%","20%");
138 $this->tpl->setVariable("COLUMN_COUNTS",6);
139 }
140 else
141 {
142 $header_names = array($this->lng->txt("type"),
143 $this->lng->txt("crs_file_name"),
144 $this->lng->txt("crs_create_date"),
145 $this->lng->txt("crs_size"),
146 $this->lng->txt("crs_archive_lang"));
147
148 $header_vars = array("type",
149 "name",
150 "date",
151 "size",
152 "lang");
153 $column_width = array("10%","30%","20%","20%","20%");
154 $this->tpl->setVariable("COLUMN_COUNTS",5);
155 }
156
157 $tbl->setHeaderNames($header_names);
158 $tbl->setHeaderVars($header_vars,
159 array("ref_id" => $this->course_obj->getRefId(),
160 "cmd" => "view",
161 "cmdClass" => strtolower(get_class($this))));
162 $tbl->setColumnWidth($column_width);
163
164
165 // control
166 $tbl->setOrderColumn($_GET["sort_by"]);
167 $tbl->setOrderDirection($_GET["sort_order"]);
168 $tbl->setLimit($_GET["limit"]);
169 $tbl->setOffset($_GET["offset"]);
170 $tbl->disable("sort");
171
172 if($this->download_allowed)
173 {
174 $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
175 if($this->is_tutor)
176 {
177 // delete
178 $this->tpl->setCurrentBlock("tbl_action_btn");
179 $this->tpl->setVariable("BTN_NAME", "confirmDeleteArchives");
180 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
181 $this->tpl->parseCurrentBlock();
182 }
183
184 // download
185 $this->tpl->setCurrentBlock("tbl_action_btn");
186 $this->tpl->setVariable("BTN_NAME", "downloadArchives");
187 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("download"));
188 $this->tpl->parseCurrentBlock();
189 }
190
191 $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
192 $tbl->setMaxCount(count($archives));
193 $archives = array_slice($archives,$_GET['offset'],$_GET['limit']);
194 $tbl->render();
195
196 if(!count($archives))
197 {
198 $this->tpl->setCurrentBlock("notfound");
199 $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
200 $this->tpl->setVariable("NUM_COLS",6);
201 $this->tpl->parseCurrentBlock();
202 }
203
204
205 $counter = 0;
206 foreach($archives as $archive_data)
207 {
208 $this->tpl->setCurrentBlock("tbl_content");
209 $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
210
211
212 if($this->download_allowed)
213 {
214 $this->tpl->setVariable("VAL_CHECK",ilUtil::formCheckbox(0,"archives[]",$archive_data['archive_id']));
215 }
216 // Type
217 switch($archive_data["archive_type"])
218 {
219 case $this->course_obj->archives_obj->ARCHIVE_XML:
220 $type = $this->lng->txt("crs_xml");
221 break;
222
223 case $this->course_obj->archives_obj->ARCHIVE_HTML:
224 $type = $this->lng->txt("crs_html");
225 break;
226
227 case $this->course_obj->archives_obj->ARCHIVE_PDF:
228 $type = $this->lng->txt("crs_pdf");
229 break;
230 }
231 $this->tpl->setVariable("VAL_TYPE",$type);
232
233 // Name
234 if($archive_data['archive_type'] == $this->course_obj->archives_obj->ARCHIVE_HTML)
235 {
236 $link = '<a href="'.$this->course_obj->archives_obj->course_files_obj->getOnlineLink($archive_data['archive_name']).'"'.
237 ' target="_blank">'.$archive_data["archive_name"].'</a>';
238 }
239 else
240 {
241 $link = $archive_data['archive_name'];
242 }
243
244 $this->tpl->setVariable("VAL_NAME",$link);
245 $this->tpl->setVariable("VAL_SIZE",$archive_data['archive_size']);
246 $this->tpl->setVariable('VAL_DATE',ilDatePresentation::formatDate(new ilDateTime($archive_data['archive_name'],IL_CAL_UNIX)));
247
248 if($archive_data["archive_lang"])
249 {
250 $this->tpl->setVariable("VAL_LANG",$this->lng->txt('lang_'.$archive_data["archive_lang"]));
251 }
252 else
253 {
254 $this->tpl->setVariable("VAL_LANG",$this->lng->txt('crs_not_available'));
255 }
256 $this->tpl->parseCurrentBlock();
257 }
258 $this->tpl->parseCurrentBlock();
259 }
$_GET["client_id"]
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
Class ilTableGUI.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$tbl
Definition: example_048.php:81

References $_GET, $ilErr, $tbl, __showArchivesMenu(), ilDatePresentation\formatDate(), ilUtil\formCheckbox(), ilUtil\getImagePath(), IL_CAL_UNIX, and ilUtil\switchColor().

Referenced by addHTMLArchive(), addXMLArchive(), confirmDeleteArchives(), delete(), and downloadArchives().

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

Field Documentation

◆ $container_obj

ilCourseArchivesGUI::$container_obj

Definition at line 37 of file class.ilCourseArchivesGUI.php.

◆ $course_obj

ilCourseArchivesGUI::$course_obj

Definition at line 38 of file class.ilCourseArchivesGUI.php.

◆ $ctrl

ilCourseArchivesGUI::$ctrl

Definition at line 41 of file class.ilCourseArchivesGUI.php.

◆ $lng

ilCourseArchivesGUI::$lng

Definition at line 42 of file class.ilCourseArchivesGUI.php.

Referenced by ilCourseArchivesGUI().

◆ $tabs_gui

ilCourseArchivesGUI::$tabs_gui

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

◆ $tpl

ilCourseArchivesGUI::$tpl

Definition at line 40 of file class.ilCourseArchivesGUI.php.

Referenced by ilCourseArchivesGUI(), and selectXMLArchiveItems().


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