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

Class ilCourseArchivesGUI. More...

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

Public Member Functions

 __construct ($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
 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...
 

Data Fields

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

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 ()
 
 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...
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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.

Constructor & Destructor Documentation

◆ __construct()

ilCourseArchivesGUI::__construct (   $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:

Member Function Documentation

◆ __initCourseObject()

ilCourseArchivesGUI::__initCourseObject ( )

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

465 {
466 global $tree;
467
468 if ($this->content_obj->getType() == 'crs') {
469 // Container is course
470 $this->course_obj =&$this->content_obj;
471 } else {
472 $course_ref_id = $tree->checkForParentType($this->content_obj->getRefId(), 'crs');
473 $this->course_obj =&ilObjectFactory::getInstanceByRefId($course_ref_id);
474 }
475 return true;
476 }
static 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 __construct().

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

◆ __showArchivesMenu()

ilCourseArchivesGUI::__showArchivesMenu ( )

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

430 {
431 if (!$this->is_tutor) {
432 return false;
433 }
434 $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
435
436 if (!PATH_TO_ZIP) {
437 ilUtil::sendFailure($this->lng->txt('zip_test_failed'));
438 return true;
439 }
440 /*
441 $this->tpl->setCurrentBlock("btn_cell");
442 $link = $this->ctrl->getLinkTargetByClass(
443 'ilobjectcopygui',
444 'initSourceSelection'
445 );
446 $this->tpl->setVariable('BTN_LINK',$link);
447 $this->tpl->setVariable("BTN_TXT", $this->lng->txt("clone_existing_course"));
448 $this->tpl->parseCurrentBlock();
449 */
450 // create xml archive button
451 $this->tpl->setCurrentBlock("btn_cell");
452 $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "selectXMLArchiveItems"));
453 $this->tpl->setVariable("BTN_TXT", $this->lng->txt("crs_add_archive_xml"));
454 $this->tpl->parseCurrentBlock();
455
456 $this->tpl->setCurrentBlock("btn_cell");
457 $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "selectArchiveLanguage"));
458 $this->tpl->setVariable("BTN_TXT", $this->lng->txt("crs_add_archive_html"));
459 $this->tpl->parseCurrentBlock();
460
461 return true;
462 }
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 377 of file class.ilCourseArchivesGUI.php.

378 {
379 global $ilAccess;
380
381 // MINIMUM ACCESS LEVEL = 'write'
382 if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
383 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->MESSAGE);
384 }
385
386 $this->course_obj->initCourseArchiveObject();
387 $this->course_obj->archives_obj->setLanguage($_POST['lang']);
388 $this->course_obj->archives_obj->addHTML();
389
390 ilUtil::sendSuccess($this->lng->txt("crs_added_new_archive"));
391 $this->view();
392
393 return true;
394 }
$_POST["username"]
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

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

+ Here is the call graph for this function:

◆ addXMLArchive()

ilCourseArchivesGUI::addXMLArchive ( )

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

330 {
331 global $ilAccess;
332
333 // MINIMUM ACCESS LEVEL = 'write'
334 if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
335 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->MESSAGE);
336 }
337
338 $this->course_obj->initCourseArchiveObject();
339 $this->course_obj->archives_obj->addXML($_POST["sel"]);
340
341 ilUtil::sendSuccess($this->lng->txt("crs_added_new_archive"));
342 $this->view();
343
344 return true;
345 }

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

+ Here is the call graph for this function:

◆ confirmDeleteArchives()

ilCourseArchivesGUI::confirmDeleteArchives ( )

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

247 {
248 global $ilAccess,$ilErr;
249
250 // MINIMUM ACCESS LEVEL = 'write'
251 if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
252 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->MESSAGE);
253 }
254
255 if (!$_POST['archives']) {
256 ilUtil::sendFailure($this->lng->txt("crs_no_archives_selected"));
257 $this->view();
258 return false;
259 }
260 $_SESSION["crs_archives"] = $_POST["archives"];
261 ilUtil::sendQuestion($this->lng->txt("crs_sure_delete_selected_archives"));
262
263 $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.crs_confirm_delete_archives.html', 'Modules/Course');
264 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
265 $this->tpl->setVariable("TXT_ARCHIVE_NAME", $this->lng->txt('crs_file_name'));
266
267 $this->course_obj->initCourseArchiveObject();
268 $counter = 0;
269
270 foreach ($_POST['archives'] as $archive_id) {
271 $archive = $this->course_obj->archives_obj->getArchive($archive_id);
272 $this->tpl->setCurrentBlock("archives");
273
274 $this->tpl->setVariable("ARCHIVE_NAME", $archive['archive_name']);
275 $this->tpl->setVariable("CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
276 $this->tpl->parseCurrentBlock();
277 }
278
279 $this->tpl->setVariable("DELETE", $this->lng->txt('delete'));
280 $this->tpl->setVariable("CANCEL", $this->lng->txt('cancel'));
281
282 return true;
283 }
$_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)
$counter

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

+ Here is the call graph for this function:

◆ delete()

ilCourseArchivesGUI::delete ( )

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

286 {
287 global $ilAccess,$ilErr;
288
289 // MINIMUM ACCESS LEVEL = 'write'
290 if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
291 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->MESSAGE);
292 }
293
294 if (!$_SESSION['crs_archives']) {
295 ilUtil::sendFailure($this->lng->txt("crs_no_archives_selected"));
296 $this->view();
297 }
298
299 $this->course_obj->initCourseArchiveObject();
300 foreach ($_SESSION['crs_archives'] as $archive_id) {
301 $this->course_obj->archives_obj->delete($archive_id);
302 }
303
304 ilUtil::sendSuccess($this->lng->txt('crs_archives_deleted'));
305 unset($_SESSION["crs_archives"]);
306
307 $this->view();
308 return true;
309 }

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

+ Here is the call graph for this function:

◆ downloadArchives()

ilCourseArchivesGUI::downloadArchives ( )

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

397 {
398 global $ilAccess;
399
400 // MINIMUM ACCESS LEVEL = 'write'
401 if (!$ilAccess->checkAccess("read", '', $this->course_obj->getRefId())) {
402 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->MESSAGE);
403 }
404
405 $_POST["archives"] = $_POST["archives"] ? $_POST["archives"] : array();
406
407 if (!count($_POST['archives'])) {
408 ilUtil::sendFailure($this->lng->txt('crs_no_archive_selected'));
409 $this->view();
410
411 return false;
412 }
413 if (count($_POST['archives']) > 1) {
414 ilUtil::sendFailure($this->lng->txt('crs_select_one_archive'));
415 $this->view();
416
417 return false;
418 }
419
420 $this->course_obj->initCourseArchiveObject();
421
422 $abs_path = $this->course_obj->archives_obj->getArchiveFile((int) $_POST['archives'][0]);
423 $basename = basename($abs_path);
424
425 ilUtil::deliverFile($abs_path, $basename);
426 }
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

References $_POST, ilObjectGUI\$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 case 'ilobjectcopygui':
70 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
71 $cp = new ilObjectCopyGUI($this);
72 $cp->setType('crs');
73 $this->ctrl->forwardCommand($cp);
74 break;
75
76 default:
77 $cmd = $this->ctrl->getCmd();
78 if (!$cmd = $this->ctrl->getCmd()) {
79 $cmd = "view";
80 }
81 $this->$cmd();
82 break;
83 }
84 }
GUI class for the workflow of copying objects.

◆ selectArchiveLanguage()

ilCourseArchivesGUI::selectArchiveLanguage ( )

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 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->MESSAGE);
354 }
355
356 foreach ($this->lng->getInstalledLanguages() as $lang_code) {
357 $actions["$lang_code"] = $this->lng->txt('lang_' . $lang_code);
358
359 if ($this->lng->getLangKey() == $lang_code) {
360 $selected = $lang_code;
361 }
362 }
363
364 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_selectLanguage.html", 'Modules/Course');
365
366 $this->tpl->setVariable("LANGUAGE_SELECTION", $this->lng->txt('crs_archive_language_selection'));
367 $this->tpl->setVariable("LANGUAGE", $this->lng->txt('obj_lng'));
368 $this->tpl->setVariable("INFO_TXT", $this->lng->txt('crs_select_archive_language'));
369 $this->tpl->setVariable("SELECT_FORMACTION", $this->ctrl->getFormAction($this));
370 $this->tpl->setVariable("LANG_SELECTOR", ilUtil::formSelect($selected, 'lang', $actions, false, true));
371 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt('cancel'));
372 $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt('crs_add_html_archive'));
373
374 return true;
375 }
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, ilObjectGUI\$ilErr, and ilUtil\formSelect().

+ Here is the call graph for this function:

◆ selectXMLArchiveItems()

ilCourseArchivesGUI::selectXMLArchiveItems ( )

Select items for archive.

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

315 {
316 global $tpl;
317
318 include_once("./Services/Export/classes/class.ilSubItemSelectionTableGUI.php");
319 $sel_table = new ilSubItemSelectionTableGUI(
320 $this,
321 "selectXMlArchiveItems",
322 $this->course_obj->getRefId(),
323 "addXMLArchive",
324 $this->lng->txt("crs_add_archive_xml")
325 );
326 $tpl->setContent($sel_table->getHTML());
327 }

References $tpl.

◆ view()

ilCourseArchivesGUI::view ( )

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

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

References $_GET, $counter, ilObjectGUI\$ilErr, $tbl, $type, __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 __construct().

◆ $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 __construct(), and selectXMLArchiveItems().


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