function _me_get_me_alias in me aliases 6.2
Same name and namespace in other branches
- 8 me.module \_me_get_me_alias()
- 6 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.
5 calls to _me_get_me_alias()
- me_me_uid_ctools_arguments in plugins/
me_uid.inc - Implementation of CTools hook_ctools_arguments().
- me_plugin_argument_validate_me_alias::validate_form in includes/
me_plugin_argument_validate_me_alias.inc - Provides a form of options for our validator.
- me_to_arg in ./
me.module - Menu to_arg function for %me.
- me_user in ./
me.module - Implementation of hook_user().
- _me_is_alias in ./
me.module - A helper function to check if a string is equal to the 'me' alias.
File
- ./
me.module, line 510 - 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;
}