本文整理汇总了PHP中thebuggenie\core\framework\Settings::getUserDisplaynameFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::getUserDisplaynameFormat方法的具体用法?PHP Settings::getUserDisplaynameFormat怎么用?PHP Settings::getUserDisplaynameFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\framework\Settings
的用法示例。
在下文中一共展示了Settings::getUserDisplaynameFormat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNameWithUsername
/**
* Retrieve this users realname and username combined
*
* @return string "Real Name (username)"
*/
public function getNameWithUsername()
{
if ($this->isDeleted()) {
return __('No such user');
}
if ($this->isOpenIdLocked()) {
return $this->_buddyname;
}
switch (framework\Settings::getUserDisplaynameFormat()) {
case framework\Settings::USER_DISPLAYNAME_FORMAT_REALNAME:
return $this->_realname ? $this->_realname . ' (' . $this->_username . ')' : $this->_username;
case framework\Settings::USER_DISPLAYNAME_FORMAT_BUDDY:
default:
return $this->_buddyname ? $this->_buddyname . ' (' . $this->_username . ')' : ($this->_realname ? $this->_realname . ' (' . $this->_username . ')' : $this->_username);
}
}
示例2: __
disabled<?php
}
?>
>
<option value=1<?php
if (\thebuggenie\core\framework\Settings::getUserDisplaynameFormat() == 1) {
?>
selected<?php
}
?>
><?php
echo __('Use user\'s real name instead of buddy name');
?>
</option>
<option value=0<?php
if (\thebuggenie\core\framework\Settings::getUserDisplaynameFormat() == 0) {
?>
selected<?php
}
?>
><?php
echo __('Prefer buddy name instead of real name.');
?>
</option>
</select>
<?php
echo config_explanation(__('Change here how user\'s name is displayed.'));
?>
</td>
</tr>
<tr>