ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAppointmentPresentationExerciseGUI Class Reference
+ Inheritance diagram for ilAppointmentPresentationExerciseGUI:
+ Collaboration diagram for ilAppointmentPresentationExerciseGUI:

Public Member Functions

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

Protected Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from ilAppointmentPresentationGUI
static getInstance (array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
 
- Protected Attributes inherited from ilAppointmentPresentationGUI
array $appointment
 
ilToolbarGUI $toolbar
 
ilInfoScreenGUI $infoscreen
 
ilLanguage $lng
 
ilTree $tree
 
UIServices $ui
 
ilCtrlInterface $ctrl
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
ilObjUser $user
 
RefineryFactory $refinery
 
HttpServices $http
 
Item $list_item = null
 
array $info_items = []
 
array $list_properties = []
 
array $actions = []
 
array $readable_ref_ids
 
bool $has_files = false
 
int $obj_id = 0
 
- Static Protected Attributes inherited from ilAppointmentPresentationGUI
static self $instance
 

Detailed Description

Member Function Documentation

◆ buildDirectLinkForAppointment()

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

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

References ilLink\_getLink().

99  : string
100  {
101  $ass_id = 0;
102  if (is_array($a_appointment)) {
103  $ass_id = $a_appointment["event"]->getContextId() / 10;
104  }
105  if (!$ass_id) {
106  return parent::buildDirectLinkForAppointment($a_ref_id, $a_appointment);
107  }
108  return ilLink::_getLink(
109  $a_ref_id,
110  'exc',
111  [],
112  '_' . $ass_id
113  );
114  }
+ Here is the call graph for this function:

◆ collectPropertiesAndActions()

ilAppointmentPresentationExerciseGUI::collectPropertiesAndActions ( )

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

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

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

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