/** * info screen * * @access protected * @param * @return */ public function infoScreen() { global $ilAccess, $ilUser, $ilCtrl, $tree, $ilToolbar; $this->checkPermission('visible'); $this->tabs_gui->setTabActive('info_short'); $appointment_obj = $this->object->getFirstAppointment(); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); if ($this->object->enabledRegistration()) { include_once './Modules/Session/classes/class.ilEventParticipants.php'; if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->object->getId())) { $ilToolbar->addFormButton($this->lng->txt('event_unregister'), 'join'); } else { if (!isset($_SESSION['sess_hide_info'])) { ilUtil::sendInfo($this->lng->txt('sess_join_info')); } $ilToolbar->addFormButton($this->lng->txt('join_session'), 'join', '', true); } $ilToolbar->setFormAction($this->ctrl->getFormAction($this)); } // Session information if (strlen($this->object->getLocation()) or strlen($this->object->getDetails())) { $info->addSection($this->lng->txt('event_section_information')); } if (strlen($location = $this->object->getLocation())) { $info->addProperty($this->lng->txt('event_location'), nl2br($this->object->getLocation())); } if (strlen($this->object->getDetails())) { $info->addProperty($this->lng->txt('event_details_workflow'), nl2br($this->object->getDetails())); } // Tutor information if ($this->object->hasTutorSettings()) { $info->addSection($this->lng->txt('event_tutor_data')); if (strlen($fullname = $this->object->getName())) { $info->addProperty($this->lng->txt('event_lecturer'), $fullname); } if (strlen($email = $this->object->getEmail())) { $info->addProperty($this->lng->txt('tutor_email'), $email); } if (strlen($phone = $this->object->getPhone())) { $info->addProperty($this->lng->txt('tutor_phone'), $phone); } } $html = ''; include_once './Services/Object/classes/class.ilObjectActivation.php'; include_once './Services/Container/classes/class.ilContainerSorting.php'; include_once './Modules/Session/classes/class.ilSessionObjectListGUIFactory.php'; $eventItems = ilObjectActivation::getItemsByEvent($this->object->getId()); $parent_id = $tree->getParentId($this->object->getRefId()); $parent_id = ilObject::_lookupObjId($parent_id); $eventItems = ilContainerSorting::_getInstance($parent_id)->sortSubItems('sess', $this->object->getId(), $eventItems); foreach ($eventItems as $item) { $list_gui = ilSessionObjectListGUIFactory::factory($item['type']); $list_gui->setContainerObject($this); $this->modifyItemGUI($list_gui, $item, false); $html .= $list_gui->getListItemHTML($item['ref_id'], $item['obj_id'], $item['title'], $item['description']); } if (strlen($html)) { $info->addSection($this->lng->txt('event_materials')); $info->addProperty(' ', $html); } // forward the command $this->ctrl->forwardCommand($info); // store read event require_once 'Services/Tracking/classes/class.ilChangeEvent.php'; ilChangeEvent::_recordReadEvent($this->object->getType(), $this->object->getRefId(), $this->object->getId(), $ilUser->getId()); }
/** * Render an item * * @param array item data * * @return string item HTML */ function renderItem($a_item_data, $a_position = 0, $a_force_icon = false, $a_pos_prefix = "") { global $ilSetting, $ilAccess, $ilCtrl; // Pass type, obj_id and tree to checkAccess method to improve performance if (!$ilAccess->checkAccess('visible', '', $a_item_data['ref_id'], $a_item_data['type'], $a_item_data['obj_id'], $a_item_data['tree'])) { return ''; } $item_list_gui = $this->getItemGUI($a_item_data); if ($ilSetting->get("icon_position_in_lists") == "item_rows" || $a_item_data["type"] == "sess" || $a_force_icon) { $item_list_gui->enableIcon(true); } if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"]) { $item_list_gui->enableCheckbox(true); } else { if ($this->getContainerGUI()->isMultiDownloadEnabled()) { // display multi download checkboxes $item_list_gui->enableDownloadCheckbox($a_item_data["ref_id"], true); } } if ($this->getContainerGUI()->isActiveItemOrdering() && ($a_item_data['type'] != 'sess' || get_class($this) != 'ilContainerSessionsContentGUI')) { $item_list_gui->setPositionInputField($a_pos_prefix . "[" . $a_item_data["ref_id"] . "]", sprintf('%d', (int) $a_position * 10)); } if ($a_item_data['type'] == 'sess' and get_class($this) != 'ilContainerObjectiveGUI') { switch ($this->getDetailsLevel($a_item_data['obj_id'])) { case self::DETAILS_TITLE: $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_MINIMAL); $item_list_gui->enableExpand(true); $item_list_gui->setExpanded(false); $item_list_gui->enableDescription(false); $item_list_gui->enableProperties(true); break; case self::DETAILS_ALL: $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL); $item_list_gui->enableExpand(true); $item_list_gui->setExpanded(true); $item_list_gui->enableDescription(true); $item_list_gui->enableProperties(true); break; default: $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL); $item_list_gui->enableExpand(true); $item_list_gui->enableDescription(true); $item_list_gui->enableProperties(true); break; } } if (method_exists($this, "addItemDetails")) { $this->addItemDetails($item_list_gui, $a_item_data); } // show subitems if ($a_item_data['type'] == 'sess' and ($this->getDetailsLevel($a_item_data['obj_id']) != self::DETAILS_TITLE or $this->getContainerGUI()->isActiveAdministrationPanel() or $this->getContainerGUI()->isActiveItemOrdering())) { $pos = 1; include_once './Services/Container/classes/class.ilContainerSorting.php'; include_once './Services/Object/classes/class.ilObjectActivation.php'; $items = ilObjectActivation::getItemsByEvent($a_item_data['obj_id']); $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('sess', $a_item_data['obj_id'], $items); $item_readable = $ilAccess->checkAccess('read', '', $a_item_data['ref_id']); foreach ($items as $item) { // TODO: this should be removed and be handled by if(strlen($sub_item_html)) // see mantis: 0003944 if (!$ilAccess->checkAccess('visible', '', $item['ref_id'])) { continue; } $item_list_gui2 = $this->getItemGUI($item); $item_list_gui2->enableIcon(true); $item_list_gui2->enableItemDetailLinks(false); // unique js-ids $item_list_gui2->setParentRefId($a_item_data['ref_id']); // @see mantis 10488 if (!$item_readable and !$ilAccess->checkAccess('write', '', $item['ref_id'])) { $item_list_gui2->forceVisibleOnly(true); } if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"]) { $item_list_gui2->enableCheckbox(true); } else { if ($this->getContainerGUI()->isMultiDownloadEnabled()) { // display multi download checkbox $item_list_gui2->enableDownloadCheckbox($item['ref_id'], true); } } if ($this->getContainerGUI()->isActiveItemOrdering()) { $item_list_gui2->setPositionInputField("[sess][" . $a_item_data['obj_id'] . "][" . $item["ref_id"] . "]", sprintf('%d', (int) $pos * 10)); $pos++; } // #10611 ilObjectActivation::addListGUIActivationProperty($item_list_gui2, $item); $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'], $item['obj_id'], $item['title'], $item['description']); $this->determineAdminCommands($item["ref_id"], $item_list_gui2->adminCommandsIncluded()); if (strlen($sub_item_html)) { $item_list_gui->addSubItemHTML($sub_item_html); } } } if ($ilSetting->get("item_cmd_asynch")) { $asynch = true; $ilCtrl->setParameter($this->container_gui, "cmdrefid", $a_item_data['ref_id']); $asynch_url = $ilCtrl->getLinkTarget($this->container_gui, "getAsynchItemList", "", true, false); $ilCtrl->setParameter($this->container_gui, "cmdrefid", ""); } include_once "Services/Object/classes/class.ilObjectActivation.php"; ilObjectActivation::addListGUIActivationProperty($item_list_gui, $a_item_data); $html = $item_list_gui->getListItemHTML($a_item_data['ref_id'], $a_item_data['obj_id'], $a_item_data['title'], $a_item_data['description'], $asynch, false, $asynch_url); $this->determineAdminCommands($a_item_data["ref_id"], $item_list_gui->adminCommandsIncluded()); return $html; }
/** * Redraw a list item (ajax) * * @param * @return */ function redrawListItemObject() { global $tpl; $html = null; $item_data = $this->object->getSubItems(false, false, (int) $_GET["child_ref_id"]); $container_view = $this->getContentGUI(); // list item is session material (not part of "_all"-items - see below) include_once './Modules/Session/classes/class.ilEventItems.php'; $event_items = ilEventItems::_getItemsOfContainer($this->object->getRefId()); if (in_array((int) $_GET["child_ref_id"], $event_items)) { include_once './Services/Object/classes/class.ilObjectActivation.php'; foreach ($this->object->items["sess"] as $id) { $items = ilObjectActivation::getItemsByEvent($id['obj_id']); foreach ($items as $event_item) { if ($event_item["child"] == (int) $_GET["child_ref_id"]) { // sessions if ((int) $_GET["parent_ref_id"]) { $event_item["parent"] = (int) $_GET["parent_ref_id"]; } $html = $container_view->renderItem($event_item); } } } } // "normal" list item if (!$html) { foreach ($this->object->items["_all"] as $id) { if ($id["child"] == (int) $_GET["child_ref_id"]) { $html = $container_view->renderItem($id); } } } if ($html) { echo $html; // we need to add onload code manually (rating, comments, etc.) echo $tpl->getOnLoadCodeForAsynch(); } exit; }