ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAppointmentPresentationExerciseGUI Class Reference
+ Inheritance diagram for ilAppointmentPresentationExerciseGUI:
+ Collaboration diagram for ilAppointmentPresentationExerciseGUI:

Public Member Functions

 collectPropertiesAndActions ()
 Collect properties and actions. More...
 
- Public Member Functions inherited from ilAppointmentPresentationGUI
 __construct ($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
 
 getObjIdForAppointment ()
 
 getToolbar ()
 
 getListItem ()
 Get list item. More...
 
 getInfoScreen ()
 
 getCatId ($a_entry_id)
 
 getCatInfo ()
 
 executeCommand ()
 
 getHTML ()
 Get HTML. More...
 
 addContainerInfo ($a_obj_id)
 Add course/group container info. More...
 
 addInfoSection ($a_txt)
 Add info section. More...
 
 addInfoProperty ($a_txt, $a_val)
 Add info property. More...
 
 addListItemProperty ($a_txt, $a_val)
 Add list item property. More...
 
 addAction ($a_txt, $a_link)
 Add action. More...
 
 collectPropertiesAndActions ()
 Collect properties and actions. More...
 
 collectStandardPropertiesAndActions ()
 Collect standard properties and actions. More...
 
 addObjectLinks ($obj_id)
 Add object link. More...
 
 getReadableRefIds ($a_obj_id)
 Get readable ref ids. More...
 
 addEventDescription ($a_app)
 Add event description. More...
 
 addEventLocation ($a_app)
 Add event location. More...
 
 addLastUpdate ($a_app)
 Add last update. More...
 
 addCalendarInfo ($cat_info)
 Add calendar info. More...
 
 addCommonSection ($a_app, $a_obj_id=0, $cat_info=null, $a_container_info=false)
 Add common section. More...
 
 addMetaData ($a_obj_type, $a_obj_id, $a_sub_obj_type=null, $a_sub_obj_id=null)
 Add metadata. More...
 
 getUserName ($a_user_id, $a_force_name=false)
 Get (linked if possible) user name. More...
 
 downloadFiles ()
 Download files from an appointment ( Modals ) More...
 
 getToolbar ()
 
 getInfoScreen ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAppointmentPresentationGUI
static getInstance ($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
 
- Protected Member Functions inherited from ilAppointmentPresentationGUI
 readObjIdForAppointment ()
 read obj_id for appointment More...
 
- Protected Attributes inherited from ilAppointmentPresentationGUI
 $toolbar
 
 $appointment
 
 $infoscreen
 
 $lng
 
 $tree
 
 $ui
 
 $list_item = null
 
 $info_items = array()
 
 $list_properties = array()
 
 $actions = array()
 
 $ctrl
 
 $access
 
 $readable_ref_ids
 
 $has_files = false
 
 $obj_id = 0
 
- Static Protected Attributes inherited from ilAppointmentPresentationGUI
static $instance
 

Detailed Description

Member Function Documentation

◆ collectPropertiesAndActions()

ilAppointmentPresentationExerciseGUI::collectPropertiesAndActions ( )

Collect properties and actions.

Reimplemented from ilAppointmentPresentationGUI.

Definition at line 16 of file class.ilAppointmentPresentationExerciseGUI.php.

17 {
18 global $DIC;
19
20 $this->lng->loadLanguageModule("exc");
21
22 include_once "./Modules/Exercise/classes/class.ilObjExercise.php";
23 include_once('./Services/Link/classes/class.ilLink.php');
24 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
25
26 $f = $DIC->ui()->factory();
27 $r = $DIC->ui()->renderer();
28 $ctrl = $DIC->ctrl();
29
30 $a_app = $this->appointment;
31 $exc_obj = new ilObjExercise($this->getObjIdForAppointment(), false);
32 //is this safe?
33
34 $refs = $this->getReadableRefIds($this->getObjIdForAppointment());
35 $exc_ref = current($refs);
36
37 // common section: title, location, parent info
38 $this->addCommonSection($a_app, $this->getObjIdForAppointment(), null, true);
39
40 //Assignment title information
41 $this->addInfoSection($this->lng->txt("cal_exc_info"));
42
43 //var_dump($a_app); exit;
44 $ass_id = $a_app["event"]->getContextId() / 10; // see ilExAssignment->handleCalendarEntries $dl parameter
45
46 $assignment = new ilExAssignment($ass_id);
47 $assignment_instructions = trim($assignment->getInstruction());
48 if ($assignment_instructions != "") {
49 #21517
50 $is_html = (strlen($assignment_instructions) != strlen(strip_tags($assignment_instructions)));
51 if (!$is_html) {
52 $assignment_instructions = nl2br($assignment_instructions);
53 }
54 $this->addInfoProperty($this->lng->txt("exc_instruction"), $assignment_instructions);
55 }
56 $files = $assignment->getFiles();
57 if (count($files) > 0 && !$assignment->notStartedYet()) {
58 $this->has_files = true;
59 $str_files = array();
60 foreach ($files as $file) {
61 $ctrl->setParameterByClass("ilexsubmissiongui", "ref_id", $exc_ref);
62 $ctrl->setParameterByClass("ilexsubmissiongui", "file", urlencode($file["name"]));
63 $ctrl->setParameterByClass("ilexsubmissiongui", "ass_id", $ass_id);
64 $url = $ctrl->getLinkTargetByClass(array("ilExerciseHandlerGUI","ilobjexercisegui", "ilexsubmissiongui"), "downloadFile");
65 $ctrl->setParameterByClass("ilexsubmissiongui", "ass_id", "");
66 $ctrl->setParameterByClass("ilexsubmissiongui", "file", "");
67 $ctrl->setParameterByClass("ilexsubmissiongui", "ref_if", "");
68 $str_files[$file["name"]] = $r->render($f->button()->shy($file["name"], $url));
69 }
70 ksort($str_files, SORT_NATURAL | SORT_FLAG_CASE);
71 $str_files = implode("<br>", $str_files);
72 $this->addInfoProperty($this->lng->txt("exc_instruction_files"), $str_files);
73 $this->addListItemProperty($this->lng->txt("exc_instruction_files"), str_replace("<br>", ", ", $str_files));
74 }
75
76 //pass mode
77 if ($assignment->getMandatory()) {
78 $this->addInfoProperty($this->lng->txt("exc_mandatory"), $this->lng->txt("yes"));
79 $this->addListItemProperty($this->lng->txt("exc_mandatory"), $this->lng->txt("yes"));
80 } else {
81 $this->addInfoProperty($this->lng->txt("exc_mandatory"), $this->lng->txt("no"));
82 $this->addListItemProperty($this->lng->txt("exc_mandatory"), $this->lng->txt("no"));
83 }
84
85 // last edited
86 $this->addLastUpdate($a_app);
87
88 //go to the exercise.
89 $this->addAction(
90 $this->lng->txt("cal_exc_open"),
91 "goto.php?target=exc_" . $exc_ref . "_" . $ass_id . "&client_id=" . CLIENT_ID
92 );
93 }
$files
Definition: add-vimline.php:18
addListItemProperty($a_txt, $a_val)
Add list item property.
getReadableRefIds($a_obj_id)
Get readable ref ids.
addCommonSection($a_app, $a_obj_id=0, $cat_info=null, $a_container_info=false)
Add common section.
addInfoProperty($a_txt, $a_val)
Add info property.
Exercise assignment.
Class ilObjExercise.
$r
Definition: example_031.php:79
$url
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
global $DIC
Definition: saml.php:7

References ilAppointmentPresentationGUI\$appointment, ilAppointmentPresentationGUI\$ctrl, $DIC, $file, $files, $r, $url, ilAppointmentPresentationGUI\addAction(), ilAppointmentPresentationGUI\addCommonSection(), ilAppointmentPresentationGUI\addInfoProperty(), ilAppointmentPresentationGUI\addInfoSection(), ilAppointmentPresentationGUI\addLastUpdate(), ilAppointmentPresentationGUI\addListItemProperty(), ilAppointmentPresentationGUI\getObjIdForAppointment(), and ilAppointmentPresentationGUI\getReadableRefIds().

+ Here is the call graph for this function:

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