function elfinder_parse_path_tokens in elFinder file manager 6
Same name and namespace in other branches
- 8.2 elfinder.module \elfinder_parse_path_tokens()
- 6.2 elfinder.module \elfinder_parse_path_tokens()
- 7.3 elfinder.module \elfinder_parse_path_tokens()
- 7 elfinder.module \elfinder_parse_path_tokens()
- 7.2 elfinder.module \elfinder_parse_path_tokens()
replace path tokens to its values (%uid, %user, etc)
3 calls to elfinder_parse_path_tokens()
- elfinder_admin_form_validate in inc/
elfinder.admin.inc - Validate form data
- elfinder_file_directory_path in ./
elfinder.module - path to files directory
- elfinder_file_directory_url in ./
elfinder.module - files directory url
File
- ./
elfinder.module, line 638
Code
function elfinder_parse_path_tokens($unparsed_path) {
global $user, $language;
$path = $unparsed_path;
$uname = isset($user->name) ? preg_replace('/[[:^alnum:]]+/', '', $user->name) : '';
$langCode = isset($language->language) ? $language->language : 'en';
$path_tokens = array(
'%uid' => $user->uid,
'%name' => $uname,
'%files' => elfinder_default_directory_path(),
'%lang' => $langCode,
);
$path = strtr($path, $path_tokens);
if (function_exists('token_replace')) {
$path = token_replace($path, 'global', NULL, '%', '');
}
return $path;
}