コード例 #1
0
 public function getHTML()
 {
     global $ilCtrl;
     $rgui = new ilRatingGUI();
     $rgui->setObject($this->getRecord()->getId(), "dcl_record", $this->getField()->getId(), "dcl_field");
     $ilCtrl->setParameterByClass("ilratinggui", "field_id", $this->getField()->getId());
     $ilCtrl->setParameterByClass("ilratinggui", "record_id", $this->getRecord()->getId());
     $html = $rgui->getHTML();
     return $html;
 }
コード例 #2
0
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilUser;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilnotegui":
             $this->getTabs();
             $ilTabs->setTabActive("pg");
             return $this->preview();
             break;
         case "ilratinggui":
             // for rating side block
             include_once "./Services/Rating/classes/class.ilRatingGUI.php";
             $rating_gui = new ilRatingGUI();
             $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki", $this->getPageObject()->getId(), "wpg");
             $this->ctrl->forwardCommand($rating_gui);
             $ilCtrl->redirect($this, "preview");
             break;
         case "ilpageobjectgui":
             die("Deprecated. Wikipage gui forwarding to ilpageobject");
             return;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $gui->enableCommentsSettings(false);
             $gui->setRatingCallback($this, "preview");
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             if ($_GET["ntf"]) {
                 include_once "./Services/Notification/classes/class.ilNotification.php";
                 switch ($_GET["ntf"]) {
                     case 1:
                         ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
                         break;
                     case 2:
                         // remove all page notifications here?
                         ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
                         break;
                     case 3:
                         ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false);
                         break;
                     case 4:
                         ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true);
                         break;
                 }
                 $ilCtrl->redirect($this, "preview");
             }
             $this->setPresentationTitle($this->getWikiPage()->getTitle());
             return parent::executeCommand();
     }
 }
コード例 #3
0
 protected function fillRow($a_set)
 {
     global $ilCtrl;
     if ($this->show_peer_review && isset($a_set["peer"])) {
         $acc_data = array();
         foreach ($a_set["peer"] as $peer_id => $peer_review) {
             $peer_name = ilUserUtil::getNamePresentation($peer_id);
             $acc_item = $peer_name;
             if ($peer_review[1]) {
                 $rating = new ilRatingGUI();
                 $rating->setObject($this->ass->getId(), "ass", $a_set["uid"], "peer");
                 $rating->setUserId($peer_id);
                 $acc_item .= " " . $rating->getHTML(false, false);
             }
             if ($peer_review[0]) {
                 $acc_item .= '<div class="small">' . nl2br($peer_review[0]) . "</div>";
             }
             $uploads = $this->ass->getPeerUploadFiles($a_set["uid"], $peer_id);
             if ($uploads) {
                 $acc_item .= '<div class="small">';
                 $ilCtrl->setParameter($this->parent_obj, "fu", $peer_id . "__" . $a_set["uid"]);
                 foreach ($uploads as $file) {
                     $ilCtrl->setParameter($this->parent_obj, "fuf", md5($file));
                     $dl = $ilCtrl->getLinkTarget($this->parent_obj, "downloadPeerReview");
                     $ilCtrl->setParameter($this->parent_obj, "fuf", "");
                     $acc_item .= '<a href="' . $dl . '">' . basename($file) . '</a><br />';
                 }
                 $ilCtrl->setParameter($this->parent_obj, "fu", "");
                 $acc_item .= '</div>';
             }
             $acc_data[$peer_id] = array("name" => $peer_name, "review" => $acc_item);
         }
         if ($acc_data) {
             $acc_data = ilUtil::sortArray($acc_data, "name", "asc");
             $acc = new ilAccordionGUI();
             $acc->setId($this->ass->getId() . "_" . $a_set["uid"]);
             $acc_html = "<ul>";
             foreach ($acc_data as $acc_item) {
                 $acc_html .= "<li>" . $acc_item["review"] . "</li>";
             }
             $acc_html .= "</ul>";
             $acc->addItem($this->lng->txt("show") . " (" . sizeof($acc_data) . ")", $acc_html);
             $this->tpl->setCurrentBlock("peer_bl");
             $this->tpl->setVariable("PEER_REVIEW", $acc->getHTML());
             $this->tpl->parseCurrentBlock();
         }
     }
     $this->tpl->setVariable("USER_NAME", $a_set["uname"]);
     $this->tpl->setVariable("USER_DATE", ilDatePresentation::formatDate(new ilDate($a_set["udate"], IL_CAL_DATETIME)));
     $this->tpl->setVariable("USER_TEXT", $a_set["utext"]);
 }
コード例 #4
0
 function addHeaderAction($a_redraw = false)
 {
     global $ilUser, $ilAccess;
     include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
     $dispatcher = new ilCommonActionDispatcherGUI(ilCommonActionDispatcherGUI::TYPE_REPOSITORY, $ilAccess, "wiki", $_GET["ref_id"], $this->getPageObject()->getParentId());
     $dispatcher->setSubObject("wpg", $this->getPageObject()->getId());
     include_once "Services/Object/classes/class.ilObjectListGUI.php";
     ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true), $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false), $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
     $lg = $dispatcher->initHeaderAction();
     $lg->enableNotes(true);
     $lg->enableComments(ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()), false);
     // notification
     if ($ilUser->getId() != ANONYMOUS_USER_ID) {
         include_once "./Services/Notification/classes/class.ilNotification.php";
         if (ilNotification::hasNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId())) {
             $this->ctrl->setParameter($this, "ntf", 1);
             $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
             $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_on.png"), $this->lng->txt("wiki_notification_activated"));
         } else {
             $this->ctrl->setParameter($this, "ntf", 2);
             $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
             if (ilNotification::hasNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId())) {
                 $this->ctrl->setParameter($this, "ntf", 3);
                 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
                 $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_on.png"), $this->lng->txt("wiki_page_notification_activated"));
             } else {
                 $this->ctrl->setParameter($this, "ntf", 4);
                 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
                 $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_off.png"), $this->lng->txt("wiki_notification_deactivated"));
             }
         }
         $this->ctrl->setParameter($this, "ntf", "");
     }
     // rating
     $wiki_id = $this->getPageObject()->getParentId();
     if (ilObjWiki::_lookupRating($wiki_id) && $this->getPageObject()->getRating() && $this->getPageObject()->old_nr == 0) {
         include_once "./Services/Rating/classes/class.ilRatingGUI.php";
         $rating_gui = new ilRatingGUI();
         $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki", $this->getPageObject()->getId(), "wpg");
         $rating_gui->setYourRatingText($this->lng->txt("wiki_rate_page"));
         $rating_gui->enableCategories(ilObjWiki::_lookupRatingCategories($wiki_id));
         $lg->addHeaderIconHTML("rating", $this->ctrl->getHtml($rating_gui));
     }
     if (!$a_redraw) {
         $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
     } else {
         return $lg->getHeaderAction();
     }
 }
コード例 #5
0
 function updatePageRating()
 {
     global $ilUser;
     $pg_id = $_GET["pgid"];
     if (!$this->ctrl->isAsynch() || !$pg_id) {
         exit;
     }
     include_once './Services/Rating/classes/class.ilRating.php';
     $rating = (int) $_POST["rating"];
     if ($rating) {
         ilRating::writeRatingForUserAndObject($this->lm->getId(), "lm", $pg_id, "lm", $ilUser->getId(), $_POST["rating"]);
     } else {
         ilRating::resetRatingForUserAndObject($this->lm->getId(), "lm", $pg_id, "lm", $ilUser->getId());
     }
     include_once './Services/Rating/classes/class.ilRatingGUI.php';
     $rating = new ilRatingGUI();
     $rating->setObject($this->lm->getId(), "lm", $pg_id, "lm", $ilUser->getId());
     $rating->setYourRatingText($this->lng->txt("lm_rate_page"));
     echo $rating->getHtml(true, true, "il.LearningModule.saveRating(%rating%);");
     echo $this->tpl->getOnLoadCodeForAsynch();
     exit;
 }
コード例 #6
0
 function executeCommand()
 {
     global $ilCtrl;
     // check access for object
     if ($this->node_id && !$this->access_handler->checkAccess("visible", "", $this->node_id) && !$this->access_handler->checkAccess("read", "", $this->node_id)) {
         exit;
     }
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd();
     $ilCtrl->saveParameter($this, "cadh");
     switch ($next_class) {
         case "ilnotegui":
             $obj_type = $this->obj_type;
             if ($this->sub_type) {
                 $obj_type = $this->sub_type;
             }
             include_once "Services/Notes/classes/class.ilNoteGUI.php";
             $note_gui = new ilNoteGUI($this->obj_id, $this->sub_id, $obj_type);
             $note_gui->enablePrivateNotes(true);
             // comments cannot be turned off globally
             if ($this->enable_comments_settings) {
                 // should only be shown if active or permission to toggle
                 if ($this->access_handler->checkAccess("write", "", $this->node_id) || $this->access_handler->checkAccess("edit_permissions", "", $this->node_id)) {
                     $note_gui->enableCommentsSettings();
                 }
             } else {
                 if ($this->sub_id) {
                     $note_gui->enablePublicNotes(true);
                 }
             }
             $ilCtrl->forwardCommand($note_gui);
             break;
         case "iltagginggui":
             include_once "Services/Tagging/classes/class.ilTaggingGUI.php";
             $tags_gui = new ilTaggingGUI($this->node_id);
             $tags_gui->setObject($this->obj_id, $this->obj_type);
             $ilCtrl->forwardCommand($tags_gui);
             break;
         case "ilobjectactivationgui":
             $ilCtrl->setParameter($this, "parent_id", (int) $_REQUEST['parent_id']);
             include_once 'Services/Object/classes/class.ilObjectActivationGUI.php';
             $act_gui = new ilObjectActivationGUI((int) $_REQUEST['parent_id'], $this->node_id);
             $ilCtrl->forwardCommand($act_gui);
             break;
         case "ilratinggui":
             include_once "./Services/Rating/classes/class.ilRatingGUI.php";
             $rating_gui = new ilRatingGUI();
             $rating_gui->setObject($this->obj_id, $this->obj_type, $this->sub_id, $this->sub_type);
             $ilCtrl->forwardCommand($rating_gui);
             if ($this->rating_callback) {
                 // as rating in categories is form-based we need to redirect
                 // somewhere after saving
                 $ilCtrl->redirect($this->rating_callback[0], $this->rating_callback[1]);
             }
             break;
         default:
             break;
     }
     exit;
 }
コード例 #7
0
 /**
  * Fill table row
  */
 protected function fillRow($d)
 {
     global $lng, $ilCtrl;
     $this->tpl->setVariable("TXT_ASS_TITLE", $d["title"]);
     $file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->exc_id, $d["type"], $d["id"], $this->part_id, $this->parent_cmd);
     $has_no_team_yet = false;
     if ($d["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
         $members = ilExAssignment::getTeamMembersByAssignmentId($d["id"], $this->part_id);
         // #11957
         if (sizeof($members)) {
             $this->tpl->setCurrentBlock("ass_members");
             foreach ($members as $member_id) {
                 $this->tpl->setVariable("TXT_MEMBER_NAME", ilObjUser::_lookupFullname($member_id));
                 $this->tpl->parseCurrentBlock();
             }
             $ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
             $this->tpl->setVariable("HREF_LOG", $ilCtrl->getLinkTarget($this->parent_obj, "showTeamLog"));
             $this->tpl->setVariable("TXT_LOG", $lng->txt("exc_team_log"));
             $ilCtrl->setParameter($this->parent_obj, "lpart", "");
         } else {
             // #11957
             $has_no_team_yet = true;
             $this->tpl->setCurrentBlock("team_info");
             $this->tpl->setVariable("TXT_TEAM_INFO", $lng->txt("exc_no_team_yet"));
             $this->tpl->setVariable("TXT_CREATE_TEAM", $lng->txt("exc_create_team"));
             $ilCtrl->setParameter($this->parent_obj, "ass_id", $d["id"]);
             $ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
             $this->tpl->setVariable("URL_CREATE_TEAM", $ilCtrl->getLinkTarget($this->getParentObject(), "createSingleMemberTeam"));
             $ilCtrl->setParameter($this->parent_obj, "lpart", "");
             $ilCtrl->setParameter($this->parent_obj, "ass_id", "");
             if ($file_info["files"]["count"]) {
                 $this->tpl->setVariable("TEAM_FILES_INFO", "<br />" . $file_info["files"]["txt"] . ": " . $file_info["files"]["count"]);
             }
             $this->tpl->parseCurrentBlock();
         }
     }
     if (!$has_no_team_yet) {
         $this->tpl->setVariable("VAL_CHKBOX", ilUtil::formCheckbox(0, "assid[" . $d["id"] . "]", 1));
         $this->tpl->setVariable("VAL_ID", $d["id"]);
         $this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
         $this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
         $this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
         $this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
         if ($file_info["files"]["download_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
             $this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         if ($file_info["files"]["download_new_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
             $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         // note
         $this->tpl->setVariable("TXT_NOTE", $lng->txt("exc_note_for_tutor"));
         $this->tpl->setVariable("NAME_NOTE", "notice[" . $d["id"] . "]");
         $this->tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput(ilExAssignment::lookupNoticeOfUser($d["id"], $this->part_id)));
         // comment for learner
         $lcomment_value = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
         $overlay_id = "excasscomm_" . $d["id"] . "_" . $this->part_id;
         $overlay_trigger_id = $overlay_id . "_tr";
         $overlay = new ilOverlayGUI($overlay_id);
         $overlay->setAnchor($overlay_trigger_id);
         $overlay->setTrigger($overlay_trigger_id, "click", $overlay_trigger_id);
         $overlay->add();
         $this->tpl->setVariable("LCOMMENT_ID", $overlay_id . "_snip");
         $this->tpl->setVariable("LCOMMENT_SNIPPET", ilUtil::shortenText($lcomment_value, 25, true));
         $this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_ID", $overlay_trigger_id);
         $this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_TEXT", $lng->txt("exc_comment_for_learner_edit"));
         $lcomment_form = new ilPropertyFormGUI();
         $lcomment_form->setId($overlay_id);
         $lcomment_form->setPreventDoubleSubmission(false);
         $lcomment = new ilTextAreaInputGUI($lng->txt("exc_comment_for_learner"), "lcomment_" . $d["id"] . "_" . $this->part_id);
         $lcomment->setInfo($lng->txt("exc_comment_for_learner_info"));
         $lcomment->setValue($lcomment_value);
         $lcomment->setCols(45);
         $lcomment->setRows(5);
         $lcomment_form->addItem($lcomment);
         //$lcomment_form->addCommandButton("save", $lng->txt("save"));
         // $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
         $this->overlay_tpl->setCurrentBlock("overlay_bl");
         $this->overlay_tpl->setVariable("COMMENT_OVERLAY_ID", $overlay_id);
         $this->overlay_tpl->setVariable("COMMENT_OVERLAY_FORM", $lcomment_form->getHTML());
         $this->overlay_tpl->parseCurrentBlock();
         /*			
         $this->tpl->setVariable("TXT_LCOMMENT", $lng->txt("exc_comment_for_learner"));
         $this->tpl->setVariable("NAME_LCOMMENT",
         	"lcomment[".$d["id"]."]");
         $lpcomment = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
         $this->tpl->setVariable("VAL_LCOMMENT",
         	ilUtil::prepareFormOutput($lpcomment));
         */
         // solved
         //$this->tpl->setVariable("CHKBOX_SOLVED",
         //	ilUtil::formCheckbox($this->exc->members_obj->getStatusByMember($member_id),"solved[$member_id]",1));
         $status = ilExAssignment::lookupStatusOfUser($d["id"], $this->part_id);
         $this->tpl->setVariable("SEL_" . strtoupper($status), ' selected="selected" ');
         $this->tpl->setVariable("TXT_NOTGRADED", $lng->txt("exc_notgraded"));
         $this->tpl->setVariable("TXT_PASSED", $lng->txt("exc_passed"));
         $this->tpl->setVariable("TXT_FAILED", $lng->txt("exc_failed"));
         if (($sd = ilExAssignment::lookupStatusTimeOfUser($d["id"], $this->part_id)) > 0) {
             $this->tpl->setCurrentBlock("status_date");
             $this->tpl->setVariable("TXT_LAST_CHANGE", $lng->txt("last_change"));
             $this->tpl->setVariable('VAL_STATUS_DATE', ilDatePresentation::formatDate(new ilDateTime($sd, IL_CAL_DATETIME)));
             $this->tpl->parseCurrentBlock();
         }
         switch ($status) {
             case "passed":
                 $pic = "scorm/passed.svg";
                 break;
             case "failed":
                 $pic = "scorm/failed.svg";
                 break;
             default:
                 $pic = "scorm/not_attempted.svg";
                 break;
         }
         $this->tpl->setVariable("IMG_STATUS", ilUtil::getImagePath($pic));
         $this->tpl->setVariable("ALT_STATUS", $lng->txt("exc_" . $status));
         // mark
         $this->tpl->setVariable("TXT_MARK", $lng->txt("exc_mark"));
         $this->tpl->setVariable("NAME_MARK", "mark[" . $d["id"] . "]");
         $mark = ilExAssignment::lookupMarkOfUser($d["id"], $this->part_id);
         $this->tpl->setVariable("VAL_MARK", ilUtil::prepareFormOutput($mark));
         // feedback
         $ilCtrl->setParameter($this->parent_obj, "member_id", $this->part_id);
         if (($ft = ilExAssignment::lookupFeedbackTimeOfUser($d["id"], $this->part_id)) > 0) {
             $this->tpl->setCurrentBlock("feedback_date");
             $this->tpl->setVariable("TXT_FEEDBACK_MAIL_SENT", sprintf($lng->txt("exc_sent_at"), ilDatePresentation::formatDate(new ilDateTime($ft, IL_CAL_DATETIME))));
             $this->tpl->parseCurrentBlock();
         }
         $ilCtrl->setParameter($this, "rcp_to", $this->user->getLogin());
         $this->tpl->setVariable("LINK_FEEDBACK", $ilCtrl->getLinkTarget($this->parent_obj, "redirectFeedbackMail"));
         //"ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".$mem_obj->getLogin());
         $this->tpl->setVariable("TXT_FEEDBACK", $lng->txt("exc_send_mail"));
         $ilCtrl->setParameter($this->parent_obj, "rcp_to", "");
         if ($d["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
             $feedback_id = "t" . ilExAssignment::getTeamIdByAssignment($d["id"], $this->part_id);
         } else {
             $feedback_id = $this->part_id;
         }
         $storage = new ilFSStorageExercise($this->exc_id, $d["id"]);
         $cnt_files = $storage->countFeedbackFiles($feedback_id);
         $ilCtrl->setParameter($this->parent_obj, "fsmode", "feedbackpart");
         $this->tpl->setVariable("LINK_FILE_FEEDBACK", $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
         if ($cnt_files == 0) {
             $this->tpl->setVariable("TXT_FILE_FEEDBACK", $lng->txt("exc_add_feedback_file"));
         } else {
             $this->tpl->setVariable("TXT_FILE_FEEDBACK", $lng->txt("exc_fb_files") . " (" . $cnt_files . ")");
         }
         // peer review / rating
         if ($d["type"] != ilExAssignment::TYPE_UPLOAD_TEAM && $d["peer"]) {
             $this->tpl->setCurrentBlock("peer_review_bl");
             $this->tpl->setVariable("TXT_PEER_REVIEW", $lng->txt("exc_peer_review_show"));
             $ilCtrl->setParameter($this->parent_obj, "grd", 2);
             $this->tpl->setVariable("LINK_PEER_REVIEW", $ilCtrl->getLinkTarget($this->parent_obj, "showPersonalPeerReview"));
             $ilCtrl->setParameter($this->parent_obj, "grd", "");
             $rating = new ilRatingGUI();
             $rating->setObject($d["id"], "ass", $this->part_id, "peer");
             $rating->setUserId(0);
             $this->tpl->setVariable("VAL_RATING", $rating->getHTML(true, false));
             $this->tpl->parseCurrentBlock();
         }
         $ilCtrl->setParameter($this->parent_obj, "ass_id", $_GET["ass_id"]);
     } else {
         $this->tpl->touchBlock("member_has_no_team_bl");
     }
 }
コード例 #8
0
 /**
  * Fill table row
  */
 protected function fillRow($member)
 {
     global $lng, $ilCtrl;
     include_once "./Services/Object/classes/class.ilObjectFactory.php";
     $member_id = $member["usr_id"];
     if (!($mem_obj = ilObjectFactory::getInstanceByObjId($member_id, false))) {
         return;
     }
     $has_no_team_yet = substr($member["team_id"], 0, 3) == "nty";
     if (!$has_no_team_yet) {
         // mail sent
         if ($this->sent_col) {
             if (ilExAssignment::lookupStatusSentOfUser($this->ass_id, $member_id)) {
                 $this->tpl->setCurrentBlock("mail_sent");
                 if (($st = ilExAssignment::lookupSentTimeOfUser($this->ass_id, $member_id)) > 0) {
                     $this->tpl->setVariable("TXT_MAIL_SENT", sprintf($lng->txt("exc_sent_at"), ilDatePresentation::formatDate(new ilDateTime($st, IL_CAL_DATETIME))));
                 } else {
                     $this->tpl->setVariable("TXT_MAIL_SENT", $lng->txt("sent"));
                 }
                 $this->tpl->parseCurrentBlock();
             } else {
                 $this->tpl->setCurrentBlock("mail_sent");
                 $this->tpl->setVariable("TXT_MAIL_SENT", "&nbsp;");
                 $this->tpl->parseCurrentBlock();
             }
         }
         // checkbox
         $this->tpl->setVariable("VAL_CHKBOX", ilUtil::formCheckbox(0, "member[{$member_id}]", 1));
         $this->tpl->setVariable("VAL_ID", $member_id);
     }
     $file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->exc_id, $this->type, $this->ass_id, $member_id, $this->parent_cmd);
     // name and login
     if (!isset($member["team"])) {
         $this->tpl->setVariable("TXT_NAME", $member["name"]);
         if (in_array("login", $this->selected)) {
             $this->tpl->setVariable("TXT_LOGIN", "[" . $member["login"] . "]");
         }
         if (in_array("image", $this->selected)) {
             // image
             $this->tpl->setVariable("USR_IMAGE", $mem_obj->getPersonalPicturePath("xxsmall"));
             $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
         }
     } else {
         $this->tpl->setCurrentBlock("team_member");
         asort($member["team"]);
         foreach ($member["team"] as $member_name) {
             $this->tpl->setVariable("TXT_MEMBER_NAME", $member_name);
             $this->tpl->parseCurrentBlock();
         }
         if (!$has_no_team_yet) {
             $this->tpl->setCurrentBlock("team_log");
             $ilCtrl->setParameter($this->parent_obj, "lmem", $member_id);
             $this->tpl->setVariable("HREF_LOG", $ilCtrl->getLinkTarget($this->parent_obj, "showTeamLog"));
             $this->tpl->setVariable("TXT_LOG", $lng->txt("exc_team_log"));
             $ilCtrl->setParameter($this->parent_obj, "lmem", "");
             $this->tpl->parseCurrentBlock();
         } else {
             // #11957
             $this->tpl->setCurrentBlock("team_info");
             $this->tpl->setVariable("TXT_TEAM_INFO", $lng->txt("exc_no_team_yet"));
             $this->tpl->setVariable("TXT_CREATE_TEAM", $lng->txt("exc_create_team"));
             $ilCtrl->setParameter($this->parent_obj, "lmem", $member_id);
             $this->tpl->setVariable("URL_CREATE_TEAM", $ilCtrl->getLinkTarget($this->getParentObject(), "createSingleMemberTeam"));
             $ilCtrl->setParameter($this->parent_obj, "lmem", "");
             if ($file_info["files"]["count"]) {
                 $this->tpl->setVariable("TEAM_FILES_INFO", "<br />" . $file_info["files"]["txt"] . ": " . $file_info["files"]["count"]);
             }
             $this->tpl->parseCurrentBlock();
         }
     }
     if (!$has_no_team_yet) {
         $this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
         $this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
         $this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
         $this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
         if ($file_info["files"]["download_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
             $this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         if ($file_info["files"]["download_new_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
             $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         // note
         $this->tpl->setVariable("TXT_NOTE", $lng->txt("exc_note_for_tutor"));
         $this->tpl->setVariable("NAME_NOTE", "notice[{$member_id}]");
         $this->tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput(ilExAssignment::lookupNoticeOfUser($this->ass_id, $member_id)));
         // comment for learner
         $lcomment_value = ilExAssignment::lookupCommentForUser($this->ass_id, $member_id);
         $overlay_id = "excasscomm_" . $this->ass_id . "_" . $member_id;
         $overlay_trigger_id = $overlay_id . "_tr";
         $overlay = new ilOverlayGUI($overlay_id);
         $overlay->setAnchor($overlay_trigger_id);
         $overlay->setTrigger($overlay_trigger_id, "click", $overlay_trigger_id);
         $overlay->add();
         $this->tpl->setVariable("LCOMMENT_ID", $overlay_id . "_snip");
         $this->tpl->setVariable("LCOMMENT_SNIPPET", ilUtil::shortenText($lcomment_value, 25, true));
         $this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_ID", $overlay_trigger_id);
         $this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_TEXT", $lng->txt("exc_comment_for_learner_edit"));
         $lcomment_form = new ilPropertyFormGUI();
         $lcomment_form->setId($overlay_id);
         $lcomment_form->setPreventDoubleSubmission(false);
         $lcomment = new ilTextAreaInputGUI($lng->txt("exc_comment_for_learner"), "lcomment_" . $this->ass_id . "_" . $member_id);
         $lcomment->setInfo($lng->txt("exc_comment_for_learner_info"));
         $lcomment->setValue($lcomment_value);
         $lcomment->setCols(45);
         $lcomment->setRows(10);
         $lcomment_form->addItem($lcomment);
         $lcomment_form->addCommandButton("save", $lng->txt("save"));
         // $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
         $this->overlay_tpl->setCurrentBlock("overlay_bl");
         $this->overlay_tpl->setVariable("COMMENT_OVERLAY_ID", $overlay_id);
         $this->overlay_tpl->setVariable("COMMENT_OVERLAY_FORM", $lcomment_form->getHTML());
         $this->overlay_tpl->parseCurrentBlock();
         // solved
         //$this->tpl->setVariable("CHKBOX_SOLVED",
         //	ilUtil::formCheckbox($this->exc->members_obj->getStatusByMember($member_id),"solved[$member_id]",1));
         $status = ilExAssignment::lookupStatusOfUser($this->ass_id, $member_id);
         $this->tpl->setVariable("SEL_" . strtoupper($status), ' selected="selected" ');
         $this->tpl->setVariable("TXT_NOTGRADED", $lng->txt("exc_notgraded"));
         $this->tpl->setVariable("TXT_PASSED", $lng->txt("exc_passed"));
         $this->tpl->setVariable("TXT_FAILED", $lng->txt("exc_failed"));
         if (($sd = ilExAssignment::lookupStatusTimeOfUser($this->ass_id, $member_id)) > 0) {
             $this->tpl->setCurrentBlock("status_date");
             $this->tpl->setVariable("TXT_LAST_CHANGE", $lng->txt("last_change"));
             $this->tpl->setVariable('VAL_STATUS_DATE', ilDatePresentation::formatDate(new ilDateTime($sd, IL_CAL_DATETIME)));
             $this->tpl->parseCurrentBlock();
         }
         switch ($status) {
             case "passed":
                 $pic = "scorm/passed.svg";
                 break;
             case "failed":
                 $pic = "scorm/failed.svg";
                 break;
             default:
                 $pic = "scorm/not_attempted.svg";
                 break;
         }
         $this->tpl->setVariable("IMG_STATUS", ilUtil::getImagePath($pic));
         $this->tpl->setVariable("ALT_STATUS", $lng->txt("exc_" . $status));
         // mark
         $this->tpl->setVariable("TXT_MARK", $lng->txt("exc_mark"));
         $this->tpl->setVariable("NAME_MARK", "mark[{$member_id}]");
         $mark = ilExAssignment::lookupMarkOfUser($this->ass_id, $member_id);
         $this->tpl->setVariable("VAL_MARK", ilUtil::prepareFormOutput($mark));
         // feedback
         $ilCtrl->setParameter($this->parent_obj, "member_id", $member_id);
         if (($ft = ilExAssignment::lookupFeedbackTimeOfUser($this->ass_id, $member_id)) > 0) {
             $this->tpl->setCurrentBlock("feedback_date");
             $this->tpl->setVariable("TXT_FEEDBACK_MAIL_SENT", sprintf($lng->txt("exc_sent_at"), ilDatePresentation::formatDate(new ilDateTime($ft, IL_CAL_DATETIME))));
             $this->tpl->parseCurrentBlock();
         }
         // feedback mail
         $this->tpl->setVariable("LINK_FEEDBACK", $ilCtrl->getLinkTarget($this->parent_obj, "redirectFeedbackMail"));
         $this->tpl->setVariable("TXT_FEEDBACK", $lng->txt("exc_send_mail"));
         if ($this->type == ilExAssignment::TYPE_UPLOAD_TEAM) {
             $feedback_id = "t" . $member["team_id"];
         } else {
             $feedback_id = $member_id;
         }
         // file feedback
         $cnt_files = $this->storage->countFeedbackFiles($feedback_id);
         $ilCtrl->setParameter($this->parent_obj, "fsmode", "feedback");
         $this->tpl->setVariable("LINK_FILE_FEEDBACK", $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
         if ($cnt_files == 0) {
             $this->tpl->setVariable("TXT_FILE_FEEDBACK", $lng->txt("exc_add_feedback_file"));
         } else {
             $this->tpl->setVariable("TXT_FILE_FEEDBACK", $lng->txt("exc_fb_files") . " (" . $cnt_files . ")");
         }
         // peer review / rating
         if (!isset($member["team"]) && $this->peer_review) {
             $this->tpl->setCurrentBlock("peer_review_bl");
             $this->tpl->setVariable("TXT_PEER_REVIEW", $lng->txt("exc_peer_review_show"));
             $ilCtrl->setParameter($this->parent_obj, "grd", 1);
             $this->tpl->setVariable("LINK_PEER_REVIEW", $ilCtrl->getLinkTarget($this->parent_obj, "showPersonalPeerReview"));
             $ilCtrl->setParameter($this->parent_obj, "grd", "");
             $rating = new ilRatingGUI();
             $rating->setObject($this->ass_id, "ass", $member_id, "peer");
             $rating->setUserId(0);
             $this->tpl->setVariable("VAL_RATING", $rating->getHTML(true, false));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->touchBlock("member_has_no_team_bl");
     }
 }
コード例 #9
0
 /**
  * Get all item information (title, commands, description) in HTML
  *
  * @access	public
  * @param	int			$a_ref_id		item reference id
  * @param	int			$a_obj_id		item object id
  * @param	int			$a_title		item title
  * @param	int			$a_description	item description
  * @param	bool		$a_use_asynch
  * @param	bool		$a_get_asynch_commands
  * @param	string		$a_asynch_url
  * @param	bool		$a_context	    workspace/tree context
  * @return	string		html code
  */
 function getListItemHTML($a_ref_id, $a_obj_id, $a_title, $a_description, $a_use_asynch = false, $a_get_asynch_commands = false, $a_asynch_url = "", $a_context = self::CONTEXT_REPOSITORY)
 {
     global $ilAccess, $ilBench, $ilUser, $ilCtrl;
     // this variable stores wheter any admin commands
     // are included in the output
     $this->adm_commands_included = false;
     // only for permformance exploration
     $type = ilObject::_lookupType($a_obj_id);
     // initialization
     $ilBench->start("ilObjectListGUI", "1000_getListHTML_init{$type}");
     $this->initItem($a_ref_id, $a_obj_id, $a_title, $a_description, $a_context);
     $ilBench->stop("ilObjectListGUI", "1000_getListHTML_init{$type}");
     // prepare ajax calls
     include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
     if ($a_context == self::CONTEXT_REPOSITORY) {
         $node_type = ilCommonActionDispatcherGUI::TYPE_REPOSITORY;
     } else {
         $node_type = ilCommonActionDispatcherGUI::TYPE_WORKSPACE;
     }
     $this->setAjaxHash(ilCommonActionDispatcherGUI::buildAjaxHash($node_type, $a_ref_id, $type, $a_obj_id));
     if ($a_use_asynch && $a_get_asynch_commands) {
         return $this->insertCommands(true, true);
     }
     if ($this->rating_enabled) {
         if (ilRating::hasRatingInListGUI($this->obj_id, $this->type)) {
             $may_rate = $this->checkCommandAccess("read", "", $this->ref_id, $this->type);
             $rating = new ilRatingGUI();
             $rating->setObject($this->obj_id, $this->type);
             /*				$this->addCustomProperty(
             					$this->lng->txt("rating_average_rating"),
             					$rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id),
             					false,
             					true
             				);*/
             $this->addCustomProperty("", $rating->getListGUIProperty($this->ref_id, $may_rate, $this->ajax_hash, $this->parent_ref_id), false, true);
         }
     }
     // read from cache
     include_once "Services/Object/classes/class.ilListItemAccessCache.php";
     $this->acache = new ilListItemAccessCache();
     $cres = $this->acache->getEntry($ilUser->getId() . ":" . $a_ref_id);
     if ($this->acache->getLastAccessStatus() == "hit") {
         $this->access_cache = unserialize($cres);
     } else {
         // write to cache
         $this->storeAccessCache();
     }
     // visible check
     if (!$this->checkCommandAccess("visible", "", $a_ref_id, "", $a_obj_id)) {
         $ilBench->stop("ilObjectListGUI", "2000_getListHTML_check_visible");
         $this->resetCustomData();
         return "";
     }
     // BEGIN WEBDAV
     if ($type == 'file' and ilObjFileAccess::_isFileHidden($a_title)) {
         $this->resetCustomData();
         return "";
     }
     // END WEBDAV
     $this->tpl = new ilTemplate("tpl.container_list_item.html", true, true, "Services/Container", "DEFAULT", false, true);
     if ($this->getCommandsStatus() || $this->payment_enabled && IS_PAYMENT_ENABLED) {
         if (!$this->getSeparateCommands()) {
             $this->tpl->setVariable("COMMAND_SELECTION_LIST", $this->insertCommands($a_use_asynch, $a_get_asynch_commands, $a_asynch_url));
         }
     }
     if ($this->getProgressInfoStatus()) {
         $this->insertProgressInfo();
     }
     // insert title and describtion
     $this->insertTitle();
     if (!$this->isMode(IL_LIST_AS_TRIGGER)) {
         if ($this->getDescriptionStatus()) {
             $this->insertDescription();
         }
     }
     if ($this->getSearchFragmentStatus()) {
         $this->insertSearchFragment();
     }
     if ($this->enabledRelevance()) {
         $this->insertRelevance();
     }
     // properties
     $ilBench->start("ilObjectListGUI", "6000_insert_properties{$type}");
     if ($this->getPropertiesStatus()) {
         $this->insertProperties();
     }
     $ilBench->stop("ilObjectListGUI", "6000_insert_properties{$type}");
     // notice properties
     $ilBench->start("ilObjectListGUI", "6500_insert_notice_properties{$type}");
     if ($this->getNoticePropertiesStatus()) {
         $this->insertNoticeProperties();
     }
     $ilBench->stop("ilObjectListGUI", "6500_insert_notice_properties{$type}");
     // preconditions
     $ilBench->start("ilObjectListGUI", "7000_insert_preconditions");
     if ($this->getPreconditionsStatus()) {
         $this->insertPreconditions();
     }
     $ilBench->stop("ilObjectListGUI", "7000_insert_preconditions");
     // path
     $ilBench->start("ilObjectListGUI", "8000_insert_path");
     $this->insertPath();
     $ilBench->stop("ilObjectListGUI", "8000_insert_path");
     $ilBench->start("ilObjectListGUI", "8500_item_detail_links");
     if ($this->getItemDetailLinkStatus()) {
         $this->insertItemDetailLinks();
     }
     $ilBench->stop("ilObjectListGUI", "8500_item_detail_links");
     // icons and checkboxes
     $this->insertIconsAndCheckboxes();
     // input field for position
     $this->insertPositionField();
     // subitems
     $this->insertSubItems();
     // file upload
     if ($this->isFileUploadAllowed()) {
         $this->insertFileUpload();
     }
     $this->resetCustomData();
     $this->tpl->setVariable("DIV_CLASS", 'ilContainerListItemOuter');
     $this->tpl->setVariable("DIV_ID", 'id = "' . $this->getUniqueItemId(true) . '"');
     $this->tpl->setVariable("ADDITIONAL", $this->getAdditionalInformation());
     // #11554 - make sure that internal ids are reset
     $this->ctrl->setParameter($this->getContainerObject(), "item_ref_id", "");
     return $this->tpl->get();
 }
コード例 #10
0
 /**
  * Side column
  */
 static function renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp = null)
 {
     global $tpl, $lng;
     if ($a_wpg_id > 0 && !$a_wp) {
         include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
         $a_wp = ilWikiPage($a_wpg_id);
     }
     // search block
     include_once "./Modules/Wiki/classes/class.ilWikiSearchBlockGUI.php";
     $wiki_search_block = new ilWikiSearchBlockGUI();
     $rcontent = $wiki_search_block->getHTML();
     // quick navigation
     if ($a_wpg_id > 0) {
         //			include_once("./Modules/Wiki/classes/class.ilWikiSideBlockGUI.php");
         //			$wiki_side_block = new ilWikiSideBlockGUI();
         //			$wiki_side_block->setPageObject($a_wp);
         //			$rcontent.= $wiki_side_block->getHTML();
         // rating
         $wiki_id = ilObject::_lookupObjId($a_wiki_ref_id);
         if (ilObjWiki::_lookupRating($wiki_id) && $a_wp->getRating()) {
             include_once "./Services/Rating/classes/class.ilRatingGUI.php";
             $rgui = new ilRatingGUI();
             $rgui->setObject($wiki_id, "wiki", $a_wpg_id, "wpg");
             $rgui->enableCategories(ilObjWiki::_lookupRatingCategories($wiki_id));
             $rgui->setYourRatingText("#");
             $rcontent .= $rgui->getBlockHTML($lng->txt("wiki_rate_page"));
         }
         // advanced metadata
         include_once "./Modules/Wiki/classes/class.ilWikiAdvMetaDataBlockGUI.php";
         if (ilWikiAdvMetaDataBlockGUI::isActive($wiki_id)) {
             $rec_ids = ilWikiAdvMetaDataBlockGUI::getRecords($wiki_id);
             foreach ($rec_ids as $record) {
                 $advmd_pages_block = new ilWikiAdvMetaDataBlockGUI($record);
                 $advmd_pages_block->setObject($a_wiki_ref_id, $wiki_id, $a_wpg_id);
                 $rcontent .= $advmd_pages_block->getHTML();
             }
         }
     }
     // important pages
     //		if (ilObjWiki::_lookupImportantPages(ilObject::_lookupObjId($a_wiki_ref_id)))
     //		{
     include_once "./Modules/Wiki/classes/class.ilWikiImportantPagesBlockGUI.php";
     $imp_pages_block = new ilWikiImportantPagesBlockGUI();
     $rcontent .= $imp_pages_block->getHTML();
     //		}
     // wiki functions block
     if ($a_wpg_id > 0) {
         include_once "./Modules/Wiki/classes/class.ilWikiFunctionsBlockGUI.php";
         $wiki_functions_block = new ilWikiFunctionsBlockGUI();
         $wiki_functions_block->setPageObject($a_wp);
         $rcontent .= $wiki_functions_block->getHTML();
     }
     $tpl->setRightContent($rcontent);
 }
コード例 #11
0
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilUser, $ilAccess;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilnotegui":
             $this->getTabs();
             $ilTabs->setTabActive("pg");
             return $this->preview();
             break;
         case "ilratinggui":
             // for rating side block
             include_once "./Services/Rating/classes/class.ilRatingGUI.php";
             $rating_gui = new ilRatingGUI();
             $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki", $this->getPageObject()->getId(), "wpg");
             $rating_gui->setUpdateCallback(array($this, "updateStatsRating"));
             $this->ctrl->forwardCommand($rating_gui);
             $ilCtrl->redirect($this, "preview");
             break;
         case "ilpageobjectgui":
             die("Deprecated. Wikipage gui forwarding to ilpageobject");
             return;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $gui->enableCommentsSettings(false);
             $gui->setRatingCallback($this, "preview");
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilwikistatgui":
             if ($ilAccess->checkAccess("statistics_read", "", $this->wiki_ref_id)) {
                 $this->tabs_gui->clearTargets();
                 // see ilObjWikiGUI::getTabs()
                 $this->getTabs("statistics");
                 include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php";
                 $gui = new ilWikiStatGUI($this->getPageObject()->getParentId(), $this->getPageObject()->getId());
                 $this->ctrl->forwardCommand($gui);
             }
             break;
         default:
             if (strtolower($ilCtrl->getNextClass()) == "ilpageeditorgui") {
                 self::initEditingJS($this->tpl);
             }
             if ($_GET["ntf"]) {
                 include_once "./Services/Notification/classes/class.ilNotification.php";
                 switch ($_GET["ntf"]) {
                     case 1:
                         ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
                         break;
                     case 2:
                         // remove all page notifications here?
                         ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
                         break;
                     case 3:
                         ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false);
                         break;
                     case 4:
                         ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true);
                         break;
                 }
                 $ilCtrl->redirect($this, "preview");
             }
             $this->setPresentationTitle($this->getWikiPage()->getTitle());
             return parent::executeCommand();
     }
 }
コード例 #12
0
 protected function fillRow($a_set)
 {
     global $ilCtrl;
     $this->tpl->setVariable("VAL_SEQ", $a_set["seq"]);
     if ($a_set["tstamp"]) {
         $a_set["tstamp"] = ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_DATETIME));
     }
     $this->tpl->setVariable("VAL_TSTAMP", $a_set["tstamp"]);
     // rating
     $ilCtrl->setParameter($this->parent_obj, "peer_id", $a_set["peer_id"]);
     $rating = new ilRatingGUI();
     $rating->setObject($this->ass->getId(), "ass", $a_set["peer_id"], "peer");
     $rating->setUserId($a_set["giver_id"]);
     $this->tpl->setVariable("ID_RATING", "rtr_" . $a_set["peer_id"]);
     if (!$this->read_only) {
         $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, true, "il.ExcPeerReview.saveComments(" . $a_set["peer_id"] . ", %rating%)"));
     } else {
         $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, false));
     }
     $ilCtrl->setParameter($this->parent_obj, "peer_id", "");
     // submission
     if (!$this->read_only) {
         $ilCtrl->setParameter($this->parent_obj, "seq", $a_set["seq"]);
         $file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->ass->getExerciseId(), $this->ass->getType(), $this->ass->getId(), $a_set["peer_id"]);
         $ilCtrl->setParameter($this->parent_obj, "seq", "");
         $this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
         $this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
         $this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
         $this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
         if ($file_info["files"]["download_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
             $this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         if ($file_info["files"]["download_new_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
             $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("pcomment_edit_bl");
         $idx = $a_set["giver_id"] . "__" . $a_set["peer_id"];
         $this->tpl->setVariable("VAL_ID", $idx);
         $this->tpl->setVariable("VAL_PCOMMENT_EDIT", $a_set["comment"]);
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock("pcomment_static_bl");
         $this->tpl->setVariable("VAL_PCOMMENT_STATIC", $a_set["comment"]);
         $this->tpl->parseCurrentBlock();
     }
 }
コード例 #13
0
 /**
  * @param ilForumTopic $thread
  */
 public function fillRow(ilForumTopic $thread)
 {
     /**
      * @var $ilUser ilObjUser
      */
     global $ilUser;
     $this->ctrl->setParameter($this->getParentObject(), 'thr_pk', $thread->getId());
     if ('mergeThreads' == $this->parent_cmd) {
         $checked = $this->max_count == 1 || isset($_POST['thread_ids']) && in_array($thread->getId(), $_POST['thread_ids']);
         $this->tpl->setVariable('VAL_CHECK', ilUtil::formRadioButton($checked, 'thread_ids[]', $thread->getId()));
     } else {
         if ('showThreads' == $this->parent_cmd) {
             $this->tpl->setVariable('VAL_CHECK', ilUtil::formCheckbox(isset($_POST['thread_ids']) && in_array($thread->getId(), $_POST['thread_ids']) ? true : false, 'thread_ids[]', $thread->getId()));
             if ($this->parent_obj->objProperties->isIsThreadRatingEnabled()) {
                 $rating = new ilRatingGUI();
                 $rating->setObject($this->parent_obj->object->getId(), $this->parent_obj->object->getType(), $thread->getId(), 'thread');
                 $rating->setUserId($ilUser->getId());
                 $this->tpl->setVariable('VAL_RATING', $rating->getHTML());
             }
         } else {
             if ($thread->isSticky()) {
                 $this->tpl->setVariable('VAL_SORTING_NAME', 'thread_sorting[' . $thread->getId() . ']');
                 $this->tpl->setVariable('VAL_SORTING', (int) $this->position * 10);
             } else {
                 $this->tpl->setVariable('VAL_CHECK', '');
             }
             $this->position++;
         }
     }
     $subject = '';
     if ($thread->isSticky()) {
         $subject .= '<span class="light">[' . $this->lng->txt('sticky') . ']</span> ';
     }
     if ($thread->isClosed()) {
         $subject .= '<span class="light">[' . $this->lng->txt('topic_close') . ']</span> ';
     }
     if (!$ilUser->isAnonymous() && $this->ilias->getSetting('forum_notification') != 0 && $thread->getUserNotificationEnabled()) {
         $subject .= '<span class="light">[' . $this->lng->txt('forums_notification_enabled') . ']</span> ';
     }
     $num_posts = $thread->getNumPosts();
     $num_unread = $thread->getNumUnreadPosts();
     $num_new = $thread->getNumNewPosts();
     if ($num_posts > 0) {
         $subject = '<div><a href="' . $this->ctrl->getLinkTarget($this->getParentObject(), 'viewThread') . '">' . $thread->getSubject() . '</a></div>' . $subject;
     } else {
         $subject = $thread->getSubject() . $subject;
     }
     $this->tpl->setVariable('VAL_SUBJECT', $subject);
     // Author
     $this->ctrl->setParameter($this->getParentObject(), 'backurl', urlencode($this->ctrl->getLinkTargetByClass("ilrepositorygui", "")));
     $this->ctrl->setParameter($this->getParentObject(), 'user', $thread->getDisplayUserId());
     $authorinfo = new ilForumAuthorInformation($thread->getThrAuthorId(), $thread->getDisplayUserId(), $thread->getUserAlias(), $thread->getImportName(), array('class' => 'il_ItemProperty', 'href' => $this->ctrl->getLinkTarget($this->getParentObject(), 'showUser')));
     $this->tpl->setVariable('VAL_AUTHOR', $authorinfo->getLinkedAuthorName());
     $topicStats = $num_posts;
     if (!$ilUser->isAnonymous()) {
         if ($num_unread > 0) {
             $topicStats .= '<br /><span class="ilAlert ilWhiteSpaceNowrap">' . $this->lng->txt('unread') . ': ' . $num_unread . '</span>';
         }
         if ($num_new > 0 && $this->getOverviewSetting() == 0) {
             $topicStats .= '<br /><span class="ilAlert ilWhiteSpaceNowrap">' . $this->lng->txt('new') . ': ' . $num_new . '</span>';
         }
     }
     $this->tpl->setVariable('VAL_ARTICLE_STATS', $topicStats);
     $this->tpl->setVariable('VAL_NUM_VISIT', $thread->getVisits());
     // Last posting
     if ($num_posts > 0) {
         if ($this->getIsModerator()) {
             $objLastPost = $thread->getLastPost();
         } else {
             $objLastPost = $thread->getLastActivePost();
         }
         if (is_object($objLastPost)) {
             $authorinfo = new ilForumAuthorInformation($objLastPost->getPosAuthorId(), $objLastPost->getDisplayUserId(), $objLastPost->getUserAlias(), $objLastPost->getImportName(), array('href' => $this->ctrl->getLinkTarget($this->getParentObject(), 'viewThread') . '#' . $objLastPost->getId()));
             $this->tpl->setVariable('VAL_LP_DATE', '<div class="ilWhiteSpaceNowrap">' . ilDatePresentation::formatDate(new ilDateTime($objLastPost->getCreateDate(), IL_CAL_DATETIME)) . '</div>' . '<div class="ilWhiteSpaceNowrap">' . $this->lng->txt('from') . ' ' . $authorinfo->getLinkedAuthorName() . '</div>');
         }
     }
     // Row style
     $css_row = $this->css_row;
     if ($thread->isSticky()) {
         $css_row = $css_row == 'tblrow1' ? 'tblstickyrow1' : 'tblstickyrow2';
     }
     $this->tpl->setVariable('CSS_ROW', $css_row);
     $this->ctrl->setParameter($this->getParentObject(), 'thr_pk', '');
     $this->ctrl->setParameter($this->getParentObject(), 'user', '');
     $this->ctrl->setParameter($this->getParentObject(), 'backurl', '');
 }
コード例 #14
0
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilNavigationHistory, $ilUser, $tpl;
     // Navigation History
     $link = $ilCtrl->getLinkTarget($this, "render");
     if ($this->object != NULL) {
         $ilNavigationHistory->addItem($this->object->getRefId(), $link, "dcl");
     }
     //Direct-Link Resource
     if ($_GET["dcl_gtr"]) {
         $ilCtrl->setCmdClass("ildatacollectionrecordviewgui");
         $_GET['record_id'] = $_GET["dcl_gtr"];
         $ilCtrl->setCmd("renderRecord");
     }
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd();
     if (!$this->getCreationMode() && $next_class != "ilinfoscreengui" && !$this->checkPermissionBool("read")) {
         $tpl->getStandardTemplate();
         $tpl->setContent("Permission Denied.");
         return;
     }
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_info");
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("dcl");
             $tpl->getStandardTemplate();
             $this->ctrl->forwardCommand($cp);
             break;
         case "ildatacollectionfieldlistgui":
             $this->prepareOutput();
             $this->addListFieldsTabs("list_fields");
             $ilTabs->setTabActive("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionFieldListGUI.php";
             $fieldlist_gui = new ilDataCollectionFieldListGUI($this, $this->table_id);
             $this->ctrl->forwardCommand($fieldlist_gui);
             break;
         case "ildatacollectiontableeditgui":
             $this->prepareOutput();
             $ilTabs->setTabActive("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionTableEditGUI.php";
             $tableedit_gui = new ilDataCollectionTableEditGUI($this);
             $this->ctrl->forwardCommand($tableedit_gui);
             break;
         case "ildatacollectionfieldeditgui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionFieldEditGUI.php";
             $fieldedit_gui = new ilDataCollectionFieldEditGUI($this, $this->table_id, $_REQUEST["field_id"]);
             $this->ctrl->forwardCommand($fieldedit_gui);
             break;
         case "ildatacollectionrecordlistgui":
             $this->addHeaderAction(false);
             $this->prepareOutput();
             $ilTabs->activateTab("id_records");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordListGUI.php";
             $recordlist_gui = new ilDataCollectionRecordListGUI($this, $this->table_id);
             $this->ctrl->forwardCommand($recordlist_gui);
             break;
         case "ildatacollectionrecordeditgui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_records");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordEditGUI.php";
             $recordedit_gui = new ilDataCollectionRecordEditGUI($this);
             $this->ctrl->forwardCommand($recordedit_gui);
             break;
         case "ildatacollectionrecordviewviewdefinitiongui":
             $this->prepareOutput();
             // page editor will set its own tabs
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($this->lng->txt("back"), $ilCtrl->getLinkTargetByClass("ildatacollectionfieldlistgui", "listFields"));
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php";
             $recordedit_gui = new ilDataCollectionRecordViewViewdefinitionGUI($this->table_id);
             // needed for editor
             $recordedit_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "dcl"));
             if (!$this->checkPermissionBool("write")) {
                 $recordedit_gui->setEnableEditing(false);
             }
             $ret = $this->ctrl->forwardCommand($recordedit_gui);
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             $ilTabs->removeTab('history');
             $ilTabs->removeTab('clipboard');
             // Fixme
             $ilTabs->removeTab('pg');
             break;
         case "ildatacollectionrecordlistviewdefinitiongui":
             $this->prepareOutput();
             $this->addListFieldsTabs("list_viewdefinition");
             $ilTabs->setTabActive("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordListViewdefinitionGUI.php";
             $recordlist_gui = new ilDataCollectionRecordListViewdefinitionGUI($this, $this->table_id);
             $this->ctrl->forwardCommand($recordlist_gui);
             break;
         case "ilobjfilegui":
             $this->prepareOutput();
             $ilTabs->setTabActive("id_records");
             include_once "./Modules/File/classes/class.ilObjFile.php";
             $file_gui = new ilObjFile($this);
             $this->ctrl->forwardCommand($file_gui);
             break;
         case "ildatacollectionrecordviewgui":
             $this->prepareOutput();
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewGUI.php";
             $recordview_gui = new ilDataCollectionRecordViewGUI($this);
             $this->ctrl->forwardCommand($recordview_gui);
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($this->lng->txt("back"), $ilCtrl->getLinkTargetByClass("ilObjDataCollectionGUI", ""));
             break;
         case "ilratinggui":
             $rgui = new ilRatingGUI();
             $rgui->setObject($_GET['record_id'], "dcl_record", $_GET["field_id"], "dcl_field");
             $rgui->executeCommand();
             $ilCtrl->redirectByClass("ilDataCollectionRecordListGUI", "listRecords");
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }
コード例 #15
0
 public function executeCommand()
 {
     /**
      * @var $ilNavigationHistory ilNavigationHistory
      * @var $ilAccess ilAccessHandler
      * @var $ilCtrl ilCtrl
      * @var $ilTabs ilTabsGUI
      * @var $ilErr  ilErrorHandling
      * @var $ilUser ilObjUser
      */
     global $ilNavigationHistory, $ilAccess, $ilCtrl, $ilTabs, $ilErr, $ilUser;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $exclude_cmds = array('viewThread', 'markPostUnread', 'markPostRead', 'showThreadNotification', 'cancelPostActivation', 'cancelPostDeactivation', 'performPostActivation', 'performPostDeactivation', 'performPostAndChildPostsActivation', 'askForPostActivation', 'askForPostDeactivation', 'toggleThreadNotification', 'toggleThreadNotificationTab', 'toggleStickiness', 'cancelPost', 'savePost', 'quotePost', 'getQuotationHTMLAsynch', 'setTreeStateAsynch', 'fetchTreeChildrenAsync');
     if (!in_array($cmd, $exclude_cmds)) {
         $this->prepareOutput();
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && !$ilCtrl->isAsynch() && $ilAccess->checkAccess('read', '', $_GET['ref_id'])) {
         $ilNavigationHistory->addItem($_GET['ref_id'], 'ilias.php?baseClass=ilRepositoryGUI&amp;cmd=showThreads&amp;ref_id=' . $_GET['ref_id'], 'frm');
     }
     switch ($next_class) {
         case 'ilpermissiongui':
             require_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilforumexportgui':
             require_once 'Modules/Forum/classes/class.ilForumExportGUI.php';
             $fex_gui = new ilForumExportGUI($this);
             $this->ctrl->forwardCommand($fex_gui);
             exit;
             break;
         case 'ilforummoderatorsgui':
             require_once 'Modules/Forum/classes/class.ilForumModeratorsGUI.php';
             $fm_gui = new ilForumModeratorsGUI($this);
             $this->ctrl->forwardCommand($fm_gui);
             break;
         case 'ilinfoscreengui':
             $this->infoScreen();
             break;
         case 'ilcolumngui':
             $this->showThreadsObject();
             break;
         case 'ilpublicuserprofilegui':
             include_once 'Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI((int) $_GET['user']);
             $add = $this->getUserProfileAdditional((int) $_GET['ref_id'], (int) $_GET['user']);
             $profile_gui->setAdditional($add);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             $this->tpl->setContent($ret);
             break;
         case 'ilobjectcopygui':
             include_once 'Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('frm');
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilexportgui':
             $ilTabs->setTabActive('export');
             include_once 'Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case "ilratinggui":
             if (!$this->objProperties->isIsThreadRatingEnabled() || $ilUser->isAnonymous()) {
                 $ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $ilErr->MESSAGE);
             }
             require_once 'Services/Rating/classes/class.ilRatingGUI.php';
             $rating_gui = new ilRatingGUI();
             $rating_gui->setObject($this->object->getId(), $this->object->getType(), $this->objCurrentTopic->getId(), 'thread');
             $ilCtrl->setParameter($this, 'thr_pk', (int) $_GET['thr_pk']);
             $this->ctrl->forwardCommand($rating_gui);
             $avg = ilRating::getOverallRatingForObject($this->object->getId(), $this->object->getType(), (int) $_GET['thr_pk'], 'thread');
             $this->objCurrentTopic->setAverageRating($avg['avg']);
             $this->objCurrentTopic->update();
             $ilCtrl->redirect($this, "showThreads");
             break;
         case 'ilcommonactiondispatchergui':
             include_once 'Services/Object/classes/class.ilCommonActionDispatcherGUI.php';
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             // alex, 11 Jan 2011:
             // I inserted this workaround due to bug report 6971.
             // In general the command handling is quite obscure here.
             // The form action of the table should be filled
             // with $ilCtrl->getFormAction(..) not with $ilCtrl->getLinkTarget(..)
             // Commands should be determined with $ilCtrl->getCmd() not
             // with accessing $_POST['selected_cmd'], since this is internal
             // of ilTable2GUI/ilCtrl and may change.
             if (isset($_POST['select_cmd2'])) {
                 $_POST['selected_cmd'] = $_POST["selected_cmd2"];
             }
             if (isset($_POST['selected_cmd']) && $_POST['selected_cmd'] != null) {
                 $member_cmd = array('enableAdminForceNoti', 'disableAdminForceNoti', 'enableHideUserToggleNoti', 'disableHideUserToggleNoti');
                 in_array($_POST['selected_cmd'], $member_cmd) ? $cmd = $_POST['selected_cmd'] : ($cmd = 'performThreadsAction');
             } else {
                 if (!$cmd && !$_POST['selected_cmd']) {
                     $cmd = 'showThreads';
                 }
             }
             $cmd .= 'Object';
             $this->{$cmd}();
             break;
     }
     // suppress for topic level
     if ($cmd != 'viewThreadObject' && $cmd != 'showUserObject') {
         $this->addHeaderAction();
     }
 }
コード例 #16
0
 function updatePeerReviewCommentsObject()
 {
     global $ilCtrl, $ilUser, $tpl;
     if (!$this->ass || !$this->ass->getPeerReview() || !$this->ass->getDeadline() || $this->ass->getDeadline() - time() > 0 || !sizeof($_POST["pc"]) || !$ilCtrl->isAsynch()) {
         exit;
     }
     $rating_peer_id = $_POST["rating_peer_id"];
     $giver_id = $ilUser->getId();
     // save rating
     include_once './Services/Rating/classes/class.ilRating.php';
     ilRating::writeRatingForUserAndObject($this->ass->getId(), "ass", $rating_peer_id, "peer", $giver_id, $_POST["rating"]);
     // save comments
     foreach ($_POST["pc"] as $peer_id => $value) {
         if ($peer_id) {
             $this->ass->updatePeerReviewComment($peer_id, $value);
         }
     }
     // render current rating
     $ilCtrl->setParameter($this->parent_obj, "peer_id", $rating_peer_id);
     include_once './Services/Rating/classes/class.ilRatingGUI.php';
     $rating = new ilRatingGUI();
     $rating->setObject($this->ass->getId(), "ass", $rating_peer_id, "peer");
     $rating->setUserId($giver_id);
     if (!$_REQUEST["ssrtg"]) {
         echo $rating->getHTML(false, true, "il.ExcPeerReview.saveComments(" . $rating_peer_id . ", %rating%)");
     } else {
         echo '<div id="rtr_widget">' . $rating->getHTML(false, true, "il.ExcPeerReview.saveSingleRating(" . $rating_peer_id . ", %rating%)") . '</div>';
     }
     echo $tpl->getOnLoadCodeForAsynch();
     exit;
 }
コード例 #17
0
 protected function fillRow($a_set)
 {
     global $ilCtrl;
     if (isset($a_set["seq"])) {
         $this->tpl->setVariable("VAL_SEQ", $a_set["seq"]);
     } else {
         $this->tpl->setVariable("VAL_SEQ", $a_set["name"]);
     }
     if ($a_set["tstamp"]) {
         $a_set["tstamp"] = ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_DATETIME));
     }
     $this->tpl->setVariable("VAL_TSTAMP", $a_set["tstamp"]);
     // rating
     $ilCtrl->setParameter($this->parent_obj, "peer_id", $a_set["peer_id"]);
     $rating = new ilRatingGUI();
     $rating->setObject($this->ass->getId(), "ass", $a_set["peer_id"], "peer");
     $rating->setUserId($a_set["giver_id"]);
     $this->tpl->setVariable("ID_RATING", "rtr_" . $a_set["peer_id"]);
     if (!$this->read_only) {
         $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, true, "il.ExcPeerReview.saveComments(" . $a_set["peer_id"] . ", %rating%)"));
     } else {
         $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, false));
     }
     $ilCtrl->setParameter($this->parent_obj, "peer_id", "");
     // submission
     $uploads = null;
     if ($this->ass->hasPeerReviewFileUpload()) {
         $path = $this->fstorage->getPeerReviewUploadPath($a_set["peer_id"], $a_set["giver_id"]);
         $uploads = glob($path . "/*.*");
     }
     if (!$this->read_only) {
         $ilCtrl->setParameter($this->parent_obj, "seq", $a_set["seq"]);
         $file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->ass->getExerciseId(), $this->ass->getType(), $this->ass->getId(), $a_set["peer_id"]);
         $ilCtrl->setParameter($this->parent_obj, "seq", "");
         $this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
         $this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
         $this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
         $this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
         if ($file_info["files"]["download_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
             $this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         if ($file_info["files"]["download_new_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
             $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         $idx = $a_set["giver_id"] . "__" . $a_set["peer_id"];
         // file edit link
         if ($this->ass->hasPeerReviewFileUpload()) {
             $ilCtrl->setParameter($this->parent_obj, "fu", $idx);
             $ilCtrl->setParameter($this->parent_obj, "fsmode", "peer");
             $url = $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles");
             $ilCtrl->setParameter($this->parent_obj, "fsmode", "");
             $ilCtrl->setParameter($this->parent_obj, "fu", "");
             $this->tpl->setCurrentBlock("file_edit_bl");
             $this->tpl->setVariable("FILE_EDIT_URL", $url);
             $this->tpl->setVariable("FILE_EDIT_CAPTION", $uploads ? $this->lng->txt("exc_peer_edit_file") : $this->lng->txt("exc_peer_upload_file"));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("pcomment_edit_bl");
         $this->tpl->setVariable("VAL_ID", $idx);
         $this->tpl->setVariable("VAL_PCOMMENT_EDIT", $a_set["comment"]);
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock("pcomment_static_bl");
         $this->tpl->setVariable("VAL_PCOMMENT_STATIC", $a_set["comment"]);
         $this->tpl->parseCurrentBlock();
     }
     // list existing files
     if ($uploads) {
         $idx = $a_set["giver_id"] . "__" . $a_set["peer_id"];
         $ilCtrl->setParameter($this->parent_obj, "fu", $idx);
         foreach ($uploads as $upload) {
             $ilCtrl->setParameter($this->parent_obj, "fuf", md5($upload));
             $url = $ilCtrl->getLinkTarget($this->parent_obj, "downloadPeerReview");
             $ilCtrl->setParameter($this->parent_obj, "fuf", "");
             $this->tpl->setCurrentBlock("file_static_bl");
             $this->tpl->setVariable("FILE_NAME", basename($upload));
             $this->tpl->setVariable("FILE_URL", $url);
             $this->tpl->parseCurrentBlock();
         }
         $ilCtrl->setParameter($this->parent_obj, "fu", "");
     }
 }