function _me_get_me_alias in me aliases 6
Same name and namespace in other branches
- 8 me.module \_me_get_me_alias()
- 6.2 me.module \_me_get_me_alias()
- 7 me.module \_me_get_me_alias()
Helper function to return the me alias.
Parameters
$print_name: Shows a friendly print name of the alias instead of the actual alias itself. This argument is only checked if the token module is installed.
Return value
string The me alias, token replaced if appropriate.
3 calls to _me_get_me_alias()
File
- ./
me.module, line 462 - Provides 'me' aliases to allow users to enter 'me' in common paths instead of their user id.
Code
function _me_get_me_alias($print = FALSE) {
$alias = me_variable_get('me_alias');
// Replace with any global tokens that might have been used in the alias.
if (module_exists('token')) {
$replaced_alias = token_replace($alias, 'global');
// They will not match if a replacement happened.
if ($print && $replaced_alias != $alias) {
$alias = ucwords(str_replace(array(
'-',
'[',
']',
), array(
' ',
'',
), $alias));
}
else {
$alias = $replaced_alias;
}
}
return $alias;
}