/**
  * Get command target frame
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command target frame
  */
 function getCommandFrame($a_cmd)
 {
     global $ilias;
     switch ($a_cmd) {
         case "view":
             include_once 'Services/Payment/classes/class.ilPaymentObject.php';
             //$showViewInFrameset = $ilias->ini->readVariable("layout","view_target") == "frame";
             $showViewInFrameset = true;
             $isBuyable = ilPaymentObject::_isBuyable($this->ref_id);
             if ($isBuyable && ilPaymentObject::_hasAccess($this->ref_id) == false || $showViewInFrameset) {
                 //$frame = ilFrameTargetInfo::_getFrame("MainContent");
                 $frame = "ilContObj" . $this->obj_id;
             } else {
                 $frame = "ilContObj" . $this->obj_id;
             }
             break;
         case "edit":
             $frame = ilFrameTargetInfo::_getFrame("MainContent");
             break;
         default:
             $frame = "";
             break;
     }
     return $frame;
 }
 /**
  * Get command target frame
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command target frame
  */
 function getCommandFrame($a_cmd)
 {
     if (IS_PAYMENT_ENABLED) {
         include_once 'Services/Payment/classes/class.ilPaymentObject.php';
         if (ilPaymentObject::_isBuyable($this->ref_id) && !ilPaymentObject::_hasAccess($this->ref_id)) {
             return '';
         }
     }
     $frame = "";
     switch ($a_cmd) {
         // BEGIN WebDAV: View inline objects in a blank window
         case 'sendfile':
             require_once 'Modules/File/classes/class.ilObjFileAccess.php';
             if (ilObjFileAccess::_isFileInline($this->title)) {
                 $frame = '_blank';
             }
             break;
             // END WebDAV View inline objects in a blank window
         // END WebDAV View inline objects in a blank window
         case "":
             $frame = ilFrameTargetInfo::_getFrame("RepositoryContent");
             break;
         default:
     }
     return $frame;
 }
 /**
  * @param $cur_obj_type
  * @param $item
  * @return array
  */
 private function getObjectListItem($cur_obj_type, $item)
 {
     if ($cur_obj_type != $item['type']) {
         include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
         $item_list_gui = ilObjectListGUIFactory::_getListGUIByType($item['type']);
     }
     $item_list_gui->initItem($item['ref_id'], $item['obj_id'], $item['title'], $item['description'], ilObjectListGUI::CONTEXT_SHOP);
     $item_list_gui->enableDelete(false);
     $item_list_gui->enableCut(false);
     $item_list_gui->enableCopy(false);
     $item_list_gui->enableLink(false);
     $item_list_gui->enableSubscribe(false);
     $item_list_gui->enablePayment(true);
     $item_list_gui->enableCommands(true);
     $item_list_gui->enablePath(false);
     $item_list_gui->insertCommands();
     $item_list_gui->enableInfoScreen(false);
     $item_list_gui->enableSubstitutions(false);
     $item_list_gui->enableNoticeProperties(false);
     $item_list_gui->enablePreconditions(false);
     $item_list_gui->enableProperties(false);
     $item_list_gui->setBoldTitle(true);
     if (ilPaymentObject::_hasAccess($item['ref_id'])) {
         $item_list_gui->enableInfoScreen(true);
         $item_list_gui->enableCommands(true);
     }
     //		else
     //		{
     switch ($item['type']) {
         case 'sahs':
             $demo_link = 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=' . $item['ref_id'] . '&purchasetype=demo';
             break;
         case 'lm':
             $demo_link = 'ilias.php?baseClass=ilLMPresentationGUI&ref_id=' . $item['ref_id'] . '&purchasetype=demo';
             break;
         case 'exc':
             $demo_link = $this->ctrl->getLinkTargetByClass('ilshoppurchasegui', 'showDemoVersion') . '&purchasetype=demo&ref_id=' . $item["ref_id"];
             break;
         default:
             $demo_link = $this->ctrl->getLinkTargetByClass('ilshoppurchasegui', 'showDemoVersion') . '&purchasetype=demo&ref_id=' . $item["ref_id"];
             break;
     }
     $item['title'] = '<a href="' . $demo_link . '">' . $item["title"] . '</a>';
     //		}
     $tpl_pinfo = new ilTemplate('tpl.shop_item_info.html', true, true, 'Services/Payment');
     if ($item['price_string'] != '') {
         $tpl_pinfo->setCurrentBlock('ploop');
         $tpl_pinfo->setVariable('PROPERTY', $this->lng->txt('price_a'));
         $tpl_pinfo->setVariable('VALUE', $item['price_string']);
         $tpl_pinfo->parseCurrentBlock();
     }
     if ($item['author'] != '') {
         $tpl_pinfo->setCurrentBlock('ploop');
         $tpl_pinfo->setVariable('PROPERTY', $this->lng->txt('author'));
         $tpl_pinfo->setVariable('VALUE', $item['author']);
         $tpl_pinfo->parseCurrentBlock();
     }
     $oFile = new ilFileDataShop(ilPaymentObject::_lookupPobjectId($item['ref_id']));
     if (($webpath_file = $oFile->getCurrentImageWebPath()) !== false) {
         $tpl_pinfo->setCurrentBlock('image');
         $tpl_pinfo->setVariable('SRC', $webpath_file);
         $tpl_pinfo->setVariable('ALT', strip_tags($item['title']));
         $tpl_pinfo->parseCurrentBlock();
     }
     $item_list_gui->addSubItemHTML($tpl_pinfo->get());
     $html = $item_list_gui->getListItemHTML($item['ref_id'], $item['obj_id'], $item['title'], $item['description'], false, false, "", ilObjectListGUI::CONTEXT_SHOP);
     return array($item, $html);
 }
 /**
  * Get assignment body for overview
  */
 function getOverviewBody($a_data)
 {
     global $lng, $ilCtrl, $ilUser;
     $tpl = new ilTemplate("tpl.assignment_body.html", true, true, "Modules/Exercise");
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     include_once "./Services/UIComponent/Button/classes/class.ilLinkButton.php";
     if (IS_PAYMENT_ENABLED) {
         include_once './Services/Payment/classes/class.ilPaymentObject.php';
     }
     $info = new ilInfoScreenGUI(null);
     $info->setTableClass("");
     $not_started_yet = false;
     if ($a_data["start_time"] > 0 && time() - $a_data["start_time"] <= 0) {
         $not_started_yet = true;
     }
     if (!$not_started_yet) {
         // instructions
         $info->addSection($lng->txt("exc_instruction"));
         $is_html = strlen($a_data["instruction"]) != strlen(strip_tags($a_data["instruction"]));
         if (!$is_html) {
             $a_data["instruction"] = nl2br(ilUtil::makeClickable($a_data["instruction"], true));
         }
         $info->addProperty("", $a_data["instruction"]);
     }
     // schedule
     $info->addSection($lng->txt("exc_schedule"));
     if ($a_data["start_time"] > 0) {
         $info->addProperty($lng->txt("exc_start_time"), ilDatePresentation::formatDate(new ilDateTime($a_data["start_time"], IL_CAL_UNIX)));
     }
     if ($a_data["deadline"] > 0) {
         $info->addProperty($lng->txt("exc_edit_until"), ilDatePresentation::formatDate(new ilDateTime($a_data["deadline"], IL_CAL_UNIX)));
     }
     $time_str = $this->getTimeString($a_data["deadline"]);
     if (!$not_started_yet) {
         $info->addProperty($lng->txt("exc_time_to_send"), "<b>" . $time_str . "</b>");
     }
     // public submissions
     if ($this->exc->getShowSubmissions()) {
         $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
         if ($a_data["deadline"] - time() <= 0) {
             $button = ilLinkButton::getInstance();
             $button->setCaption("exc_list_submission");
             $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "listPublicSubmissions"));
             $info->addProperty($lng->txt("exc_public_submission"), $button->render());
         } else {
             $info->addProperty($lng->txt("exc_public_submission"), $lng->txt("exc_msg_public_submission"));
         }
         $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $_GET["ass_id"]);
     }
     $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
     if (!$not_started_yet) {
         // download files
         $files = ilExAssignment::getFiles($a_data["exc_id"], $a_data["id"]);
         if (count($files) > 0) {
             $info->addSection($lng->txt("exc_files"));
             foreach ($files as $file) {
                 // if download must be purchased first show a "buy"-button
                 if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'download') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'download'))) {
                     $info->addProperty($file["name"], $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
                 } else {
                     $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file["name"]));
                     $info->addProperty($file["name"], $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFile"));
                     $ilCtrl->setParameterByClass("ilobjexercisegui", "file", "");
                 }
             }
         }
         // submission
         // if submission must be purchased first
         if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'upload') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'upload'))) {
             $info->addSection($lng->txt("exc_your_submission"));
             $ilCtrl->clearParameters($this);
             $ilCtrl->setParameter($this, "ref_id", $_GET['ref_id']);
             $ilCtrl->setParameter($this, 'subtype', 'upload');
             $info->addProperty($lng->txt('exc_hand_in'), $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
         } else {
             $info->addSection($lng->txt("exc_your_submission"));
             $delivered_files = ilExAssignment::getDeliveredFiles($a_data["exc_id"], $a_data["id"], $ilUser->getId());
             $times_up = false;
             if ($a_data["deadline"] > 0 && $a_data["deadline"] - time() < 0) {
                 $times_up = true;
             }
             $team_members = null;
             switch ($a_data["type"]) {
                 case ilExAssignment::TYPE_UPLOAD_TEAM:
                     $no_team_yet = false;
                     $team_members = ilExAssignment::getTeamMembersByAssignmentId($a_data["id"], $ilUser->getId());
                     if (sizeof($team_members)) {
                         $team = array();
                         foreach ($team_members as $member_id) {
                             $team[] = ilObjUser::_lookupFullname($member_id);
                         }
                         $team = implode(", ", $team);
                         $button = ilLinkButton::getInstance();
                         $button->setCaption("exc_manage_team");
                         $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreenTeam"));
                         $team .= " " . $button->render();
                         $info->addProperty($lng->txt("exc_team_members"), $team);
                     } else {
                         $no_team_yet = true;
                         if (!$times_up) {
                             if (!sizeof($delivered_files)) {
                                 $team_info = $lng->txt("exc_no_team_yet_notice");
                             } else {
                                 $team_info = '<span class="warning">' . $lng->txt("exc_no_team_yet_notice") . '</span>';
                             }
                             $button = ilLinkButton::getInstance();
                             $button->setPrimary(true);
                             $button->setCaption("exc_create_team");
                             $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createTeam"));
                             $team_info .= " " . $button->render();
                             $team_info .= '<div class="ilFormInfo">' . $lng->txt("exc_no_team_yet_info") . '</div>';
                         } else {
                             $team_info = '<span class="warning">' . $lng->txt("exc_create_team_times_up_warning") . '</span>';
                         }
                         $info->addProperty($lng->txt("exc_team_members"), $team_info);
                     }
                     // fallthrough
                 // fallthrough
                 case ilExAssignment::TYPE_UPLOAD:
                     $titles = array();
                     foreach ($delivered_files as $file) {
                         $titles[] = $file["filetitle"];
                     }
                     $files_str = implode($titles, ", ");
                     if ($files_str == "") {
                         $files_str = $lng->txt("message_no_delivered_files");
                     }
                     // no team == no submission
                     if (!$no_team_yet) {
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
                         if (!$times_up) {
                             $title = count($titles) == 0 ? $lng->txt("exc_hand_in") : $lng->txt("exc_edit_submission");
                             $button = ilLinkButton::getInstance();
                             $button->setPrimary(true);
                             $button->setCaption($title, false);
                             $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen"));
                             $files_str .= " " . $button->render();
                         } else {
                             if (count($titles) > 0) {
                                 $button = ilLinkButton::getInstance();
                                 $button->setCaption("already_delivered_files");
                                 $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen"));
                                 $files_str .= " " . $button->render();
                             }
                         }
                     }
                     $info->addProperty($lng->txt("exc_files_returned"), $files_str);
                     break;
                 case ilExAssignment::TYPE_BLOG:
                     include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
                     $wsp_tree = new ilWorkspaceTree($ilUser->getId());
                     // #12939
                     if (!$wsp_tree->getRootId()) {
                         $wsp_tree->createTreeForUser($ilUser->getId());
                     }
                     $files_str = "";
                     $valid_blog = false;
                     if (sizeof($delivered_files)) {
                         $delivered_files = array_pop($delivered_files);
                         $blog_id = (int) $delivered_files["filetitle"];
                         $node = $wsp_tree->getNodeData($blog_id);
                         if ($node["title"]) {
                             // #10116
                             $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", $blog_id);
                             $blog_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpersonalworkspacegui", "ilobjbloggui"), "");
                             $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", "");
                             $files_str = '<a href="' . $blog_link . '">' . $node["title"] . '</a>';
                             $valid_blog = true;
                         } else {
                             if (substr($delivered_files["filename"], -1) == "/") {
                                 $this->exc->deleteResourceObject($delivered_files["ass_id"], $ilUser->getId(), $delivered_files["returned_id"]);
                             }
                         }
                     }
                     if (!$times_up) {
                         if (!$valid_blog) {
                             $button = ilLinkButton::getInstance();
                             $button->setCaption("exc_create_blog");
                             $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createBlog"));
                             $files_str .= $button->render();
                         }
                         // #10462
                         $blogs = sizeof($wsp_tree->getObjectsFromType("blog"));
                         if (!$valid_blog && $blogs || $valid_blog && $blogs > 1) {
                             $button = ilLinkButton::getInstance();
                             $button->setCaption("exc_select_blog" . ($valid_blog ? "_change" : ""));
                             $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectBlog"));
                             $files_str .= " " . $button->render();
                         }
                     }
                     if ($files_str) {
                         $info->addProperty($lng->txt("exc_blog_returned"), $files_str);
                     }
                     if ($delivered_files && substr($delivered_files["filename"], -1) != "/") {
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]);
                         $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download");
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", "");
                         $button = ilLinkButton::getInstance();
                         $button->setCaption("download");
                         $button->setUrl($dl_link);
                         $info->addProperty($lng->txt("exc_files_returned"), $button->render());
                     }
                     break;
                 case ilExAssignment::TYPE_PORTFOLIO:
                     include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
                     $files_str = "";
                     $valid_prtf = false;
                     if (sizeof($delivered_files)) {
                         $delivered_files = array_pop($delivered_files);
                         $portfolio_id = (int) $delivered_files["filetitle"];
                         // #11746
                         if (ilObject::_exists($portfolio_id, false, "prtf")) {
                             $portfolio = new ilObjPortfolio($portfolio_id, false);
                             if ($portfolio->getTitle()) {
                                 // #10116 / #12791
                                 $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", $portfolio_id);
                                 $prtf_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilportfoliorepositorygui", "ilobjportfoliogui"), "view");
                                 $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", "");
                                 $files_str = '<a href="' . $prtf_link . '">' . $portfolio->getTitle() . '</a>';
                                 $valid_prtf = true;
                             }
                         } else {
                             if (substr($delivered_files["filename"], -1) == "/") {
                                 $this->exc->deleteResourceObject($delivered_files["ass_id"], $ilUser->getId(), $delivered_files["returned_id"]);
                             }
                         }
                     }
                     if (!$times_up) {
                         if (!$valid_prtf) {
                             // if there are portfolio templates available show form first
                             include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
                             $has_prtt = sizeof(ilObjPortfolioTemplate::getAvailablePortfolioTemplates()) ? "Template" : "";
                             $button = ilLinkButton::getInstance();
                             $button->setCaption("exc_create_portfolio");
                             $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createPortfolio" . $has_prtt));
                             $files_str .= $button->render();
                         }
                         // #10462
                         $prtfs = sizeof(ilObjPortfolio::getPortfoliosOfUser($ilUser->getId()));
                         if (!$valid_prtf && $prtfs || $valid_prtf && $prtfs > 1) {
                             $button = ilLinkButton::getInstance();
                             $button->setCaption("exc_select_portfolio" . ($valid_prtf ? "_change" : ""));
                             $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectPortfolio"));
                             $files_str .= " " . $button->render();
                         }
                     }
                     if ($files_str) {
                         $info->addProperty($lng->txt("exc_portfolio_returned"), $files_str);
                     }
                     if ($delivered_files && substr($delivered_files["filename"], -1) != "/") {
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]);
                         $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download");
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", "");
                         $button = ilLinkButton::getInstance();
                         $button->setCaption("download");
                         $button->setUrl($dl_link);
                         $info->addProperty($lng->txt("exc_files_returned"), $button->render());
                     }
                     break;
                 case ilExAssignment::TYPE_TEXT:
                     $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
                     if (!$times_up) {
                         $button = ilLinkButton::getInstance();
                         $button->setPrimary(true);
                         $button->setCaption("exc_text_assignment_edit");
                         $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "editAssignmentText"));
                         $files_str = $button->render();
                     } else {
                         $button = ilLinkButton::getInstance();
                         $button->setCaption("exc_text_assignment_show");
                         $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "showAssignmentText"));
                         $files_str = $button->render();
                     }
                     $info->addProperty($lng->txt("exc_files_returned_text"), $files_str);
                     break;
             }
             $last_sub = ilExAssignment::getLastSubmission($a_data["id"], $ilUser->getId());
             if ($last_sub) {
                 $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub, IL_CAL_DATETIME));
             } else {
                 $last_sub = "---";
             }
             if ($last_sub != "---") {
                 $info->addProperty($lng->txt("exc_last_submission"), $last_sub);
             }
             // peer feedback
             if ($times_up && $a_data["peer"]) {
                 $nr_missing_fb = ilExAssignment::getNumberOfMissingFeedbacks($a_data["id"], $a_data["peer_min"]);
                 if (!$a_data["peer_dl"] || $a_data["peer_dl"] > time()) {
                     $dl_info = "";
                     if ($a_data["peer_dl"]) {
                         $dl_info = " (" . sprintf($lng->txt("exc_peer_review_deadline_info_button"), ilDatePresentation::formatDate(new ilDateTime($a_data["peer_dl"], IL_CAL_UNIX))) . ")";
                     }
                     $button = ilLinkButton::getInstance();
                     $button->setPrimary($nr_missing_fb);
                     $button->setCaption($lng->txt("exc_peer_review_give") . $dl_info, false);
                     $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "editPeerReview"));
                     $edit_pc = $button->render();
                 } else {
                     if ($a_data["peer_dl"]) {
                         $edit_pc = $lng->txt("exc_peer_review_deadline_reached");
                     }
                 }
                 if ((!$a_data["peer_dl"] || $a_data["peer_dl"] < time()) && !$nr_missing_fb) {
                     $button = ilLinkButton::getInstance();
                     $button->setCaption("exc_peer_review_show");
                     $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "showPersonalPeerReview"));
                     $view_pc = $button->render();
                 }
                 /*
                 else 
                 {
                 	$view_pc = $lng->txt("exc_peer_review_show_not_rated_yet");
                 }
                 */
                 $info->addProperty($lng->txt("exc_peer_review"), $edit_pc . " " . $view_pc);
             }
             // feedback from tutor
             if ($a_data["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
                 $feedback_id = "t" . ilExAssignment::getTeamIdByAssignment($a_data["id"], $ilUser->getId());
             } else {
                 $feedback_id = $ilUser->getId();
             }
             // global feedback / sample solution
             if ($a_data["fb_date"] == ilExAssignment::FEEDBACK_DATE_DEADLINE) {
                 $show_global_feedback = $times_up && $a_data["fb_file"];
             } else {
                 $show_global_feedback = $last_sub != "---" && $a_data["fb_file"];
             }
             $storage = new ilFSStorageExercise($a_data["exc_id"], $a_data["id"]);
             $cnt_files = $storage->countFeedbackFiles($feedback_id);
             $lpcomment = ilExAssignment::lookupCommentForUser($a_data["id"], $ilUser->getId());
             $mark = ilExAssignment::lookupMarkOfUser($a_data["id"], $ilUser->getId());
             $status = ilExAssignment::lookupStatusOfUser($a_data["id"], $ilUser->getId());
             if ($lpcomment != "" || $mark != "" || $status != "notgraded" || $cnt_files > 0 || $show_global_feedback) {
                 $info->addSection($lng->txt("exc_feedback_from_tutor"));
                 if ($lpcomment != "") {
                     $info->addProperty($lng->txt("exc_comment"), $lpcomment);
                 }
                 if ($mark != "") {
                     $info->addProperty($lng->txt("exc_mark"), $mark);
                 }
                 if ($status == "") {
                     //				  $info->addProperty($lng->txt("status"),
                     //						$lng->txt("message_no_delivered_files"));
                 } else {
                     if ($status != "notgraded") {
                         $img = '<img src="' . ilUtil::getImagePath("scorm/" . $status . ".svg") . '" ' . ' alt="' . $lng->txt("exc_" . $status) . '" title="' . $lng->txt("exc_" . $status) . '" />';
                         $info->addProperty($lng->txt("status"), $img . " " . $lng->txt("exc_" . $status));
                     }
                 }
                 if ($cnt_files > 0) {
                     $info->addSection($lng->txt("exc_fb_files") . '<a name="fb' . $a_data["id"] . '"></a>');
                     if ($cnt_files > 0) {
                         $files = $storage->getFeedbackFiles($feedback_id);
                         foreach ($files as $file) {
                             $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file));
                             $info->addProperty($file, $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFeedbackFile"));
                             $ilCtrl->setParameterByClass("ilobjexercisegui", "file", "");
                         }
                     }
                 }
                 // #15002 - global feedback
                 if ($show_global_feedback) {
                     $info->addSection($lng->txt("exc_global_feedback_file"));
                     $info->addProperty($a_data["fb_file"], $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadGlobalFeedbackFile"));
                 }
             }
         }
     }
     $tpl->setVariable("CONTENT", $info->getHTML());
     return $tpl->get();
 }
 private function renderItems($oContainerTpl, $results, $topic)
 {
     // main shop_content
     global $ilUser;
     $items_counter = 0;
     $cur_obj_type = '';
     $tpl = $this->newBlockTemplate();
     $first = true;
     foreach ($this->type_ordering as $act_type) {
         $item_html = array();
         if (count($results[$topic['id']][$act_type])) {
             foreach ($results[$topic['id']][$act_type] as $key => $item) {
                 // price presentation
                 $oPaymentObject = new ilPaymentObject($ilUser, ilPaymentObject::_lookupPobjectId($item['ref_id']));
                 $oPrice = new ilPaymentPrices((int) $oPaymentObject->getPobjectId());
                 $lowest_price = $oPrice->getLowestPrice();
                 $special_icon = ' ';
                 if ($oPaymentObject->getSpecial() == '1') {
                     $special_icon = ilShopUtils::_getSpecialObjectSymbol();
                 }
                 $results[$topic['id']][$act_type][$key]['title'] = $item['title'] . ' ' . ($results[$topic['id']][$act_type][$key]['special_icon'] = $special_icon);
                 $results[$topic['id']][$act_type][$key]['price'] = $lowest_price['price'];
                 $paymethod_icon = ilShopUtils::_getPaymethodSymbol($oPaymentObject->getPayMethod());
                 //					if(!ilPaymentObject::_hasAccess($item['ref_id']))
                 //					{
                 $shoppingcart_icon = ilShopUtils::_addToShoppingCartSymbol($act_type, $item['ref_id']);
                 //					}
                 //					else $shoppingcart_icon = '';
                 $results[$topic['id']][$act_type][$key]['price_string'] = ($oPrice->getNumberOfPrices() > 1 ? $this->lng->txt('price_from') . ' ' : '') . ilPaymentPrices::_formatPriceToString($lowest_price['price']) . ' ' . ($results[$topic['id']][$act_type][$key]['shoppingcart_icon'] = $shoppingcart_icon . ' ' . ($results[$topic['id']][$act_type][$key]['paymethod_icon'] = $paymethod_icon));
                 // authors
                 include_once 'Services/MetaData/classes/class.ilMD.php';
                 $md_obj = new ilMD($item['obj_id'], 0, $item['type']);
                 if (is_object($md_section = $md_obj->getLifecycle())) {
                     $sep = $ent_str = "";
                     foreach ($ids = $md_section->getContributeIds() as $con_id) {
                         $md_con = $md_section->getContribute($con_id);
                         if ($md_con->getRole() == "Author") {
                             foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
                                 $md_ent = $md_con->getEntity($ent_id);
                                 $ent_str = $ent_str . $sep . $md_ent->getEntity();
                                 $sep = ", ";
                             }
                         }
                     }
                     $results[$topic['id']][$act_type][$key]['author'] = $ent_str;
                 }
             }
             $results[$topic['id']][$act_type] = $this->sortResult($results[$topic['id']][$act_type]);
             foreach ($results[$topic['id']][$act_type] as $key => $item) {
                 // get list gui class for each object type
                 if ($cur_obj_type != $item['type']) {
                     include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
                     $item_list_gui = ilObjectListGUIFactory::_getListGUIByType($item['type']);
                 }
                 $item_list_gui->initItem($item['ref_id'], $item['obj_id'], $item['title'], $item['description'], ilObjectListGUI::CONTEXT_SHOP);
                 $item_list_gui->enableDelete(false);
                 $item_list_gui->enableCut(false);
                 $item_list_gui->enableCopy(false);
                 $item_list_gui->enableLink(false);
                 $item_list_gui->enableSubscribe(false);
                 $item_list_gui->enablePayment(true);
                 $item_list_gui->enableCommands(true);
                 $item_list_gui->enablePath(false);
                 $item_list_gui->insertCommands();
                 $item_list_gui->enableInfoScreen(false);
                 $item_list_gui->enableSubstitutions(false);
                 $item_list_gui->enableNoticeProperties(false);
                 $item_list_gui->enablePreconditions(false);
                 $item_list_gui->enableProperties(false);
                 $item_list_gui->setBoldTitle(true);
                 if (ilPaymentObject::_hasAccess($item['ref_id'])) {
                     $item_list_gui->enableInfoScreen(true);
                     $item_list_gui->enableCommands(true);
                 } else {
                     switch ($item['type']) {
                         case 'sahs':
                             $demo_link = 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=' . $item['ref_id'] . '&purchasetype=demo';
                             break;
                         case 'lm':
                             $demo_link = 'ilias.php?baseClass=ilLMPresentationGUI&ref_id=' . $item['ref_id'] . '&purchasetype=demo';
                             break;
                         case 'exc':
                             $demo_link = $this->ctrl->getLinkTargetByClass('ilshoppurchasegui', 'showDemoVersion') . '&purchasetype=demo&ref_id=' . $item["ref_id"];
                             break;
                         default:
                             $demo_link = $this->ctrl->getLinkTargetByClass('ilshoppurchasegui', 'showDemoVersion') . '&purchasetype=demo&ref_id=' . $item["ref_id"];
                             break;
                     }
                     $item['title'] = '<a href="' . $demo_link . '">' . $item["title"] . '</a>';
                 }
                 $tpl_pinfo = new ilTemplate('tpl.shop_item_info.html', true, true, 'Services/Payment');
                 if ($item['price_string'] != '') {
                     $tpl_pinfo->setCurrentBlock('ploop');
                     $tpl_pinfo->setVariable('PROPERTY', $this->lng->txt('price_a'));
                     $tpl_pinfo->setVariable('VALUE', $item['price_string']);
                     $tpl_pinfo->parseCurrentBlock();
                 }
                 if ($item['author'] != '') {
                     $tpl_pinfo->setCurrentBlock('ploop');
                     $tpl_pinfo->setVariable('PROPERTY', $this->lng->txt('author'));
                     $tpl_pinfo->setVariable('VALUE', $item['author']);
                     $tpl_pinfo->parseCurrentBlock();
                 }
                 $oFile = new ilFileDataShop(ilPaymentObject::_lookupPobjectId($item['ref_id']));
                 if (($webpath_file = $oFile->getCurrentImageWebPath()) !== false) {
                     $tpl_pinfo->setCurrentBlock('image');
                     $tpl_pinfo->setVariable('SRC', $webpath_file);
                     $tpl_pinfo->setVariable('ALT', strip_tags($item['title']));
                     $tpl_pinfo->parseCurrentBlock();
                 }
                 $item_list_gui->addSubItemHTML($tpl_pinfo->get());
                 $html = $item_list_gui->getListItemHTML($item['ref_id'], $item['obj_id'], $item['title'], $item['description'], false, false, "", ilObjectListGUI::CONTEXT_SHOP);
                 if ($html) {
                     $html = $this->__appendChildLinks($html, $item, $item_list_gui);
                     $item_html[$item['ref_id']] = $html;
                 }
             }
             // output block for resource type
             if (count($item_html) > 0) {
                 // separator row
                 if (!$first) {
                     $this->addSeparatorRow($tpl);
                 }
                 $first = false;
                 // add a header for each resource type
                 $this->addHeaderRow($tpl, $act_type);
                 $this->resetRowType();
                 // content row
                 foreach ($item_html as $ref_id => $html) {
                     $this->addStandardRow($tpl, $html, $ref_id);
                 }
                 ++$items_counter;
             }
         }
     }
     if ($items_counter > 0) {
         $oContainerTpl->setCurrentBlock('loop');
         $oContainerTpl->setVariable('TOPIC_TITLE', $topic['title']);
         $oContainerTpl->setVariable('COTAINER_LIST_BLOCK', $tpl->get());
         $oContainerTpl->parseCurrentBlock();
         global $tpl;
         $tpl->setContent($oContainerTpl->get());
     }
 }
 /**
  * Get item properties
  *
  * @return	array		array of property arrays:
  *						"alert" (boolean) => display as an alert property (usually in red)
  *						"property" (string) => property name
  *						"value" (string) => property value
  */
 function getProperties()
 {
     global $lng, $rbacsystem;
     $props = array();
     include_once "./Modules/LearningModule/classes/class.ilObjLearningModuleAccess.php";
     if (ilObjLearningModuleAccess::_isOffline($this->obj_id)) {
         $props[] = array("alert" => true, "property" => $lng->txt("status"), "value" => $lng->txt("offline"));
     }
     if ($rbacsystem->checkAccess('write', $this->ref_id)) {
         $props[] = array("alert" => false, "property" => $lng->txt("type"), "value" => $lng->txt("lm"));
     }
     if (IS_PAYMENT_ENABLED) {
         include_once "Services/Payment/classes/class.ilPaymentObject.php";
         if (ilPaymentObject::_isBuyable($this->ref_id)) {
             if (ilPaymentObject::_hasAccess($this->ref_id)) {
                 $props[] = array("alert" => false, "property" => $lng->txt("payment_system"), "value" => $lng->txt("payment_payed_access"));
             } else {
                 if (ilPaymentObject::_isInCart($this->ref_id)) {
                     $props[] = array("alert" => true, "property" => $lng->txt("payment_system"), "value" => $lng->txt("payment_in_sc"));
                 } else {
                     $props[] = array("alert" => true, "property" => $lng->txt("payment_system"), "value" => $lng->txt("payment_buyable"));
                 }
             }
         }
     }
     return $props;
 }
 /**
  * Get assignment body for overview
  */
 function getOverviewBody($a_data)
 {
     global $lng, $ilCtrl, $ilUser;
     $tpl = new ilTemplate("tpl.assignment_body.html", true, true, "Modules/Exercise");
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     if (IS_PAYMENT_ENABLED) {
         include_once './Services/Payment/classes/class.ilPaymentObject.php';
     }
     $info = new ilInfoScreenGUI(null);
     $info->setTableClass("");
     $not_started_yet = false;
     if ($a_data["start_time"] > 0 && time() - $a_data["start_time"] <= 0) {
         $not_started_yet = true;
     }
     if (!$not_started_yet) {
         // instructions
         $info->addSection($lng->txt("exc_instruction"));
         $info->addProperty("", nl2br(ilUtil::makeClickable($a_data["instruction"], true)));
     }
     // schedule
     $info->addSection($lng->txt("exc_schedule"));
     if ($a_data["start_time"] > 0) {
         $info->addProperty($lng->txt("exc_start_time"), ilDatePresentation::formatDate(new ilDateTime($a_data["start_time"], IL_CAL_UNIX)));
     }
     if ($a_data["deadline"] > 0) {
         $info->addProperty($lng->txt("exc_edit_until"), ilDatePresentation::formatDate(new ilDateTime($a_data["deadline"], IL_CAL_UNIX)));
     }
     $time_str = $this->getTimeString($a_data["deadline"]);
     if (!$not_started_yet) {
         $info->addProperty($lng->txt("exc_time_to_send"), "<b>" . $time_str . "</b>");
     }
     // public submissions
     if ($this->exc->getShowSubmissions()) {
         $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
         if ($a_data["deadline"] - time() <= 0) {
             $link = '<a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "listPublicSubmissions") . '">' . $lng->txt("exc_list_submission") . '</a>';
             $info->addProperty($lng->txt("exc_public_submission"), $link);
         } else {
             $info->addProperty($lng->txt("exc_public_submission"), $lng->txt("exc_msg_public_submission"));
         }
         $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $_GET["ass_id"]);
     }
     $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
     if (!$not_started_yet) {
         // download files
         $files = ilExAssignment::getFiles($a_data["exc_id"], $a_data["id"]);
         if (count($files) > 0) {
             $info->addSection($lng->txt("exc_files"));
             foreach ($files as $file) {
                 // if download must be purchased first show a "buy"-button
                 if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'download') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'download'))) {
                     $info->addProperty($file["name"], $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
                 } else {
                     $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file["name"]));
                     $info->addProperty($file["name"], $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFile"));
                     $ilCtrl->setParameterByClass("ilobjexercisegui", "file", "");
                 }
             }
         }
         // submission
         // if submission must be purchased first
         if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'upload') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'upload'))) {
             $info->addSection($lng->txt("exc_your_submission"));
             $ilCtrl->clearParameters($this);
             $ilCtrl->setParameter($this, "ref_id", $_GET['ref_id']);
             $ilCtrl->setParameter($this, 'subtype', 'upload');
             $info->addProperty($lng->txt('exc_hand_in'), $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
         } else {
             $info->addSection($lng->txt("exc_your_submission"));
             $delivered_files = ilExAssignment::getDeliveredFiles($a_data["exc_id"], $a_data["id"], $ilUser->getId());
             $times_up = false;
             if ($a_data["deadline"] > 0 && $a_data["deadline"] - time() < 0) {
                 $times_up = true;
             }
             $team_members = null;
             switch ($a_data["type"]) {
                 case ilExAssignment::TYPE_UPLOAD_TEAM:
                     $team_members = ilExAssignment::getTeamMembersByAssignmentId($a_data["id"], $ilUser->getId());
                     if (sizeof($team_members) > 1) {
                         $team = array();
                         foreach ($team_members as $member_id) {
                             $team[] = ilObjUser::_lookupFullname($member_id);
                         }
                         $info->addProperty($lng->txt("exc_team_members"), implode(", ", $team));
                     }
                     // fallthrough
                 // fallthrough
                 case ilExAssignment::TYPE_UPLOAD:
                     $titles = array();
                     foreach ($delivered_files as $file) {
                         $titles[] = $file["filetitle"];
                     }
                     $files_str = implode($titles, ", ");
                     if ($files_str == "") {
                         $files_str = $lng->txt("message_no_delivered_files");
                     }
                     $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
                     if (!$times_up) {
                         $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen") . '">' . (count($titles) == 0 ? $lng->txt("exc_hand_in") : $lng->txt("exc_edit_submission")) . '</a>';
                     } else {
                         if (count($titles) > 0) {
                             $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen") . '">' . $lng->txt("already_delivered_files") . '</a>';
                         }
                     }
                     $info->addProperty($lng->txt("exc_files_returned"), $files_str);
                     break;
                 case ilExAssignment::TYPE_BLOG:
                     $files_str = "";
                     $valid_blog = false;
                     if (sizeof($delivered_files)) {
                         $delivered_files = array_pop($delivered_files);
                         $blog_id = (int) $delivered_files["filetitle"];
                         include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
                         include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
                         $wsp_tree = new ilWorkspaceTree($ilUser->getId());
                         $node = $wsp_tree->getNodeData($blog_id);
                         if ($node["title"]) {
                             // #10116
                             // $blog_link = ilWorkspaceAccessHandler::getGotoLink($blog_id, $node["obj_id"]);
                             $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", $blog_id);
                             $blog_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpersonalworkspacegui", "ilobjbloggui"), "");
                             $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", "");
                             $files_str = '<a href="' . $blog_link . '">' . $node["title"] . '</a>';
                             $valid_blog = true;
                         }
                     }
                     if (!$times_up) {
                         if (!$valid_blog) {
                             $files_str .= '<a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createBlog") . '">' . $lng->txt("exc_create_blog") . '</a>';
                         }
                         $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectBlog") . '">' . $lng->txt("exc_select_blog" . ($valid_blog ? "_change" : "")) . '</a>';
                     }
                     if ($files_str) {
                         $info->addProperty($lng->txt("exc_blog_returned"), $files_str);
                     }
                     if ($delivered_files && substr($delivered_files["filename"], -1) != "/") {
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]);
                         $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download");
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", "");
                         $info->addProperty($lng->txt("exc_files_returned"), "<a href=\"" . $dl_link . "\">" . $lng->txt("download") . "</a>");
                     }
                     break;
                 case ilExAssignment::TYPE_PORTFOLIO:
                     $files_str = "";
                     $valid_prtf = false;
                     if (sizeof($delivered_files)) {
                         $delivered_files = array_pop($delivered_files);
                         $portfolio_id = (int) $delivered_files["filetitle"];
                         include_once "Services/Portfolio/classes/class.ilObjPortfolio.php";
                         include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
                         $portfolio = new ilObjPortfolio($portfolio_id, false);
                         if ($portfolio->getTitle()) {
                             // #10116
                             // $prtf_link = ilWorkspaceAccessHandler::getGotoLink($portfolio_id, $portfolio_id)
                             $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", $portfolio_id);
                             $prtf_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilobjportfoliogui"), "pages");
                             $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", "");
                             $files_str = '<a href="' . $prtf_link . '">' . $portfolio->getTitle() . '</a>';
                             $valid_prtf = true;
                         }
                     }
                     if (!$times_up) {
                         if (!$valid_prtf) {
                             $files_str .= '<a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createPortfolio") . '">' . $lng->txt("exc_create_portfolio") . '</a>';
                         }
                         $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectPortfolio") . '">' . $lng->txt("exc_select_portfolio" . ($valid_prtf ? "_change" : "")) . '</a>';
                     }
                     if ($files_str) {
                         $info->addProperty($lng->txt("exc_portfolio_returned"), $files_str);
                     }
                     if ($delivered_files && substr($delivered_files["filename"], -1) != "/") {
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]);
                         $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download");
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", "");
                         $info->addProperty($lng->txt("exc_files_returned"), "<a href=\"" . $dl_link . "\">" . $lng->txt("download") . "</a>");
                     }
                     break;
             }
             $last_sub = ilExAssignment::getLastSubmission($a_data["id"], $ilUser->getId());
             if ($last_sub) {
                 $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub, IL_CAL_DATETIME));
             } else {
                 $last_sub = "---";
             }
             if ($last_sub != "---") {
                 $info->addProperty($lng->txt("exc_last_submission"), $last_sub);
             }
             // feedback from tutor
             if ($a_data["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
                 $feedback_id = "t" . ilExAssignment::getTeamIdByAssignment($a_data["id"], $ilUser->getId());
             } else {
                 $feedback_id = $ilUser->getId();
             }
             $storage = new ilFSStorageExercise($a_data["exc_id"], $a_data["id"]);
             $cnt_files = $storage->countFeedbackFiles($feedback_id);
             $lpcomment = ilExAssignment::lookupCommentForUser($a_data["id"], $ilUser->getId());
             $mark = ilExAssignment::lookupMarkOfUser($a_data["id"], $ilUser->getId());
             $status = ilExAssignment::lookupStatusOfUser($a_data["id"], $ilUser->getId());
             if ($lpcomment != "" || $mark != "" || $status != "notgraded" || $cnt_files > 0) {
                 $info->addSection($lng->txt("exc_feedback_from_tutor"));
                 if ($lpcomment != "") {
                     $info->addProperty($lng->txt("exc_comment"), $lpcomment);
                 }
                 if ($mark != "") {
                     $info->addProperty($lng->txt("exc_mark"), $mark);
                 }
                 if ($status == "") {
                     //				  $info->addProperty($lng->txt("status"),
                     //						$lng->txt("message_no_delivered_files"));
                 } else {
                     if ($status != "notgraded") {
                         $img = '<img border="0" src="' . ilUtil::getImagePath("scorm/" . $status . ".png") . '" ' . ' alt="' . $lng->txt("exc_" . $status) . '" title="' . $lng->txt("exc_" . $status) . '" style="vertical-align:middle;"/>';
                         $info->addProperty($lng->txt("status"), $img . " " . $lng->txt("exc_" . $status));
                     }
                 }
                 if ($cnt_files > 0) {
                     $info->addSection($lng->txt("exc_fb_files"));
                     $files = $storage->getFeedbackFiles($feedback_id);
                     foreach ($files as $file) {
                         $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file));
                         $info->addProperty($file, $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFeedbackFile"));
                         $ilCtrl->setParameter($this, "file", "");
                     }
                 }
             }
         }
     }
     $tpl->setVariable("CONTENT", $info->getHTML());
     return $tpl->get();
 }
 /**
  * Get command target frame
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command target frame
  */
 function getCommandFrame($a_cmd)
 {
     global $ilias;
     switch ($a_cmd) {
         case "view":
             include_once 'Services/Payment/classes/class.ilPaymentObject.php';
             require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
             $sahs_obj = new ilObjSAHSLearningModule($this->ref_id);
             if (ilPaymentObject::_isBuyable($this->ref_id) && !ilPaymentObject::_hasAccess($this->ref_id)) {
                 $frame = '';
             } else {
                 if ($this->offline_mode) {
                     $frame = ilFrameTargetInfo::_getFrame("MainContent");
                 } else {
                     $frame = "ilContObj" . $this->obj_id;
                 }
             }
             if ($sahs_obj->getEditable() == 1) {
                 $frame = ilFrameTargetInfo::_getFrame("MainContent");
             }
             break;
         case "edit":
         case "editContent":
             $frame = ilFrameTargetInfo::_getFrame("MainContent");
             break;
         case "infoScreen":
             $frame = ilFrameTargetInfo::_getFrame("MainContent");
             break;
         default:
             $frame = "";
             break;
     }
     return $frame;
 }