本文整理汇总了PHP中ilObjUser::getPublicName方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::getPublicName方法的具体用法?PHP ilObjUser::getPublicName怎么用?PHP ilObjUser::getPublicName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::getPublicName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setCreatedByData
/**
* @param arDisplayField $field
* @param $value
*
* @return string
*/
protected function setCreatedByData(arDisplayField $field, $value)
{
$user = new ilObjUser($value);
return $user->getPublicName();
}
示例2: setArCreatedByField
/**
* @param arIndexTableField $field
* @param $item
* @param $value
*
* @return string
*/
protected function setArCreatedByField(arIndexTableField $field, $item, $value)
{
$user = new ilObjUser($value);
return $user->getPublicName();
}
示例3: addObjectSections
/**
* add standard object section
*/
function addObjectSections()
{
global $lng, $ilCtrl, $ilUser, $ilAccess, $tree, $ilSetting, $ilObjDataCache;
$this->addSection($lng->txt("additional_info"));
$a_obj = $this->gui_object->object;
// links to the object
if (is_object($a_obj)) {
// permanent link
$type = $a_obj->getType();
$ref_id = $a_obj->getRefId();
if ($ref_id) {
include_once './Services/Link/classes/class.ilLink.php';
$href = ilLink::_getStaticLink($ref_id, $type, true);
include_once 'Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
if (ilECSServerSettings::getInstance()->activeServerExists()) {
$this->addProperty($lng->txt("object_id"), $a_obj->getId());
}
include_once 'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php';
$pm = new ilPermanentLinkGUI($type, $ref_id);
$pm->setIncludePermanentLinkText(false);
$pm->setAlignCenter(false);
$this->addProperty($lng->txt("perma_link"), $pm->getHTML(), "");
// bookmarks
$title = $ilObjDataCache->lookupTitle($a_obj->getId());
$bms = ilPermanentLinkGUI::_getBookmarksSelectionList($title, $href);
// links to resource
if ($ilAccess->checkAccess("write", "", $ref_id) || $ilAccess->checkAccess("edit_permissions", "", $ref_id)) {
$obj_id = $a_obj->getId();
$rs = ilObject::_getAllReferences($obj_id);
$refs = array();
foreach ($rs as $r) {
if ($tree->isInTree($r)) {
$refs[] = $r;
}
}
if (count($refs) > 1) {
$links = $sep = "";
foreach ($refs as $r) {
$cont_loc = new ilLocatorGUI();
$cont_loc->addContextItems($r, true);
$links .= $sep . $cont_loc->getHTML();
$sep = "<br />";
}
$this->addProperty($lng->txt("res_links"), '<div class="small">' . $links . '</div>');
}
}
}
}
// creation date
$this->addProperty($lng->txt("create_date"), ilDatePresentation::formatDate(new ilDateTime($a_obj->getCreateDate(), IL_CAL_DATETIME)));
// owner
if ($ilUser->getId() != ANONYMOUS_USER_ID and $a_obj->getOwner()) {
include_once './Services/Object/classes/class.ilObjectFactory.php';
include_once './Services/User/classes/class.ilObjUser.php';
if (ilObjUser::userExists(array($a_obj->getOwner()))) {
$ownerObj = ilObjectFactory::getInstanceByObjId($a_obj->getOwner(), false);
} else {
$ownerObj = ilObjectFactory::getInstanceByObjId(6, false);
}
if (!is_object($ownerObj) || $ownerObj->getType() != "usr") {
$this->addProperty($lng->txt("owner"), $lng->txt("no_owner"));
} else {
if ($ownerObj->hasPublicProfile()) {
$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "user_id", $ownerObj->getId());
$this->addProperty($lng->txt("owner"), $ownerObj->getPublicName(), $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
} else {
$this->addProperty($lng->txt("owner"), $ownerObj->getPublicName());
}
}
}
// disk usage
require_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
if ($ilUser->getId() != ANONYMOUS_USER_ID && ilDiskQuotaActivationChecker::_isActive()) {
$size = $a_obj->getDiskUsage();
if ($size !== null) {
$this->addProperty($lng->txt("disk_usage"), ilFormat::formatSize($size, 'long'));
}
}
// change event
require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
if (ilChangeEvent::_isActive()) {
if ($ilUser->getId() != ANONYMOUS_USER_ID) {
$readEvents = ilChangeEvent::_lookupReadEvents($a_obj->getId());
$count_users = 0;
$count_members = 0;
$count_user_reads = 0;
$count_anonymous_reads = 0;
foreach ($readEvents as $evt) {
if ($evt['usr_id'] == ANONYMOUS_USER_ID) {
$count_anonymous_reads += $evt['read_count'];
} else {
$count_user_reads += $evt['read_count'];
$count_users++;
/* to do: if ($evt['user_id'] is member of $this->getRefId())
{
$count_members++;
}*/
//.........这里部分代码省略.........
示例4: buildFullname
/**
* Returns users first & lastname
*
* @return string
*/
public function buildFullname()
{
return $this->user->getPublicName();
}