function theme_filedepot_files in filedepot 7
Same name and namespace in other branches
- 6 filedepot.module \theme_filedepot_files()
Theme function that is used when displaying the files via the native Drupal node view.
1 theme call to theme_filedepot_files()
- filedepot_view in ./
filedepot.module - Implementation of hook_view().
File
- ./
filedepot.module, line 1964 - filedepot.module Filedepot: File Management Module developed by Nextide www.nextide.ca Full featured document managment module with a desktop application feel. Integrated Organic Group, Role and User permissions to secure folders, automated…
Code
function theme_filedepot_files($node) {
$filedepot = filedepot_filedepot();
$layout_url = base_path() . drupal_get_path('module', 'filedepot');
$retval = '';
$cid = db_query("SELECT cid FROM {filedepot_categories} WHERE nid=:nid", array(
':nid' => $node->nid,
))
->fetchField();
if ($cid > 0) {
$retval = theme('filedepot_native_filelisting_header');
$query = db_query("SELECT fid,fname,extension as ext FROM {filedepot_files} WHERE cid=:cid", array(
':cid' => $cid,
));
while ($A = $query
->fetchAssoc()) {
if (array_key_exists($A['ext'], $filedepot->iconmap)) {
$icon = $filedepot->iconmap[$A['ext']];
}
else {
$ext_parts = explode(".", $A['fname']);
$ext = end($ext_parts);
if (array_key_exists($ext, $filedepot->iconmap)) {
$icon = $filedepot->iconmap[$ext];
}
else {
$icon = $filedepot->iconmap['default'];
}
}
$icon = "{$layout_url}/css/images/{$icon}";
$filelink = l($A['fname'], "filedepot_download/{$node->nid}/{$A['fid']}", array(
'attributes' => array(
'title' => t('Download File'),
),
));
$retval .= theme('filedepot_native_filerecord', array(
'icon' => $icon,
'fileline' => $filelink,
));
}
}
return $retval;
}