ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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, $a_appointment=null)
 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 ()
 

Protected Member Functions

 buildDirectLinkForAppointment ($a_ref_id, $a_appointment=null)
 Build direct link for appointment.
Parameters
int$a_ref_id
array  |  null$a_appointment
Returns
string
More...
 
- Protected Member Functions inherited from ilAppointmentPresentationGUI
 readObjIdForAppointment ()
 read obj_id for appointment More...
 
 buildDirectLinkForAppointment ($a_ref_id, $a_appointment=null)
 Build direct link for appointment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAppointmentPresentationGUI
static getInstance ($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
 
- 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

◆ buildDirectLinkForAppointment()

ilAppointmentPresentationExerciseGUI::buildDirectLinkForAppointment (   $a_ref_id,
  $a_appointment = null 
)
protected

Build direct link for appointment.

Parameters
int$a_ref_id
array  |  null$a_appointment
Returns
string

Reimplemented from ilAppointmentPresentationGUI.

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

108 {
109 $ass_id = 0;
110 if (is_array($a_appointment)) {
111 $ass_id = $a_appointment["event"]->getContextId() / 10;
112 }
113 if (!$ass_id) {
114 return parent::buildDirectLinkForAppointment($a_ref_id, $a_appointment);
115 }
116 return ilLink::_getLink(
117 $a_ref_id,
118 'exc',
119 [],
120 '_' . $ass_id
121 );
122 }

References ilLink\_getLink().

+ Here is the call graph for this function:

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

References ilAppointmentPresentationGUI\$appointment, ilAppointmentPresentationGUI\$ctrl, $DIC, Vendor\Package\$f, $url, ilAppointmentPresentationGUI\addAction(), ilAppointmentPresentationGUI\addCommonSection(), ilAppointmentPresentationGUI\addInfoProperty(), ilAppointmentPresentationGUI\addInfoSection(), ilAppointmentPresentationGUI\addLastUpdate(), ilAppointmentPresentationGUI\addListItemProperty(), ilExcAssMemberState\getInstanceByIds(), ilAppointmentPresentationGUI\getObjIdForAppointment(), and ilAppointmentPresentationGUI\getReadableRefIds().

+ Here is the call graph for this function:

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