本文整理汇总了PHP中ilUserUtil::getProfileLink方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUserUtil::getProfileLink方法的具体用法?PHP ilUserUtil::getProfileLink怎么用?PHP ilUserUtil::getProfileLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUserUtil
的用法示例。
在下文中一共展示了ilUserUtil::getProfileLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fillRow
/**
* Fill table row
*/
protected function fillRow($a_set)
{
global $ilCtrl, $lng;
$this->tpl->setVariable("VAL_ID", $a_set["usr_id"]);
if ($this->getType() == self::TYPE_GLOBAL_SEARCH) {
include_once './Services/User/classes/class.ilUserUtil.php';
$link = ilUserUtil::getProfileLink($a_set['usr_id']);
if ($link) {
$this->tpl->setVariable('IMG_LINKED_TO_PROFILE', $link);
$this->tpl->setVariable('USR_IMG_SRC_LINKED', ilObjUser::_getPersonalPicturePath($a_set['usr_id'], 'xsmall'));
} else {
$this->tpl->setVariable('USR_IMG_SRC', ilObjUser::_getPersonalPicturePath($a_set['usr_id'], 'xsmall'));
}
}
foreach ($this->getSelectedColumns() as $field) {
switch ($field) {
case 'gender':
$a_set['gender'] = $a_set['gender'] ? $this->lng->txt('gender_' . $a_set['gender']) : '';
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('VAL_CUST', $a_set[$field]);
$this->tpl->parseCurrentBlock();
break;
case 'birthday':
$a_set['birthday'] = $a_set['birthday'] ? ilDatePresentation::formatDate(new ilDate($a_set['birthday'], IL_CAL_DATE)) : $this->lng->txt('no_date');
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('VAL_CUST', $a_set[$field]);
$this->tpl->parseCurrentBlock();
break;
case 'access_until':
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('CUST_CLASS', ' ' . $a_set['access_class']);
$this->tpl->setVariable('VAL_CUST', $a_set[$field]);
$this->tpl->parseCurrentBlock();
break;
case 'last_login':
$a_set['last_login'] = $a_set['last_login'] ? ilDatePresentation::formatDate(new ilDateTime($a_set['last_login'], IL_CAL_DATETIME)) : $this->lng->txt('no_date');
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('VAL_CUST', $a_set[$field]);
$this->tpl->parseCurrentBlock();
break;
case 'login':
if ($this->admin_mode) {
$ilCtrl->setParameterByClass("ilobjusergui", "ref_id", "7");
$ilCtrl->setParameterByClass("ilobjusergui", "obj_id", $a_set["usr_id"]);
$ilCtrl->setParameterByClass("ilobjusergui", "search", "1");
$link = $ilCtrl->getLinkTargetByClass(array("iladministrationgui", "ilobjusergui"), "view");
$a_set[$field] = "<a href=\"" . $link . "\">" . $a_set[$field] . "</a>";
}
// fallthrough
// fallthrough
default:
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('VAL_CUST', (string) ($a_set[$field] ? $a_set[$field] : ''));
$this->tpl->parseCurrentBlock();
break;
}
}
if ($this->getType() == self::TYPE_GLOBAL_SEARCH) {
$this->tpl->setVariable('SEARCH_RELEVANCE', $this->getRelevanceHTML($a_set['relevance']));
}
}