function imce_dir_man_path in IMCE Tools 7
Same name and namespace in other branches
- 6 imce_dir_man/imce_dir_man.module \imce_dir_man_path()
returns an array representing a user's currently accessible file directories used by the imce uploader If a user has not been restricted in the configuration, . (all directories) is returned
File
- imce_dir_man/
imce_dir_man.module, line 165 - imce_dir_man.module provides functions for managing configuration determining what the imce_dir_man_path() function. This function can be used as php code in the directory setting of an IMCE profile to allow for per user configuration of directory…
Code
function imce_dir_man_path() {
global $user;
$dir = db_select('imce_dir_man', 'i')
->fields('i', array(
'dir',
))
->condition('uid', $user->uid)
->execute()
->fetchCol();
if (!$dir || !$dir[0]) {
$dir[0] = '.';
}
return preg_split('/,/', $dir[0]);
}