本文整理汇总了PHP中ilUserUtil::getNamePresentation方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUserUtil::getNamePresentation方法的具体用法?PHP ilUserUtil::getNamePresentation怎么用?PHP ilUserUtil::getNamePresentation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUserUtil
的用法示例。
在下文中一共展示了ilUserUtil::getNamePresentation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
/**
* Send notifications
* @return
*/
public function send()
{
global $ilUser;
switch ($this->getType()) {
case self::TYPE_USER_BLOCKED:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cont_user_blocked'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('cont_user_blocked2'));
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('cont_user_blocked3') . " '" . $this->getLanguageText('objs_qst') . "' > '" . $this->getLanguageText('cont_blocked_users') . "'");
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('obj_lm') . ": " . $this->getObjectTitle(true));
$this->appendBody("\n");
include_once "./Services/User/classes/class.ilUserUtil.php";
$this->appendBody($this->getLanguageText('user') . ": " . ilUserUtil::getNamePresentation($ilUser->getId(), false, false, ""));
$this->appendBody("\n");
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$this->appendBody($this->getLanguageText('question') . ": " . assQuestion::_getTitle($this->getQuestionId()));
$this->appendBody("\n");
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('cont_lm_mail_permanent_link'));
$this->appendBody("\n");
$this->appendBody($this->createPermanentLink(array(), ""));
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
break;
}
return true;
}
示例2: fillRow
/**
* Fill table row
*/
protected function fillRow($file)
{
global $lng;
$this->tpl->setVariable("FILE_ID", $file["returned_id"]);
$this->tpl->setVariable("DELIVERED_FILE", $file["filetitle"]);
$date = new ilDateTime($file['timestamp14'], IL_CAL_TIMESTAMP);
$this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
if ($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
$this->tpl->setVariable("DELIVERED_OWNER", ilUserUtil::getNamePresentation($file["owner_id"]));
}
}
示例3: fillRow
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: fillRow
/**
* Standard Version of Fill Row. Most likely to
* be overwritten by derived class.
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl;
include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
$title = ilWikiPage::lookupTitle($a_set["id"]);
$this->tpl->setVariable("TXT_PAGE_TITLE", $title);
$this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDateTime($a_set["date"], IL_CAL_DATETIME)));
$ilCtrl->setParameterByClass("ilwikipagegui", "page", rawurlencode($title));
$ilCtrl->setParameterByClass("ilwikipagegui", "old_nr", $a_set["nr"]);
$this->tpl->setVariable("HREF_PAGE", $ilCtrl->getLinkTargetByClass("ilwikipagegui", "preview"));
// user name
include_once "./Services/User/classes/class.ilUserUtil.php";
$this->tpl->setVariable("TXT_USER", ilUserUtil::getNamePresentation($a_set["user"], true, true, $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd())));
}
示例5: confirmRemove
function confirmRemove()
{
global $ilAccess, $ilCtrl, $lng, $tpl;
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($ilCtrl->getFormAction($this, 'remove'));
$confirm->addHiddenItem("grp_id", $_GET["grp_id"]);
$confirm->setHeaderText($lng->txt('grp_dismiss_member'));
$confirm->setConfirm($lng->txt('confirm'), 'remove');
$confirm->setCancel($lng->txt('cancel'), 'show');
include_once './Services/User/classes/class.ilUserUtil.php';
$confirm->addItem('usr_id', $_GET["usr_id"], ilUserUtil::getNamePresentation($_GET["usr_id"], false, false, "", true), ilUtil::getImagePath('icon_usr.svg'));
$tpl->setContent($confirm->getHTML());
}
示例6: translateUserIds
protected function translateUserIds($a_user_ids, $a_implode = false)
{
if (!is_array($a_user_ids) && is_numeric($a_user_ids)) {
$a_user_ids = array($a_user_ids);
}
$res = array();
include_once "Services/User/classes/class.ilUserUtil.php";
foreach (array_unique($a_user_ids) as $user_id) {
$res[] = ilUserUtil::getNamePresentation($user_id);
}
if ($a_implode) {
$res = implode("<br />", $res);
}
return $res;
}
示例7: fillRow
/**
* Standard Version of Fill Row. Most likely to
* be overwritten by derived class.
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl, $ilAccess;
// rollback command
if ($a_set["nr"] > 0) {
$ilCtrl->setParameter($this->getParentObject(), "old_nr", $a_set["nr"]);
$this->tpl->setCurrentBlock("command");
$this->tpl->setVariable("TXT_COMMAND", $lng->txt("cont_rollback"));
$this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTarget($this->getParentObject(), "rollbackConfirmation"));
$this->tpl->parseCurrentBlock();
$ilCtrl->setParameter($this->getParentObject(), "old_nr", "");
}
if (!$this->rselect) {
$this->tpl->setVariable("RSELECT", 'checked="checked"');
$this->rselect = true;
} else {
if (!$this->lselect) {
$this->tpl->setVariable("LSELECT", 'checked="checked"');
$this->lselect = true;
}
}
$this->tpl->setVariable("NR", $a_set["nr"]);
$this->tpl->setVariable("TXT_HDATE", ilDatePresentation::formatDate(new ilDateTime($a_set["hdate"], IL_CAL_DATETIME)));
$ilCtrl->setParameter($this->getParentObject(), "old_nr", $a_set["nr"]);
$ilCtrl->setParameter($this->getParentObject(), "history_mode", "1");
$this->tpl->setVariable("HREF_OLD_PAGE", $ilCtrl->getLinkTarget($this->getParentObject(), "preview"));
$ilCtrl->setParameter($this->getParentObject(), "history_mode", "");
if (ilObject::_exists($a_set["user"])) {
// user name
$user = ilObjUser::_lookupName($a_set["user"]);
$login = ilObjUser::_lookupLogin($a_set["user"]);
//$this->tpl->setVariable("TXT_LINKED_USER",
// $user["lastname"].", ".$user["firstname"]." [".$login."]");
// profile link
include_once "./Services/User/classes/class.ilUserUtil.php";
$name_pres = ilUserUtil::getNamePresentation($a_set["user"], true, true, $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd()));
//$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "user", $a_set["user"]);
//$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "back_url",
// rawurlencode($ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd())));
//$this->tpl->setVariable("USER_LINK",
// $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
//$img = ilObjUser::_getPersonalPicturePath($a_set["user"], "xxsmall");
//$this->tpl->setVariable("IMG_USER", $img);
$this->tpl->setVariable("TXT_USER", $name_pres);
}
$ilCtrl->setParameter($this->getParentObject(), "old_nr", "");
}
示例8: getItems
/**
* Get all completed tests
*/
protected function getItems()
{
if ($this->mode == self::MODE_ADD) {
$assigned = $this->assignment->getMembersOfAllTeams();
} else {
$assigned = array();
$this->member_ids = $this->assignment->getTeamMembers($this->team_id);
}
include_once "Services/User/classes/class.ilUserUtil.php";
$data = array();
foreach ($this->member_ids as $id) {
if (!in_array($id, $assigned)) {
$data[] = array("id" => $id, "name" => ilUserUtil::getNamePresentation($id, false, false, "", true));
}
}
$this->setData($data);
}
示例9: fillRow
/**
* Fill a single data row.
*/
protected function fillRow($a_set)
{
$this->tpl->setVariable("TXT_USER", ilUserUtil::getNamePresentation($a_set["user_id"], false, false));
$this->tpl->setVariable('TXT_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set["date"], IL_CAL_DATETIME)));
$this->tpl->setVariable("TXT_ACTION", $this->createInfoText($a_set));
if ($this->getObjType() == "lm" || $this->getObjType() == "dbk") {
$obj_arr = explode(":", $a_set["obj_type"]);
switch ($obj_arr[1]) {
case "st":
$img_type = "st";
$class = "ilstructureobjectgui";
$cmd = "view";
break;
case "pg":
$img_type = "pg";
$class = "illmpageobjectgui";
$cmd = "edit";
break;
default:
$img_type = $obj_arr[0];
$class = "";
$cmd = "view";
break;
}
$this->tpl->setCurrentBlock("item_icon");
$this->tpl->setVariable("SRC_ICON", ilUtil::getImagePath("icon_" . $img_type . ".svg"));
$this->tpl->parseCurrentBlock();
if ($class != "") {
$this->tpl->setCurrentBlock("item_link");
$this->ilCtrl->setParameterByClass($class, "obj_id", $a_set["obj_id"]);
$this->tpl->setVariable("HREF_LINK", $this->ilCtrl->getLinkTargetByClass($class, $cmd));
$this->tpl->setVariable("TXT_LINK", $a_set["title"]);
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock("item_title");
$this->tpl->setVariable("TXT_TITLE", ilObject::_lookupTitle($a_set["obj_id"]));
$this->tpl->parseCurrentBlock();
}
}
if ($this->isCommentVisible() && $a_set["user_comment"] != "") {
$this->tpl->setCurrentBlock("user_comment");
$this->tpl->setVariable("TXT_COMMENT", $this->lng->txt("comment"));
$this->tpl->setVariable("TXT_USER_COMMENT", $a_set["user_comment"]);
$this->tpl->parseCurrentBlock();
}
}
示例10: __construct
/**
* Constructor
*
* @access public
* @param
* @return
*/
public function __construct($a_parent_obj, $a_parent_cmd, $a_raters_mode = false, $a_may_delete_rater = false, $a_fallback_url = null)
{
parent::__construct($a_parent_obj, $a_parent_cmd);
global $lng, $ilCtrl;
$this->raters_mode = (bool) $a_raters_mode;
$this->fallback_url = trim($a_fallback_url);
$this->lng = $lng;
$this->ctrl = $ilCtrl;
$this->setFormName('apprform');
$this->addColumn('', '', '1%');
$this->addColumn($this->lng->txt("lastname"), 'lastname', '');
$this->addColumn($this->lng->txt("firstname"), 'firstname', '');
$this->addColumn($this->lng->txt("email"), 'email', '');
$this->addColumn($this->lng->txt("login"), 'login', '');
if (!$this->raters_mode) {
$this->addColumn($this->lng->txt("survey_360_raters_finished"), "finished");
$this->addColumn($this->lng->txt("survey_360_appraisee_close_table"), "closed");
$this->addColumn($this->lng->txt("actions"));
$this->setTitle($this->lng->txt("survey_360_appraisees"));
} else {
$this->addColumn($this->lng->txt("survey_360_rater_finished"), "finished");
$this->addColumn($this->lng->txt("survey_code_url"));
$this->addColumn($this->lng->txt("survey_360_rater_mail_sent"), "sent");
include_once "Services/User/classes/class.ilUserUtil.php";
$this->setTitle($this->lng->txt("survey_360_edit_raters") . " : " . ilUserUtil::getNamePresentation($_REQUEST["appr_id"]));
}
$this->setRowTemplate("tpl.il_svy_svy_appraisees_row.html", "Modules/Survey");
$this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
$this->setDefaultOrderField("last_name");
$this->setDefaultOrderDirection("asc");
if (!$this->raters_mode) {
$this->addCommandButton('deleteAllUserData', $this->lng->txt('svy_delete_all_user_data'));
$this->addMultiCommand('confirmAdminAppraiseesClose', $this->lng->txt('survey_360_appraisee_close_action'));
$this->addMultiCommand('confirmDeleteAppraisees', $this->lng->txt('survey_360_remove_appraisees'));
$this->setPrefix('appr_id');
$this->setSelectAllCheckbox('appr_id');
} else {
$this->addMultiCommand('mailRaters', $this->lng->txt('mail'));
if ($a_may_delete_rater) {
$this->addMultiCommand('confirmDeleteRaters', $this->lng->txt('remove'));
}
$this->setPrefix('rtr_id');
$this->setSelectAllCheckbox('rtr_id');
}
}
示例11: getItems
/**
* Get all completed tests
*/
protected function getItems()
{
global $rbacreview;
if ($this->contributor_ids) {
$assigned = $rbacreview->assignedUsers($this->contributor_role_id);
} else {
$assigned = array();
$this->contributor_ids = $rbacreview->assignedUsers($this->contributor_role_id);
}
include_once "Services/User/classes/class.ilUserUtil.php";
$data = array();
foreach ($this->contributor_ids as $id) {
if (!in_array($id, $assigned)) {
$data[] = array("id" => $id, "name" => ilUserUtil::getNamePresentation($id, false, false, "", true));
}
}
$this->setData($data);
}
示例12: importData
/**
* Import data from DB
*/
protected function importData()
{
include_once "./Services/User/classes/class.ilUserUtil.php";
$data = array();
foreach ($this->handler->getPermissions($this->node_id) as $obj_id) {
// title is needed for proper sorting
// special modes should always be on top!
$title = null;
switch ($obj_id) {
case ilWorkspaceAccessGUI::PERMISSION_REGISTERED:
$caption = $this->lng->txt("wsp_set_permission_registered");
$title = "0" . $caption;
break;
case ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD:
$caption = $this->lng->txt("wsp_set_permission_all_password");
$title = "0" . $caption;
break;
case ilWorkspaceAccessGUI::PERMISSION_ALL:
$caption = $this->lng->txt("wsp_set_permission_all");
$title = "0" . $caption;
break;
default:
$type = ilObject::_lookupType($obj_id);
$type_txt = $this->lng->txt("obj_" . $type);
if ($type === null) {
// invalid object/user
} else {
if ($type != "usr") {
$title = $caption = ilObject::_lookupTitle($obj_id);
} else {
$caption = ilUserUtil::getNamePresentation($obj_id, false, true);
$title = strip_tags($caption);
}
}
break;
}
if ($title) {
$data[] = array("id" => $obj_id, "title" => $title, "caption" => $caption, "type" => $type_txt);
}
}
$this->setData($data);
}
示例13: importData
/**
* Import data from DB
*/
protected function importData()
{
include_once "./Services/User/classes/class.ilUserUtil.php";
$data = array();
foreach ($this->handler->getPermissions($this->node_id) as $obj_id) {
switch ($obj_id) {
case ilWorkspaceAccessGUI::PERMISSION_REGISTERED:
$title = $icon_alt = $this->lng->txt("wsp_set_permission_registered");
$type = "registered";
$icon = "";
break;
case ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD:
$title = $icon_alt = $this->lng->txt("wsp_set_permission_all_password");
$type = "all_password";
$icon = "";
break;
case ilWorkspaceAccessGUI::PERMISSION_ALL:
$title = $icon_alt = $this->lng->txt("wsp_set_permission_all");
$type = "all_password";
$icon = "";
break;
default:
$type = ilObject::_lookupType($obj_id);
$icon = ilUtil::getTypeIconPath($type, null, "tiny");
$icon_alt = $this->lng->txt("obj_" . $type);
if ($type != "usr") {
$title = ilObject::_lookupTitle($obj_id);
} else {
$title = ilUserUtil::getNamePresentation($obj_id, true, true);
}
break;
}
$data[] = array("id" => $obj_id, "title" => $title, "type" => $type, "icon" => $icon, "icon_alt" => $icon_alt);
}
$this->setData($data);
}
示例14: postOutputProcessing
/**
* Finalizing output processing
*
* @param string $a_output
* @return string
*/
function postOutputProcessing($a_output)
{
// #8626/#9370
if (($this->getOutputMode() == "preview" || $this->getOutputMode() == "offline") && !$this->getAbstractOnly() && $this->add_date) {
if (!$this->isInWorkspace()) {
$author = "";
$author_id = $this->getBlogPosting()->getAuthor();
if ($author_id) {
include_once "Services/User/classes/class.ilUserUtil.php";
$author = ilUserUtil::getNamePresentation($author_id) . " - ";
}
}
// prepend creation date
$rel = ilDatePresentation::useRelativeDates();
ilDatePresentation::setUseRelativeDates(false);
$prefix = "<div class=\"il_BlockInfo\" style=\"text-align:right\">" . $author . ilDatePresentation::formatDate($this->getBlogPosting()->getCreated()) . "</div>";
ilDatePresentation::setUseRelativeDates($rel);
$a_output = $prefix . $a_output;
}
return $a_output;
}
示例15: renderTitle
function renderTitle()
{
global $tpl, $ilTabs, $lng;
$tpl->resetHeaderBlock();
include_once "./Services/User/classes/class.ilUserUtil.php";
$tpl->setTitle(ilUserUtil::getNamePresentation($this->getUserId()));
$tpl->setTitleIcon(ilObjUser::_getPersonalPicturePath($this->getUserId(), "xxsmall"));
$back = $this->getBackUrl() != "" ? $this->getBackUrl() : $_GET["back_url"];
if ($back != "") {
$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt("back"), $back);
}
}