本文整理匯總了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>