1 token_example.module | _token_example_get_file() |
Builds a list of available files.
Related topics
File
- modules/
examples/ token_example/ token_example.module, line 199 - Hook implementations for the Token Example module.
Code
function _token_example_get_file() {
$file_query = db_select('file_managed', 'f');
$file_query->fields('f', array('fid', 'filename'));
$file_query->range(0, 10);
$files = $file_query->execute()->fetchAllKeyed();
$files = array_map('check_plain', $files);
return $files;
}