本文整理汇总了PHP中ilUtil::makeClickable方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::makeClickable方法的具体用法?PHP ilUtil::makeClickable怎么用?PHP ilUtil::makeClickable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUtil
的用法示例。
在下文中一共展示了ilUtil::makeClickable方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showContent
/**
* Show content overview
*/
protected function showContent()
{
// preparation
$content = $this->plugin->getTemplate("tpl.leitner_overview.html");
// instructions
if ($instructions = $this->object->getInstructions()) {
$content->setVariable("INSTRUCTIONS", nl2br(ilUtil::makeClickable($instructions, true)));
}
// table with boxes and commands
$this->plugin->includeClass("Leitner/class.ilLeitnerTableGUI.php");
$table = new ilLeitnerTableGUI($this, "showContent");
$table->setData($this->training->getOverviewData());
$unused_cards = $this->training->countUnusedCards();
if ($unused_cards > 0 and !$this->training->isStartMaxReached()) {
$table->addCommandButton("fillTraining", $this->txt("leitner_fill_training"));
}
if ($used_cards = $this->training->countUsedCards()) {
$table->addCommandButton("confirmResetTraining", $this->txt("reset_training"));
}
$content->setVariable("TABLE", $table->getHTML());
// message for untrained cards
if ($unused_cards > 0) {
$content->setVariable("UNTRAINED", sprintf($this->txt($unused_cards == 1 ? "untrained_1" : "untrained_x"), $unused_cards));
$content->setVariable("UNTRAINED_HINT", $this->txt($this->training->isStartMaxReached() ? "leitner_hint_train_startbox" : "leitner_hint_fill_startbox"));
}
// explanation
$content->setVariable("EXPLANATION", $this->txt("leitner_explanation"));
// set the output
$this->tpl->setContent($content->get());
}
示例2: makeClickable
/**
* Make clickable
*
* @param
* @return
*/
function makeClickable($a_str)
{
// this fixes bug 8744. We assume that strings that contain < and >
// already contain html, we do not handle these
if (is_int(strpos($a_str, ">")) && is_int(strpos($a_str, "<"))) {
return $a_str;
}
return ilUtil::makeClickable($a_str);
}
示例3: getPDMailHTML
/**
* Get Mail HTML for Personal Desktop Mail Display
*/
public function getPDMailHTML($a_mail_id, $a_mobj_id)
{
global $lng, $rbacsystem, $ilias;
$lng->loadLanguageModule('mail');
//get the mail from user
$umail = new ilMail($_SESSION['AccountId']);
// catch hack attempts
if (!$rbacsystem->checkAccess('internal_mail', $umail->getMailObjectReferenceId())) {
$ilias->raiseError($lng->txt('permission_denied'), $ilias->error_obj->WARNING);
}
$umail->markRead(array($a_mail_id));
$mail_data = $umail->getMail($a_mail_id);
$tpl = new ilTemplate('tpl.pd_mail.html', true, true, 'Services/Mail');
// attachments
if ($mail_data['attachments']) {
foreach ($mail_data['attachments'] as $file) {
$tpl->setCurrentBlock('a_row');
$tpl->setVariable('HREF_DOWNLOAD', 'ilias.php?baseClass=ilMailGUI&type=deliverFile&mail_id=' . $_GET['mail_id'] . '&filename=' . md5($file));
$tpl->setVariable('FILE_NAME', $file);
$tpl->setVariable('TXT_DOWNLOAD', $lng->txt('download'));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('attachment');
$tpl->setVariable('TXT_ATTACHMENT', $lng->txt('attachments'));
$tpl->parseCurrentBlock();
}
$tpl->setVariable('TXT_FROM', $lng->txt('from'));
/**
* @var $sender ilObjUser
*/
$sender = ilObjectFactory::getInstanceByObjId($mail_data['sender_id'], false);
if ($sender && $sender->getId() != ANONYMOUS_USER_ID) {
$tpl->setCurrentBlock('pers_image');
$tpl->setVariable('IMG_SENDER', $sender->getPersonalPicturePath('xsmall'));
$tpl->setVariable('ALT_SENDER', $sender->getPublicName());
$tpl->parseCurrentBlock();
$tpl->setVariable('PUBLIC_NAME', $sender->getPublicName());
} else {
if (!$sender) {
$tpl->setVariable('PUBLIC_NAME', $mail_data['import_name'] . ' (' . $lng->txt('user_deleted') . ')');
} else {
$tpl->setCurrentBlock('pers_image');
$tpl->setVariable('IMG_SENDER', ilUtil::getImagePath('HeaderIconAvatar.png'));
$tpl->setVariable('ALT_SENDER', ilMail::_getIliasMailerName());
$tpl->parseCurrentBlock();
$tpl->setVariable('PUBLIC_NAME', ilMail::_getIliasMailerName());
}
}
$tpl->setVariable('TXT_TO', $lng->txt('mail_to'));
$tpl->setVariable('TO', $umail->formatNamesForOutput($mail_data['rcp_to']));
if ($mail_data['rcp_cc']) {
$tpl->setCurrentBlock('cc');
$tpl->setVariable('TXT_CC', $lng->txt('cc'));
$tpl->setVariable('CC', $umail->formatNamesForOutput($mail_data['rcp_cc']));
$tpl->parseCurrentBlock();
}
$tpl->setVariable('TXT_SUBJECT', $lng->txt('subject'));
$tpl->setVariable('SUBJECT', htmlspecialchars($mail_data['m_subject']));
$tpl->setVariable('TXT_DATE', $lng->txt('date'));
$tpl->setVariable('DATE', ilDatePresentation::formatDate(new ilDateTime($mail_data['send_time'], IL_CAL_DATETIME)));
$tpl->setVariable('TXT_MESSAGE', $lng->txt('message'));
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
$tpl->setVariable('MAIL_MESSAGE', nl2br(ilUtil::makeClickable(htmlspecialchars(ilUtil::securePlainString($mail_data['m_message'])))));
return $tpl->get();
}
示例4: htmlencodePlainString
/**
* Encodes a plain text string into HTML for display in a browser.
* This function encodes HTML special characters: < > & with < > &
* and converts newlines into <br>
*
* If $a_make_links_clickable is set to true, URLs in the plain string which
* are considered to be safe, are made clickable.
*
*
* @param string the plain text string
* @param boolean set this to true, to make links in the plain string
* clickable.
* @param boolean set this to true, to detect goto links
* @static
*
*/
public static function htmlencodePlainString($a_str, $a_make_links_clickable, $a_detect_goto_links = false)
{
$encoded = "";
if ($a_make_links_clickable) {
// Find text sequences in the plain text string which match
// the URI syntax rules, and pass them to ilUtil::makeClickable.
// Encode all other text sequences in the plain text string using
// htmlspecialchars and nl2br.
// The following expressions matches URI's as specified in RFC 2396.
//
// The expression matches URI's, which start with some well known
// schemes, like "http:", or with "www.". This must be followed
// by at least one of the following RFC 2396 expressions:
// - alphanum: [a-zA-Z0-9]
// - reserved: [;\/?:|&=+$,]
// - mark: [\\-_.!~*\'()]
// - escaped: %[0-9a-fA-F]{2}
// - fragment delimiter: #
// - uric_no_slash: [;?:@&=+$,]
$matches = array();
$numberOfMatches = preg_match_all('/(?:(?:http|https|ftp|ftps|mailto):|www\\.)(?:[a-zA-Z0-9]|[;\\/?:|&=+$,]|[\\-_.!~*\'()]|%[0-9a-fA-F]{2}|#|[;?:@&=+$,])+/', $a_str, $matches, PREG_OFFSET_CAPTURE);
$pos1 = 0;
$encoded = "";
foreach ($matches as $match) {
}
foreach ($matches[0] as $match) {
$matched_text = $match[0];
$pos2 = $match[1];
if ($matched_offset != previous_offset) {
// encode plain text
$encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1, $pos2 - $pos1)));
}
// encode URI
$encoded .= ilUtil::makeClickable($matched_text, $a_detect_goto_links);
$pos1 = $pos2 + strlen($matched_text);
}
if ($pos1 < strlen($a_str)) {
$encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1)));
}
} else {
$encoded = nl2br(htmlspecialchars($a_str));
}
return $encoded;
}
示例5: getHTML
/**
* get HTML
*
* @access public
* @param
* @return
*/
public function getHTML($a_app)
{
global $tree, $lng, $ilUser;
self::$counter++;
$this->tpl = new ilTemplate('tpl.appointment_panel.html', true, true, 'Services/Calendar');
// Panel variables
$this->tpl->setVariable('PANEL_NUM', self::$counter);
$this->tpl->setVariable('PANEL_TITLE', str_replace(' ()', '', $a_app['event']->getPresentationTitle(false)));
if ($a_app["event"]->isMilestone()) {
$this->tpl->setVariable('PANEL_DETAILS', $this->lng->txt('cal_ms_details'));
} else {
$this->tpl->setVariable('PANEL_DETAILS', $this->lng->txt('cal_details'));
}
$this->tpl->setVariable('PANEL_TXT_DATE', $this->lng->txt('date'));
if ($a_app['fullday']) {
$this->tpl->setVariable('PANEL_DATE', ilDatePresentation::formatPeriod(new ilDate($a_app['dstart'], IL_CAL_UNIX), new ilDate($a_app['dend'], IL_CAL_UNIX)));
} else {
$this->tpl->setVariable('PANEL_DATE', ilDatePresentation::formatPeriod(new ilDateTime($a_app['dstart'], IL_CAL_UNIX), new ilDateTime($a_app['dend'], IL_CAL_UNIX)));
}
if ($a_app['event']->getLocation()) {
$this->tpl->setVariable('PANEL_TXT_WHERE', $this->lng->txt('cal_where'));
$this->tpl->setVariable('PANEL_WHERE', ilUtil::makeClickable($a_app['event']->getLocation()), true);
}
if ($a_app['event']->getDescription()) {
$this->tpl->setVariable('PANEL_TXT_DESC', $this->lng->txt('description'));
$this->tpl->setVariable('PANEL_DESC', ilUtil::makeClickable(nl2br($a_app['event']->getDescription())));
}
if ($a_app['event']->isMilestone() && $a_app['event']->getCompletion() > 0) {
$this->tpl->setVariable('PANEL_TXT_COMPL', $this->lng->txt('cal_task_completion'));
$this->tpl->setVariable('PANEL_COMPL', $a_app['event']->getCompletion() . " %");
}
if ($a_app['event']->isMilestone()) {
// users responsible
$users = $a_app['event']->readResponsibleUsers();
$delim = "";
foreach ($users as $r) {
$value .= $delim . $r["lastname"] . ", " . $r["firstname"] . " [" . $r["login"] . "]";
$delim = "<br />";
}
if (count($users) > 0) {
$this->tpl->setVariable('PANEL_TXT_RESP', $this->lng->txt('cal_responsible'));
$this->tpl->setVariable('PANEL_RESP', $value);
}
}
include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
$cat_id = ilCalendarCategoryAssignments::_lookupCategory($a_app['event']->getEntryId());
$cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo($cat_id);
$entry_obj_id = isset($cat_info['subitem_obj_ids'][$cat_id]) ? $cat_info['subitem_obj_ids'][$cat_id] : $cat_info['obj_id'];
$this->tpl->setVariable('PANEL_TXT_CAL_TYPE', $this->lng->txt('cal_cal_type'));
switch ($cat_info['type']) {
case ilCalendarCategory::TYPE_GLOBAL:
$this->tpl->setVariable('PANEL_CAL_TYPE', $this->lng->txt('cal_type_system'));
break;
case ilCalendarCategory::TYPE_USR:
$this->tpl->setVariable('PANEL_CAL_TYPE', $this->lng->txt('cal_type_personal'));
break;
case ilCalendarCategory::TYPE_OBJ:
$type = ilObject::_lookupType($cat_info['obj_id']);
$this->tpl->setVariable('PANEL_CAL_TYPE', $this->lng->txt('cal_type_' . $type));
// Course group appointment registration
if ($this->settings->isCGRegistrationEnabled() and $type == 'crs' or type == 'grp') {
if (!$a_app['event']->isAutoGenerated()) {
include_once './Services/Calendar/classes/class.ilCalendarRegistration.php';
$reg = new ilCalendarRegistration($a_app['event']->getEntryId());
if ($reg->isRegistered($ilUser->getId(), new ilDateTime($a_app['dstart'], IL_CAL_UNIX), new ilDateTime($a_app['dend'], IL_CAL_UNIX))) {
$this->tpl->setCurrentBlock('panel_cancel_book_link');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->getSeed()->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $a_app['event']->getEntryId());
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $a_app['dstart']);
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $a_app['dend']);
$this->tpl->setVariable('TXT_PANEL_CANCELBOOK', $this->lng->txt('cal_reg_unregister'));
$this->tpl->setVariable('PANEL_CANCELBOOK_HREF', $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmUnregister'));
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock('panel_book_link');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->getSeed()->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $a_app['event']->getEntryId());
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $a_app['dstart']);
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $a_app['dend']);
$this->tpl->setVariable('TXT_PANEL_BOOK', $this->lng->txt('cal_reg_register'));
$this->tpl->setVariable('PANEL_BOOK_HREF', $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmRegister'));
$this->tpl->parseCurrentBlock();
}
include_once './Services/Link/classes/class.ilLink.php';
$registrations = array();
foreach ($reg->getRegisteredUsers(new ilDateTime($a_app['dstart'], IL_CAL_UNIX), new ilDateTime($a_app['dend'], IL_CAL_UNIX)) as $usr_data) {
$usr_id = $usr_data['usr_id'];
$this->ctrl->setParameterByClass('ilconsultationhoursgui', 'user', $usr_id);
$registrations[] = '<a href="' . $this->ctrl->getLinkTargetByClass('ilconsultationhoursgui', 'showprofile') . '">' . ilObjUser::_lookupFullname($usr_id);
$this->ctrl->setParameterByClass('ilconsultationhoursgui', 'user', '');
}
if (count($registrations)) {
$this->tpl->setCurrentBlock('panel_current_booking');
//.........这里部分代码省略.........
示例6: 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";
include_once "./Services/UIComponent/Button/classes/class.ilLinkButton.php";
if (IS_PAYMENT_ENABLED) {
include_once './Services/Payment/classes/class.ilPaymentObject.php';
}
$info = new ilInfoScreenGUI(null);
$info->setTableClass("");
$not_started_yet = false;
if ($a_data["start_time"] > 0 && time() - $a_data["start_time"] <= 0) {
$not_started_yet = true;
}
if (!$not_started_yet) {
// instructions
$info->addSection($lng->txt("exc_instruction"));
$is_html = strlen($a_data["instruction"]) != strlen(strip_tags($a_data["instruction"]));
if (!$is_html) {
$a_data["instruction"] = nl2br(ilUtil::makeClickable($a_data["instruction"], true));
}
$info->addProperty("", $a_data["instruction"]);
}
// schedule
$info->addSection($lng->txt("exc_schedule"));
if ($a_data["start_time"] > 0) {
$info->addProperty($lng->txt("exc_start_time"), ilDatePresentation::formatDate(new ilDateTime($a_data["start_time"], IL_CAL_UNIX)));
}
if ($a_data["deadline"] > 0) {
$info->addProperty($lng->txt("exc_edit_until"), ilDatePresentation::formatDate(new ilDateTime($a_data["deadline"], IL_CAL_UNIX)));
}
$time_str = $this->getTimeString($a_data["deadline"]);
if (!$not_started_yet) {
$info->addProperty($lng->txt("exc_time_to_send"), "<b>" . $time_str . "</b>");
}
// public submissions
if ($this->exc->getShowSubmissions()) {
$ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
if ($a_data["deadline"] - time() <= 0) {
$button = ilLinkButton::getInstance();
$button->setCaption("exc_list_submission");
$button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "listPublicSubmissions"));
$info->addProperty($lng->txt("exc_public_submission"), $button->render());
} else {
$info->addProperty($lng->txt("exc_public_submission"), $lng->txt("exc_msg_public_submission"));
}
$ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $_GET["ass_id"]);
}
$ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
if (!$not_started_yet) {
// download files
$files = ilExAssignment::getFiles($a_data["exc_id"], $a_data["id"]);
if (count($files) > 0) {
$info->addSection($lng->txt("exc_files"));
foreach ($files as $file) {
// if download must be purchased first show a "buy"-button
if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'download') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'download'))) {
$info->addProperty($file["name"], $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
} else {
$ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file["name"]));
$info->addProperty($file["name"], $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFile"));
$ilCtrl->setParameterByClass("ilobjexercisegui", "file", "");
}
}
}
// submission
// if submission must be purchased first
if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'upload') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'upload'))) {
$info->addSection($lng->txt("exc_your_submission"));
$ilCtrl->clearParameters($this);
$ilCtrl->setParameter($this, "ref_id", $_GET['ref_id']);
$ilCtrl->setParameter($this, 'subtype', 'upload');
$info->addProperty($lng->txt('exc_hand_in'), $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
} else {
$info->addSection($lng->txt("exc_your_submission"));
$delivered_files = ilExAssignment::getDeliveredFiles($a_data["exc_id"], $a_data["id"], $ilUser->getId());
$times_up = false;
if ($a_data["deadline"] > 0 && $a_data["deadline"] - time() < 0) {
$times_up = true;
}
$team_members = null;
switch ($a_data["type"]) {
case ilExAssignment::TYPE_UPLOAD_TEAM:
$no_team_yet = false;
$team_members = ilExAssignment::getTeamMembersByAssignmentId($a_data["id"], $ilUser->getId());
if (sizeof($team_members)) {
$team = array();
foreach ($team_members as $member_id) {
$team[] = ilObjUser::_lookupFullname($member_id);
}
$team = implode(", ", $team);
$button = ilLinkButton::getInstance();
$button->setCaption("exc_manage_team");
$button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreenTeam"));
$team .= " " . $button->render();
$info->addProperty($lng->txt("exc_team_members"), $team);
//.........这里部分代码省略.........
示例7: infoScreen
/**
* show information screen
*/
function infoScreen()
{
global $ilErr, $ilAccess, $ilUser, $ilSetting;
$this->checkPermission('visible');
// Fill meta header tags
include_once 'Services/MetaData/classes/class.ilMDUtils.php';
ilMDUtils::_fillHTMLMetaTags($this->object->getId(), $this->object->getId(), 'crs');
$this->tabs_gui->setTabActive('info_short');
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
include_once 'Modules/Course/classes/class.ilCourseFile.php';
$files =& ilCourseFile::_readFilesByCourse($this->object->getId());
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
$info->enableFeedback();
$info->enableNews();
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
$info->enableNewsEditing();
}
if (strlen($this->object->getImportantInformation()) or strlen($this->object->getSyllabus()) or count($files)) {
$info->addSection($this->lng->txt('crs_general_informations'));
}
if (strlen($this->object->getImportantInformation())) {
$info->addProperty($this->lng->txt('crs_important_info'), "<strong>" . nl2br(ilUtil::makeClickable($this->object->getImportantInformation(), true) . "</strong>"));
}
if (strlen($this->object->getSyllabus())) {
$info->addProperty($this->lng->txt('crs_syllabus'), nl2br(ilUtil::makeClickable($this->object->getSyllabus(), true)));
}
// files
if (count($files)) {
$tpl = new ilTemplate('tpl.event_info_file.html', true, true, 'Modules/Course');
foreach ($files as $file) {
$tpl->setCurrentBlock("files");
$this->ctrl->setParameter($this, 'file_id', $file->getFileId());
$tpl->setVariable("DOWN_LINK", $this->ctrl->getLinkTarget($this, 'sendfile'));
$tpl->setVariable("DOWN_NAME", $file->getFileName());
$tpl->setVariable("DOWN_INFO_TXT", $this->lng->txt('crs_file_size_info'));
$tpl->setVariable("DOWN_SIZE", $file->getFileSize());
$tpl->setVariable("TXT_BYTES", $this->lng->txt('bytes'));
$tpl->parseCurrentBlock();
}
$info->addProperty($this->lng->txt('crs_file_download'), $tpl->get());
}
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
$record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'crs', $this->object->getId());
$record_gui->setInfoObject($info);
$record_gui->parse();
// meta data
$info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
// contact
if ($this->object->hasContactData()) {
$info->addSection($this->lng->txt("crs_contact"));
}
if (strlen($this->object->getContactName())) {
$info->addProperty($this->lng->txt("crs_contact_name"), $this->object->getContactName());
}
if (strlen($this->object->getContactResponsibility())) {
$info->addProperty($this->lng->txt("crs_contact_responsibility"), $this->object->getContactResponsibility());
}
if (strlen($this->object->getContactPhone())) {
$info->addProperty($this->lng->txt("crs_contact_phone"), $this->object->getContactPhone());
}
if ($this->object->getContactEmail()) {
require_once 'Services/Mail/classes/class.ilMailFormCall.php';
$emails = split(",", $this->object->getContactEmail());
foreach ($emails as $email) {
$email = trim($email);
$etpl = new ilTemplate("tpl.crs_contact_email.html", true, true, 'Modules/Course');
$etpl->setVariable("EMAIL_LINK", ilMailFormCall::getLinkTarget($info, 'showSummary', array(), array('type' => 'new', 'rcp_to' => $email, 'sig' => $this->createMailSignature())));
$etpl->setVariable("CONTACT_EMAIL", $email);
$mailString .= $etpl->get() . "<br />";
}
$info->addProperty($this->lng->txt("crs_contact_email"), $mailString);
}
if (strlen($this->object->getContactConsultation())) {
$info->addProperty($this->lng->txt("crs_contact_consultation"), nl2br($this->object->getContactConsultation()));
}
//
// access
//
// #10360
$this->lng->loadLanguageModule("rep");
$info->addSection($this->lng->txt("rep_activation_availability"));
$info->showLDAPRoleGroupMappingInfo();
// activation
if ($this->object->getActivationUnlimitedStatus()) {
$info->addProperty($this->lng->txt("rep_activation_access"), $this->lng->txt('crs_visibility_limitless'));
} else {
$info->addProperty($this->lng->txt('rep_activation_access'), ilDatePresentation::formatPeriod(new ilDateTime($this->object->getActivationStart(), IL_CAL_UNIX), new ilDateTime($this->object->getActivationEnd(), IL_CAL_UNIX)));
}
switch ($this->object->getSubscriptionLimitationType()) {
case IL_CRS_SUBSCRIPTION_DEACTIVATED:
$txt = $this->lng->txt("crs_info_reg_deactivated");
break;
default:
switch ($this->object->getSubscriptionType()) {
case IL_CRS_SUBSCRIPTION_CONFIRMATION:
$txt = $this->lng->txt("crs_info_reg_confirmation");
//.........这里部分代码省略.........
示例8: fillInformations
/**
* fill informations
*
* @access protected
* @param
* @return
*/
protected function fillInformations()
{
if ($this->container->getImportantInformation()) {
$imp = new ilNonEditableValueGUI($this->lng->txt('crs_important_info'), "", true);
$value = nl2br(ilUtil::makeClickable($this->container->getImportantInformation(), true));
$imp->setValue($value);
$this->form->addItem($imp);
}
if ($this->container->getSyllabus()) {
$syl = new ilNonEditableValueGUI($this->lng->txt('crs_syllabus'), "", true);
$value = nl2br(ilUtil::makeClickable($this->container->getSyllabus(), true));
$syl->setValue($value);
$this->form->addItem($syl);
}
}
示例9: fillRow
/**
* Standard Version of Fill Row. Most likely to
* be overwritten by derived class.
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl;
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
// context
$obj_id = ilObject::_lookupObjId($a_set["ref_id"]);
$obj_type = ilObject::_lookupType($obj_id);
$obj_title = ilObject::_lookupTitle($obj_id);
// user
if ($a_set["user_id"] > 0) {
$this->tpl->setCurrentBlock("user_info");
if ($obj_type == "frm") {
include_once "./Modules/Forum/classes/class.ilForumProperties.php";
if (ilForumProperties::_isAnonymized($a_set["context_obj_id"])) {
if ($a_set["context_sub_obj_type"] == "pos" && $a_set["context_sub_obj_id"] > 0) {
include_once "./Modules/Forum/classes/class.ilForumPost.php";
$post = new ilForumPost($a_set["context_sub_obj_id"]);
if ($post->getUserAlias() != "") {
$this->tpl->setVariable("VAL_AUTHOR", ilUtil::stripSlashes($post->getUserAlias()));
} else {
$this->tpl->setVariable("VAL_AUTHOR", $lng->txt("forums_anonymous"));
}
} else {
$this->tpl->setVariable("VAL_AUTHOR", $lng->txt("forums_anonymous"));
}
} else {
if (ilObject::_exists($a_set["user_id"])) {
$user_obj = new ilObjUser($a_set["user_id"]);
$this->tpl->setVariable("VAL_AUTHOR", $user_obj->getLogin());
}
}
} else {
if (ilObject::_exists($a_set["user_id"])) {
$user_obj = new ilObjUser($a_set["user_id"]);
$this->tpl->setVariable("VAL_AUTHOR", $user_obj->getLogin());
}
}
$this->tpl->setVariable("TXT_AUTHOR", $lng->txt("author"));
$this->tpl->parseCurrentBlock();
}
// media player
if ($a_set["content_type"] == NEWS_AUDIO && $a_set["mob_id"] > 0 && ilObject::_exists($a_set["mob_id"])) {
include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
include_once "./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php";
$mob = new ilObjMediaObject($a_set["mob_id"]);
$med = $mob->getMediaItem("Standard");
$mpl = new ilMediaPlayerGUI();
$mpl->setFile(ilObjMediaObject::_getDirectory($a_set["mob_id"]) . "/" . $med->getLocation());
$this->tpl->setCurrentBlock("player");
$this->tpl->setVariable("PLAYER", $mpl->getMp3PlayerHtml());
$this->tpl->parseCurrentBlock();
}
// access
if ($enable_internal_rss) {
$this->tpl->setCurrentBlock("access");
include_once "./Services/Block/classes/class.ilBlockSetting.php";
$this->tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
if ($a_set["visibility"] == NEWS_PUBLIC || $a_set["priority"] == 0 && ilBlockSetting::_lookup("news", "public_notifications", 0, $obj_id)) {
$this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
} else {
$this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
}
$this->tpl->parseCurrentBlock();
}
// content
if ($a_set["content"] != "") {
$this->tpl->setCurrentBlock("content");
$this->tpl->setVariable("VAL_CONTENT", ilUtil::makeClickable($a_set["content"], true));
$this->tpl->parseCurrentBlock();
}
if ($a_set["content_long"] != "") {
$this->tpl->setCurrentBlock("long");
$this->tpl->setVariable("VAL_LONG_CONTENT", ilUtil::makeClickable($a_set["content_long"], true));
$this->tpl->parseCurrentBlock();
}
if ($a_set["update_date"] != $a_set["creation_date"]) {
$this->tpl->setCurrentBlock("ni_update");
$this->tpl->setVariable("TXT_LAST_UPDATE", $lng->txt("last_update"));
$this->tpl->setVariable("VAL_LAST_UPDATE", ilDatePresentation::formatDate(new ilDateTime($a_set["update_date"], IL_CAL_DATETIME)));
$this->tpl->parseCurrentBlock();
}
// forum hack, not nice
$add = "";
if ($obj_type == "frm" && $a_set["context_sub_obj_type"] == "pos" && $a_set["context_sub_obj_id"] > 0) {
include_once "./Modules/Forum/classes/class.ilObjForumAccess.php";
$pos = $a_set["context_sub_obj_id"];
$thread = ilObjForumAccess::_getThreadForPosting($pos);
if ($thread > 0) {
$add = "_" . $thread . "_" . $pos;
}
}
$url_target = "./goto.php?client_id=" . rawurlencode(CLIENT_ID) . "&target=" . $obj_type . "_" . $a_set["ref_id"] . $add;
$this->tpl->setCurrentBlock("context");
$cont_loc = new ilLocatorGUI();
$cont_loc->addContextItems($a_set["ref_id"], true);
//.........这里部分代码省略.........
示例10: infoScreen
/**
* show information screen
*/
function infoScreen()
{
global $rbacsystem, $ilUser, $ilSetting;
$this->tabs_gui->setTabActive('info_short');
if (!$rbacsystem->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);
if (strlen($this->object->getInformation())) {
$info->addSection($this->lng->txt('grp_general_informations'));
$info->addProperty($this->lng->txt('grp_information'), nl2br(ilUtil::makeClickable($this->object->getInformation(), true)));
}
$info->enablePrivateNotes();
$info->enableLearningProgress(true);
$info->addSection($this->lng->txt('group_registration'));
$info->showLDAPRoleGroupMappingInfo();
if (!$this->object->isRegistrationEnabled()) {
$info->addProperty($this->lng->txt('group_registration_mode'), $this->lng->txt('grp_reg_deac_info_screen'));
} else {
switch ($this->object->getRegistrationType()) {
case GRP_REGISTRATION_DIRECT:
$info->addProperty($this->lng->txt('group_registration_mode'), $this->lng->txt('grp_reg_direct_info_screen'));
break;
case GRP_REGISTRATION_REQUEST:
$info->addProperty($this->lng->txt('group_registration_mode'), $this->lng->txt('grp_reg_req_info_screen'));
break;
case GRP_REGISTRATION_PASSWORD:
$info->addProperty($this->lng->txt('group_registration_mode'), $this->lng->txt('grp_reg_passwd_info_screen'));
break;
}
/*
$info->addProperty($this->lng->txt('group_registration_time'),
ilDatePresentation::formatPeriod(
$this->object->getRegistrationStart(),
$this->object->getRegistrationEnd()));
*/
if ($this->object->isRegistrationUnlimited()) {
$info->addProperty($this->lng->txt('group_registration_time'), $this->lng->txt('grp_registration_unlimited'));
} elseif ($this->object->getRegistrationStart()->getUnixTime() < time()) {
$info->addProperty($this->lng->txt("group_registration_time"), $this->lng->txt('cal_until') . ' ' . ilDatePresentation::formatDate($this->object->getRegistrationEnd()));
} elseif ($this->object->getRegistrationStart()->getUnixTime() >= time()) {
$info->addProperty($this->lng->txt("group_registration_time"), $this->lng->txt('cal_from') . ' ' . ilDatePresentation::formatDate($this->object->getRegistrationStart()));
}
if ($this->object->isMembershipLimited()) {
$info->addProperty($this->lng->txt("mem_free_places"), max(0, $this->object->getMaxMembers() - $this->object->members_obj->getCountMembers()));
}
}
// Confirmation
include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
$privacy = ilPrivacySettings::_getInstance();
include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
if ($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) or $privacy->enabledGroupExport()) {
include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
$field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
$this->lng->loadLanguageModule('ps');
$info->addSection($this->lng->txt('grp_user_agreement_info'));
$info->addProperty($this->lng->txt('ps_export_data'), $field_info->exportableFieldsToInfoString());
if ($fields = ilCourseDefinedFieldDefinition::_fieldsToInfoString($this->object->getId())) {
$info->addProperty($this->lng->txt('ps_grp_user_fields'), $fields);
}
}
// forward the command
$this->ctrl->forwardCommand($info);
}
示例11: 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"]);
//.........这里部分代码省略.........
示例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 == "") {
//.........这里部分代码省略.........