function tft_archive_access in Taxonomy File Tree 7.2
Access callback: custom access callback when checking if a user can archive files.
Parameters
int $file_nid:
object $account = NULL:
Return value
bool
1 string reference to 'tft_archive_access'
- tft_archive_menu in modules/
tft_archive/ tft_archive.module - Implements hook_menu().
File
- modules/
tft_archive/ tft_archive.module, line 154 - Hook implementation and logic.
Code
function tft_archive_access($file_nid, $account = NULL) {
$tid = db_query("SELECT DISTINCT(tn.tid) FROM {node_revision} v\n LEFT JOIN {node} n ON n.vid = v.vid\n LEFT JOIN {taxonomy_index} tn ON tn.nid = n.nid\n WHERE n.nid = :nid AND n.status = 1", array(
':nid' => $file_nid,
))
->fetchField();
return tft_term_access($tid, $account, 'archive');
}