本文整理汇总了PHP中ilInfoScreenGUI::addProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP ilInfoScreenGUI::addProperty方法的具体用法?PHP ilInfoScreenGUI::addProperty怎么用?PHP ilInfoScreenGUI::addProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilInfoScreenGUI
的用法示例。
在下文中一共展示了ilInfoScreenGUI::addProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Show subscription info
*/
protected function show()
{
$token = $this->createToken();
ilUtil::sendInfo($GLOBALS['lng']->txt('cal_subscription_info'));
include_once './Services/InfoScreen/classes/class.ilInfoScreenGUI.php';
$info = new ilInfoScreenGUI($this);
$info->setFormAction($GLOBALS['ilCtrl']->getFormAction($this));
$hash = $this->createToken();
$url = ILIAS_HTTP_PATH . '/calendar.php?client_id=' . CLIENT_ID . '&token=' . $hash;
$info->addSection($this->getCalendar()->getTitle());
$info->addProperty('Abonnieren', $url, $url);
$GLOBALS['tpl']->setContent($info->getHTML());
}
示例2: infoScreen
/**
* show info screen
*
* @access public
*/
public function infoScreen()
{
global $ilCtrl;
$this->tabs_gui->activateTab('infoScreen');
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
$info->addSection($this->txt('xxco_instructions'));
$info->addProperty("", $this->object->getInstructions());
// meta data
$xml_obj = $this->object->fetchMetaData(self::META_TIMEOUT_INFO);
if ($xml_obj) {
foreach ($xml_obj->group as $group) {
if (in_array($group['name'], $this->meta_groups)) {
$info->addSection(utf8_decode($group->title));
foreach ($group->fields->field as $field) {
$info->addProperty(utf8_decode($field->title), $field->content);
}
}
}
}
$info->enablePrivateNotes();
// add view button
if ($this->object->typedef->getAvailability() == ilExternalContentType::AVAILABILITY_NONE) {
ilUtil::sendFailure($this->lng->txt('xxco_message_type_not_available'), false);
} elseif ($this->object->getOnline()) {
if ($this->object->typedef->getLaunchType() == ilExternalContentType::LAUNCH_TYPE_LINK) {
$info->addButton($this->lng->txt("view"), $ilCtrl->getLinkTarget($this, "view"));
} elseif ($this->object->typedef->getLaunchType() == ilExternalContentType::LAUNCH_TYPE_PAGE) {
$info->addButton($this->lng->txt("view"), $ilCtrl->getLinkTarget($this, "viewPage"));
}
}
$ilCtrl->forwardCommand($info);
}
示例3: details
/**
* show calendar details
*
* @access protected
* @return
*/
protected function details()
{
global $tpl;
if (!$_GET['category_id']) {
ilUtil::sendFailure($this->lng->txt('select_one'), true);
$this->ctrl->returnToParent($this);
}
$this->readPermissions();
$this->checkVisible();
$category = new ilCalendarCategory((int) $_GET['category_id']);
if (!in_array($category->getType(), array(ilCalendarCategory::TYPE_CH, ilCalendarCategory::TYPE_BOOK))) {
include_once "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php";
$toolbar = new ilToolbarGui();
$toolbar->addButton($this->lng->txt("cal_add_appointment"), $this->ctrl->getLinkTargetByClass("ilcalendarappointmentgui", "add"));
if (!in_array($category->getType(), array(ilCalendarCategory::TYPE_CH, ilCalendarCategory::TYPE_BOOK))) {
$toolbar->addButton($this->lng->txt("cal_import_appointments"), $this->ctrl->getLinkTarget($this, "importAppointments"));
}
$toolbar = $toolbar->getHTML();
}
// Non editable category
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
$info->setFormAction($this->ctrl->getFormAction($this));
$info->addSection($this->lng->txt('cal_cal_details'));
// Calendar Name
$info->addProperty($this->lng->txt('cal_calendar_name'), $category->getTitle());
switch ($category->getType()) {
case ilCalendarCategory::TYPE_USR:
$info->addProperty($this->lng->txt('cal_cal_type'), $this->lng->txt('cal_type_personal'));
break;
case ilCalendarCategory::TYPE_GLOBAL:
$info->addProperty($this->lng->txt('cal_cal_type'), $this->lng->txt('cal_type_system'));
break;
case ilCalendarCategory::TYPE_OBJ:
$info->addProperty($this->lng->txt('cal_cal_type'), $this->lng->txt('cal_type_' . $category->getObjType()));
$info->addSection($this->lng->txt('additional_info'));
$info->addProperty($this->lng->txt('perma_link'), $this->addReferenceLinks($category->getObjId()));
break;
case ilCalendarCategory::TYPE_CH:
case ilCalendarCategory::TYPE_BOOK:
// nothing to do
break;
}
// Ical link
$this->ctrl->setParameterByClass('ilcalendarsubscriptiongui', 'cal_id', (int) $_GET['category_id']);
$info->addProperty($this->lng->txt('cal_ical_infoscreen'), '<img src="' . ilUtil::getImagePath('ical.png', 'Services/Calendar') . '" />', $this->ctrl->getLinkTargetByClass(array('ilcalendarpresentationgui', 'ilcalendarsubscriptiongui')));
$tpl->setContent($toolbar . $info->getHTML() . $this->showAssignedAppointments());
}
示例4: infoScreen
/**
* show information screen
*/
function infoScreen()
{
global $ilAccess, $ilTabs, $ilUser, $ilToolbar;
if (!$this->external_rater_360 && !$ilAccess->checkAccess("visible", "", $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
}
$ilTabs->activateTab("info_short");
include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
$output_gui =& new ilSurveyExecutionGUI($this->object);
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
// "active" survey?
$canStart = $this->object->canStartSurvey(null, $this->external_rater_360);
$showButtons = $canStart["result"];
if (!$showButtons) {
if ($canStart["edit_settings"] && $ilAccess->checkAccess("write", "", $this->ref_id)) {
$canStart["messages"][] = "<a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">» " . $this->lng->txt("survey_edit_settings") . "</a>";
}
ilUtil::sendInfo(implode("<br />", $canStart["messages"]));
}
$big_button = false;
if ($showButtons) {
// closing survey?
$is_appraisee = false;
if ($this->object->get360Mode() && $this->object->isAppraisee($ilUser->getId())) {
$info->addSection($this->lng->txt("survey_360_appraisee_info"));
$appr_data = $this->object->getAppraiseesData();
$appr_data = $appr_data[$ilUser->getId()];
$info->addProperty($this->lng->txt("survey_360_raters_status_info"), $appr_data["finished"]);
if (!$appr_data["closed"]) {
include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
$button = ilLinkButton::getInstance();
$button->setCaption("survey_360_appraisee_close_action");
$button->setUrl($this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "confirmappraiseeclose"));
$close_button_360 = '<div>' . $button->render() . '</div>';
$txt = "survey_360_appraisee_close_action_info";
if ($this->object->get360SkillService()) {
$txt .= "_skill";
}
$info->addProperty($this->lng->txt("status"), $close_button_360 . $this->lng->txt($txt));
} else {
ilDatePresentation::setUseRelativeDates(false);
$dt = new ilDateTime($appr_data["closed"], IL_CAL_UNIX);
$info->addProperty($this->lng->txt("status"), sprintf($this->lng->txt("survey_360_appraisee_close_action_status"), ilDatePresentation::formatDate($dt)));
}
$is_appraisee = true;
}
// handle code
// validate incoming
$code_input = false;
$anonymous_code = $_POST["anonymous_id"];
if ($anonymous_code) {
$code_input = true;
// if(!$this->object->isUnusedCode($anonymous_code, $ilUser->getId()))
if (!$this->object->checkSurveyCode($anonymous_code)) {
$anonymous_code = null;
} else {
// #15860
$this->object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code);
}
}
if ($anonymous_code) {
$_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code;
} else {
$anonymous_code = $_SESSION["anonymous_id"][$this->object->getId()];
if ($anonymous_code) {
$code_input = true;
}
}
// try to find code for current (registered) user from existing run
if ($this->object->getAnonymize() && !$anonymous_code) {
$anonymous_code = $this->object->findCodeForUser($ilUser->getId());
}
// get existing runs for current user, might generate code
$participant_status = $this->object->getUserSurveyExecutionStatus($anonymous_code);
if ($participant_status) {
$anonymous_code = $participant_status["code"];
$participant_status = $participant_status["runs"];
}
// (final) check for proper anonymous code
if (!$this->object->isAccessibleWithoutCode() && !$is_appraisee && $code_input && (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code))) {
$anonymous_code = null;
ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used"));
}
// :TODO: really save in session?
$_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code;
// code is mandatory and not given yet
if (!$is_appraisee && !$anonymous_code && !$this->object->isAccessibleWithoutCode()) {
$info->setFormAction($this->ctrl->getFormAction($this, "infoScreen"));
$info->addSection($this->lng->txt("anonymization"));
$info->addProperty("", $this->lng->txt("anonymize_anonymous_introduction"));
$info->addPropertyTextinput($this->lng->txt("enter_anonymous_id"), "anonymous_id", "", 8, "infoScreen", $this->lng->txt("submit"), true);
} else {
// trunk/default
if (!$this->object->get360Mode()) {
if ($anonymous_code) {
//.........这里部分代码省略.........
示例5: infoScreen
/**
* show information screen
*/
function infoScreen()
{
global $ilAccess, $ilUser, $ilTabs, $lng, $tpl;
$ilTabs->activateTab("info");
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
$tpl->setDescription($this->object->getDescription());
$info->enablePrivateNotes();
$info->enableNews();
if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
$info->enableNewsEditing();
$info->setBlockProperty("news", "settings", true);
}
// standard meta data
//$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
// instructions
$info->addSection($this->lng->txt("rep_robj_xeph_overview"));
include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilEphAssignment.php";
$ass = ilEphAssignment::getAssignmentDataOfEphorus($this->object->getId());
$cnt = 0;
$mcnt = 0;
foreach ($ass as $a) {
$cnt++;
if ($a["mandatory"]) {
$mcnt++;
}
}
$info->addProperty($lng->txt("rep_robj_xeph_assignments"), $cnt);
$info->addProperty($lng->txt("rep_robj_xeph_mandatory"), $mcnt);
if ($this->object->getPassMode() != "nr") {
$info->addProperty($lng->txt("rep_robj_xeph_pass_mode"), $lng->txt("rep_robj_xeph_msg_all_mandatory_ass"));
} else {
$info->addProperty($lng->txt("rep_robj_xeph_pass_mode"), sprintf($lng->txt("rep_robj_xeph_msg_min_number_ass"), $this->object->getPassNr()));
}
// feedback from tutor
include_once "Services/Tracking/classes/class.ilLPMarks.php";
if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
$lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
$mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
//$status = ilEphorusMembers::_lookupStatus($this->object->getId(), $ilUser->getId());
$st = $this->object->determineStatusOfUser($ilUser->getId());
$status = $st["overall_status"];
if ($lpcomment != "" || $mark != "" || $status != "notgraded") {
$info->addSection($this->lng->txt("rep_robj_xeph_feedback_from_tutor"));
if ($lpcomment != "") {
$info->addProperty($this->lng->txt("rep_robj_xeph_comment"), $lpcomment);
}
if ($mark != "") {
$info->addProperty($this->lng->txt("rep_robj_xeph_mark"), $mark);
}
//if ($status == "")
//{
// $info->addProperty($this->lng->txt("status"),
// $this->lng->txt("message_no_delivered_files"));
//}
//else
if ($status != "notgraded") {
$img = '<img border="0" src="' . ilUtil::getImagePath("scorm/" . $status . ".png") . '" ' . ' alt="' . $lng->txt("rep_robj_xeph_" . $status) . '" title="' . $lng->txt("rep_robj_xeph_" . $status) . '" style="vertical-align:middle;"/>';
$add = "";
if ($st["failed_a_mandatory"]) {
$add = " (" . $lng->txt("rep_robj_xeph_msg_failed_mandatory") . ")";
} else {
if ($status == "failed") {
$add = " (" . $lng->txt("rep_robj_xeph_msg_missed_minimum_number") . ")";
}
}
$info->addProperty($this->lng->txt("status"), $img . " " . $this->lng->txt("rep_robj_xeph_" . $status) . $add);
}
}
}
// forward the command
$this->ctrl->forwardCommand($info);
}
示例6: infoScreen
/**
* show information screen
*/
function infoScreen()
{
global $ilAccess, $ilUser, $ilTabs;
$ilTabs->activateTab("id_info");
if (!$ilAccess->checkAccess("visible", "", $this->object->getRefId())) {
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
}
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
/*
$info->enableNews();
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
{
//$info->enableNewsEditing();
$info->setBlockProperty("news", "settings", true);
}*/
// general information
$this->lng->loadLanguageModule("meta");
$this->lng->loadLanguageModule("mcst");
$med_items = $this->object->getItemsArray();
$info->addSection($this->lng->txt("meta_general"));
$info->addProperty($this->lng->txt("mcst_nr_items"), (int) count($med_items));
if (count($med_items) > 0) {
$cur = current($med_items);
$last = ilDatePresentation::formatDate(new ilDateTime($cur["creation_date"], IL_CAL_DATETIME));
} else {
$last = "-";
}
$info->addProperty($this->lng->txt("mcst_last_submission"), $last);
// forward the command
$this->ctrl->forwardCommand($info);
}
示例7: showInfoScreen
/**
* show info screen
*
* @access protected
* @return
*/
protected function showInfoScreen()
{
global $tpl, $ilUser;
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
$info->setFormAction($this->ctrl->getFormAction($this));
if ($this->app->isMilestone()) {
$info->addSection($this->lng->txt('cal_ms_details'));
} else {
$info->addSection($this->lng->txt('cal_details'));
}
// Appointment
$info->addProperty($this->lng->txt('appointment'), ilDatePresentation::formatPeriod($this->app->getStart(), $this->app->getEnd()));
$info->addProperty($this->lng->txt('title'), $this->app->getPresentationTitle());
// Description
if (strlen($desc = $this->app->getDescription())) {
$info->addProperty($this->lng->txt('description'), $desc);
}
// Location
if (strlen($loc = $this->app->getLocation())) {
$info->addProperty($this->lng->txt('cal_where'), $loc);
}
// completion
if ($this->app->isMilestone() && $this->app->getCompletion() > 0) {
$info->addProperty($this->lng->txt('cal_task_completion'), $this->app->getCompletion() . " %");
}
include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
$cat_id = ilCalendarCategoryAssignments::_lookupCategory($this->app->getEntryId());
$cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo($cat_id);
$type = ilObject::_lookupType($cat_info['obj_id']);
if ($this->app->isMilestone() && $cat_info['type'] == ilCalendarCategory::TYPE_OBJ && ($type == "grp" || $type == "crs")) {
// users responsible
$users = $this->app->readResponsibleUsers();
$delim = "";
foreach ($users as $r) {
$value .= $delim . $r["lastname"] . ", " . $r["firstname"] . " [" . $r["login"] . "]";
$delim = "<br />";
}
if (count($users) > 0) {
$info->addProperty($this->lng->txt('cal_responsible'), $value);
}
}
$category = new ilCalendarCategory($cat_id);
if ($category->getType() == ilCalendarCategory::TYPE_OBJ) {
$info->addSection($this->lng->txt('additional_info'));
$cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo($cat_id);
$refs = ilObject::_getAllReferences($cat_info['obj_id']);
include_once './Services/Link/classes/class.ilLink.php';
$href = ilLink::_getStaticLink(current($refs), ilObject::_lookupType($cat_info['obj_id']), true);
$info->addProperty($this->lng->txt('perma_link'), '<a class="small" href="' . $href . '" target="_top">' . $href . '</a>');
}
$tpl->setContent($info->getHTML());
}
示例8: infoScreenForward
/**
* show information screen
*/
function infoScreenForward()
{
global $ilTabs, $ilErr, $ilToolbar;
$ilTabs->activateTab("id_info");
if (!$this->checkPermissionBool("visible")) {
$ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
}
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
if ($this->checkPermissionBool("read", "sendfile")) {
// #9876
$this->lng->loadLanguageModule("file");
// #14378
include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
$button = ilLinkButton::getInstance();
$button->setCaption("file_download");
$button->setPrimary(true);
// get permanent download link for repository
if ($this->id_type == self::REPOSITORY_NODE_ID) {
$button->setUrl(ilObjFileAccess::_getPermanentDownloadLink($this->node_id));
} else {
$button->setUrl($this->ctrl->getLinkTarget($this, "sendfile"));
}
$ilToolbar->addButtonInstance($button);
}
$info->enablePrivateNotes();
if ($this->checkPermissionBool("read")) {
$info->enableNews();
}
// no news editing for files, just notifications
$info->enableNewsEditing(false);
if ($this->checkPermissionBool("write")) {
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
if ($enable_internal_rss) {
$info->setBlockProperty("news", "settings", true);
$info->setBlockProperty("news", "public_notifications_option", true);
}
}
// standard meta data
$info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
$info->addSection($this->lng->txt("file_info"));
$info->addProperty($this->lng->txt("filename"), $this->object->getFileName());
// BEGIN WebDAV Guess file type.
$info->addProperty($this->lng->txt("type"), $this->object->guessFileType());
// END WebDAV Guess file type.
$info->addProperty($this->lng->txt("size"), ilFormat::formatSize(ilObjFile::_lookupFileSize($this->object->getId()), 'long'));
$info->addProperty($this->lng->txt("version"), $this->object->getVersion());
// using getVersions function instead of ilHistory direct
$uploader = $this->object->getVersions();
$uploader = array_shift($uploader);
$uploader = $uploader["user_id"];
$this->lng->loadLanguageModule("file");
include_once "Services/User/classes/class.ilUserUtil.php";
$info->addProperty($this->lng->txt("file_uploaded_by"), ilUserUtil::getNamePresentation($uploader));
// download link added in repository
if ($this->id_type == self::REPOSITORY_NODE_ID && $this->checkPermissionBool("read", "sendfile")) {
$tpl = new ilTemplate("tpl.download_link.html", true, true, "Modules/File");
$tpl->setVariable("LINK", ilObjFileAccess::_getPermanentDownloadLink($this->node_id));
$info->addProperty($this->lng->txt("download_link"), $tpl->get());
}
if ($this->id_type == self::WORKSPACE_NODE_ID) {
$info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
}
// display previews
include_once "./Services/Preview/classes/class.ilPreview.php";
if (!$this->ctrl->isAsynch() && ilPreview::hasPreview($this->object->getId(), $this->object->getType()) && $this->checkPermissionBool("read")) {
include_once "./Services/Preview/classes/class.ilPreviewGUI.php";
// get context for access checks later on
$context;
switch ($this->id_type) {
case self::WORKSPACE_NODE_ID:
case self::WORKSPACE_OBJECT_ID:
$context = ilPreviewGUI::CONTEXT_WORKSPACE;
break;
default:
$context = ilPreviewGUI::CONTEXT_REPOSITORY;
break;
}
$preview = new ilPreviewGUI($this->node_id, $context, $this->object->getId(), $this->access_handler);
$info->addProperty($this->lng->txt("preview"), $preview->getInlineHTML());
}
// forward the command
// $this->ctrl->setCmd("showSummary");
// $this->ctrl->setCmdClass("ilinfoscreengui");
$this->ctrl->forwardCommand($info);
}
示例9: getOverviewBody
/**
* 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"]);
//.........这里部分代码省略.........
示例10: infoScreenForward
/**
* show information screen
*/
function infoScreenForward()
{
global $ilTabs, $ilErr;
$ilTabs->activateTab("id_info");
if (!$this->checkPermissionBool("visible")) {
$ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
}
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
if ($this->checkPermissionBool("read", "sendfile")) {
// 9876
$this->lng->loadLanguageModule("file");
$info->addButton($this->lng->txt("file_download"), $this->ctrl->getLinkTarget($this, "sendfile"));
}
$info->enablePrivateNotes();
if ($this->checkPermissionBool("read")) {
$info->enableNews();
}
// no news editing for files, just notifications
$info->enableNewsEditing(false);
if ($this->checkPermissionBool("write")) {
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
if ($enable_internal_rss) {
$info->setBlockProperty("news", "settings", true);
$info->setBlockProperty("news", "public_notifications_option", true);
}
}
// standard meta data
$info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
$info->addSection($this->lng->txt("file_info"));
$info->addProperty($this->lng->txt("filename"), $this->object->getFileName());
// BEGIN WebDAV Guess file type.
$info->addProperty($this->lng->txt("type"), $this->object->guessFileType());
// END WebDAV Guess file type.
$info->addProperty($this->lng->txt("size"), ilFormat::formatSize(ilObjFile::_lookupFileSize($this->object->getId()), 'long'));
$info->addProperty($this->lng->txt("version"), $this->object->getVersion());
include_once "./Services/History/classes/class.ilHistory.php";
$uploader = ilHistory::_getEntriesForObject($this->object->getId(), $this->object->getType());
$uploader = array_shift($uploader);
$uploader = $uploader["user_id"];
$this->lng->loadLanguageModule("file");
include_once "Services/User/classes/class.ilUserUtil.php";
$info->addProperty($this->lng->txt("file_uploaded_by"), ilUserUtil::getNamePresentation($uploader));
if ($this->id_type == self::WORKSPACE_NODE_ID) {
$info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
}
// forward the command
// $this->ctrl->setCmd("showSummary");
// $this->ctrl->setCmdClass("ilinfoscreengui");
$this->ctrl->forwardCommand($info);
}
示例11: infoScreen
//.........这里部分代码省略.........
if ($this->object->getTestSession()->getActiveId() > 0) {
// test results button
if ($this->object->canShowTestResults($ilUser->getId())) {
//$info->addFormButton("outUserResultsOverview", $this->lng->txt("tst_show_results"));
$big_button[] = array("outUserResultsOverview", $this->lng->txt("tst_show_results"));
if ($this->object->getHighscoreEnabled()) {
// Can also compare results then
$big_button[] = array("outResultsToplist", $this->lng->txt("tst_show_toplist"));
}
}
}
}
if ($this->object->getTestSession()->getActiveId() > 0) {
if ($this->object->canShowSolutionPrintview($ilUser->getId())) {
//$info->addFormButton("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"));
$big_button[] = array("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"));
}
}
}
if (!$this->object->isOnline()) {
$message = $this->lng->txt("test_is_offline");
if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
$message .= "<br /><a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">" . $this->lng->txt("test_edit_settings") . "</a>";
}
ilUtil::sendInfo($message);
}
if ($this->object->getShowInfo()) {
$info->enablePrivateNotes();
}
/*
if (strlen($this->object->getIntroduction()))
{
$info->addSection($this->lng->txt("tst_introduction"));
$info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction()));
}
* */
if ($big_button) {
$out = '<div class="il_ButtonGroup il_BigButton">';
foreach ($big_button as $button) {
$out .= '<input type="submit" class="submit il_BigButton" name="cmd[' . $button[0] . ']" value="' . $button[1] . '" />';
}
$out .= '</div>';
$big_button = $out;
}
if (strlen($this->object->getIntroduction())) {
$introduction = $this->object->getIntroduction();
$info->addSection($this->lng->txt("tst_introduction"));
$info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction()) . $big_button . "<br />" . $info->getHiddenToggleButton());
} else {
$info->addSection("");
$info->addProperty("", $big_button . $info->getHiddenToggleButton());
}
$info->addSection($this->lng->txt("tst_general_properties"));
if ($this->object->getShowInfo()) {
$info->addProperty($this->lng->txt("author"), $this->object->getAuthor());
$info->addProperty($this->lng->txt("title"), $this->object->getTitle());
}
if ($this->object->isOnline() && $this->object->isComplete()) {
if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
if ($this->object->getShowInfo() || !$this->object->getForceJS()) {
// use javascript
$checked_javascript = false;
if ($this->object->getJavaScriptOutput()) {
$checked_javascript = true;
}
if ($this->object->getForceJS()) {
示例12: getOverviewBody
/**
* Get assignment body for overview
*/
function getOverviewBody($a_data)
{
global $lng, $ilCtrl, $ilUser;
$tpl = new ilTemplate("tpl.assignment_body.html", true, true, "Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus");
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.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("rep_robj_xeph_instruction"));
$info->addProperty("", nl2br(ilUtil::makeClickable($a_data["instruction"], true)));
}
// schedule
$info->addSection($lng->txt("rep_robj_xeph_schedule"));
if ($a_data["start_time"] > 0) {
$info->addProperty($lng->txt("rep_robj_xeph_start_time"), ilDatePresentation::formatDate(new ilDateTime($a_data["start_time"], IL_CAL_UNIX)));
}
$info->addProperty($lng->txt("rep_robj_xeph_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("rep_robj_xeph_time_to_send"), "<b>" . $time_str . "</b>");
}
// public submissions
if ($this->eph->getShowSubmissions()) {
$ilCtrl->setParameterByClass("ilobjephorusgui", "ass_id", $a_data["id"]);
if ($a_data["deadline"] - time() <= 0) {
$link = '<a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjephorusgui", "listPublicSubmissions") . '">' . $lng->txt("rep_robj_xeph_list_submission") . '</a>';
$info->addProperty($lng->txt("rep_robj_xeph_public_submission"), $link);
} else {
$info->addProperty($lng->txt("rep_robj_xeph_public_submission"), $lng->txt("rep_robj_xeph_msg_public_submission"));
}
$ilCtrl->setParameterByClass("ilobjephorusgui", "ass_id", $_GET["ass_id"]);
}
$ilCtrl->setParameterByClass("ilobjephorusgui", "ass_id", $a_data["id"]);
if (!$not_started_yet) {
// download files
$files = ilEphAssignment::getFiles($a_data["eph_id"], $a_data["id"]);
if (count($files) > 0) {
$info->addSection($lng->txt("rep_robj_xeph_files"));
foreach ($files as $file) {
$ilCtrl->setParameterByClass("ilobjephorusgui", "file", urlencode($file["name"]));
$info->addProperty($file["name"], $lng->txt("rep_robj_xeph_download"), $ilCtrl->getLinkTargetByClass("ilobjephorusgui", "downloadFile"));
$ilCtrl->setParameterByClass("ilobjephorusgui", "file", "");
}
}
// submission
$info->addSection($lng->txt("rep_robj_xeph_your_submission"));
$delivered_files = ilEphAssignment::getDeliveredFiles($a_data["eph_id"], $a_data["id"], $ilUser->getId());
$times_up = false;
if ($a_data["deadline"] - time() < 0) {
$times_up = true;
}
$titles = array();
foreach ($delivered_files as $file) {
$titles[] = $file["filetitle"];
}
$files_str = implode($titles, ", ");
if ($files_str == "") {
$files_str = $lng->txt("rep_robj_xeph_message_no_delivered_files");
}
$ilCtrl->setParameterByClass("ilobjephorusgui", "ass_id", $a_data["id"]);
if (!$times_up) {
$files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjephorusgui", "submissionScreen") . '">' . (count($titles) == 0 ? $lng->txt("rep_robj_xeph_hand_in") : $lng->txt("rep_robj_xeph_edit_submission")) . '</a>';
} else {
if (count($titles) > 0) {
$files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjephorusgui", "submissionScreen") . '">' . $lng->txt("rep_robj_xeph_already_delivered_files") . '</a>';
}
}
$info->addProperty($lng->txt("rep_robj_xeph_files_returned"), $files_str);
$last_sub = ilEphAssignment::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("rep_robj_xeph_last_submission"), $last_sub);
}
// feedback from tutor
$storage = new ilFSStorageEphorus($a_data["eph_id"], $a_data["id"]);
$cnt_files = $storage->countFeedbackFiles($ilUser->getId());
$lpcomment = ilEphAssignment::lookupCommentForUser($a_data["id"], $ilUser->getId());
$mark = ilEphAssignment::lookupMarkOfUser($a_data["id"], $ilUser->getId());
$status = ilEphAssignment::lookupStatusOfUser($a_data["id"], $ilUser->getId());
if ($lpcomment != "" || $mark != "" || $status != "notgraded" || $cnt_files > 0) {
$info->addSection($lng->txt("rep_robj_xeph_feedback_from_tutor"));
if ($lpcomment != "") {
$info->addProperty($lng->txt("rep_robj_xeph_comment"), $lpcomment);
}
if ($mark != "") {
$info->addProperty($lng->txt("rep_robj_xeph_mark"), $mark);
}
if ($status == "") {
//.........这里部分代码省略.........
示例13: infoScreen
/**
* show information screen
*/
function infoScreen()
{
global $ilAccess;
global $ilUser;
if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
}
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
$output_gui =& new ilSurveyExecutionGUI($this->object);
$info->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen"));
$info->enablePrivateNotes();
$anonymize_key = NULL;
if ($this->object->getAnonymize() == 1) {
if ($_SESSION["anonymous_id"][$this->object->getId()]) {
$anonymize_key = $_SESSION["anonymous_id"][$this->object->getId()];
} else {
if ($_POST["anonymous_id"]) {
$anonymize_key = $_POST["anonymous_id"];
}
}
}
$canStart = $this->object->canStartSurvey($anonymize_key);
$showButtons = $canStart["result"];
if (!$showButtons) {
if ($canStart["edit_settings"] && $ilAccess->checkAccess("write", "", $this->ref_id)) {
$canStart["messages"][] = "<a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">» " . $this->lng->txt("survey_edit_settings") . "</a>";
}
ilUtil::sendInfo(implode("<br />", $canStart["messages"]));
}
$big_button = false;
if ($showButtons) {
// output of start/resume buttons for personalized surveys
if (!$this->object->getAnonymize()) {
$survey_started = $this->object->isSurveyStarted($ilUser->getId(), "");
// Anonymous User tries to start a personalized survey
if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
ilUtil::sendInfo($this->lng->txt("anonymous_with_personalized_survey"));
} else {
if ($survey_started === 1) {
ilUtil::sendInfo($this->lng->txt("already_completed_survey"));
} elseif ($survey_started === 0) {
$big_button = array("resume", $this->lng->txt("resume_survey"));
} elseif ($survey_started === FALSE) {
$big_button = array("start", $this->lng->txt("start_survey"));
}
}
} else {
if ($this->object->getAnonymize() && !$this->object->isAccessibleWithoutCode()) {
if (($_SESSION["AccountId"] == ANONYMOUS_USER_ID || $this->object->isAccessibleWithCodeForAll()) && strlen($_POST["anonymous_id"]) == 0 && strlen($_SESSION["anonymous_id"][$this->object->getId()]) == 0) {
$info->setFormAction($this->ctrl->getFormAction($this, "infoScreen"));
$info->addSection($this->lng->txt("anonymization"));
$info->addProperty("", $this->lng->txt("anonymize_anonymous_introduction"));
$info->addPropertyTextinput($this->lng->txt("enter_anonymous_id"), "anonymous_id", "", 8, "infoScreen", $this->lng->txt("submit"));
} else {
if (strlen($_POST["anonymous_id"]) > 0) {
if (!$this->object->checkSurveyCode($_POST["anonymous_id"])) {
ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used"));
} else {
$anonymize_key = $_POST["anonymous_id"];
}
} else {
if (strlen($_SESSION["anonymous_id"][$this->object->getId()]) > 0) {
if (!$this->object->checkSurveyCode($_SESSION["anonymous_id"][$this->object->getId()])) {
ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used"));
} else {
$anonymize_key = $_SESSION["anonymous_id"][$this->object->getId()];
}
} else {
// registered users do not need to know that there is an anonymous key. The data is anonymized automatically
$anonymize_key = $this->object->getUserAccessCode($ilUser->getId());
if (!strlen($anonymize_key)) {
$anonymize_key = $this->object->createNewAccessCode();
$this->object->saveUserAccessCode($ilUser->getId(), $anonymize_key);
}
}
}
$info->addHiddenElement("anonymous_id", $anonymize_key);
$survey_started = $this->object->isSurveyStarted($ilUser->getId(), $anonymize_key);
if ($survey_started === 1) {
ilUtil::sendInfo($this->lng->txt("already_completed_survey"));
} elseif ($survey_started === 0) {
$big_button = array("resume", $this->lng->txt("resume_survey"));
} elseif ($survey_started === FALSE) {
$big_button = array("start", $this->lng->txt("start_survey"));
}
}
} else {
// free access
$survey_started = $this->object->isSurveyStarted($ilUser->getId(), "");
if ($survey_started === 1) {
ilUtil::sendInfo($this->lng->txt("already_completed_survey"));
} elseif ($survey_started === 0) {
$big_button = array("resume", $this->lng->txt("resume_survey"));
} elseif ($survey_started === FALSE) {
$big_button = array("start", $this->lng->txt("start_survey"));
//.........这里部分代码省略.........
示例14: addCustomInfoFields
protected function addCustomInfoFields(ilInfoScreenGUI $a_info)
{
$a_info->addProperty($this->lng->txt('version'), $this->object->getVersion());
$a_info->addProperty($this->lng->txt('rfil_version_tstamp'), ilDatePresentation::formatDate(new ilDateTime($this->object->getVersionDateTime(), IL_CAL_UNIX)));
}
示例15: addInfoItems
/**
* Add info items
* @param ilInfoScreenGUI $info
*/
public function addInfoItems($info)
{
global $ilCtrl, $ilUser;
$access = true;
if (ilViteroLockedUser::isLocked($ilUser->getId(), $this->object->getVGroupId())) {
ilUtil::sendFailure(ilViteroPlugin::getInstance()->txt('user_locked_info'));
$access = false;
}
$booking_id = ilViteroUtils::getOpenRoomBooking($this->object->getVGroupId());
if ($booking_id and $access) {
$this->ctrl->setParameter($this, 'bid', $booking_id);
$info->setFormAction($ilCtrl->getFormAction($this), '_blank');
$big_button = '<div class="il_ButtonGroup" style="margin:25px; text-align:center; font-size:25px;">' . '<input type="submit" class="submit" name="cmd[startSession]" value="' . ilViteroPlugin::getInstance()->txt('start_session') . '" style="padding:10px;" /></div>';
$info->addSection("");
$info->addProperty("", $big_button);
}
$start = new ilDateTime(time(), IL_CAL_UNIX);
$end = clone $start;
$end->increment(IL_CAL_YEAR, 1);
$booking = ilViteroUtils::lookupNextBooking($start, $end, $this->object->getVGroupId());
if (!$booking['start'] instanceof ilDateTime) {
return true;
}
ilDatePresentation::setUseRelativeDates(false);
$info->addSection(ilViteroPlugin::getInstance()->txt('info_next_appointment'));
$info->addProperty(ilViteroPlugin::getInstance()->txt('info_next_appointment_dt'), ilDatePresentation::formatPeriod($booking['start'], $booking['end']));
}