function filedepot_add_views_templates in filedepot 7
Same name and namespace in other branches
- 6 filedepot.module \filedepot_add_views_templates()
1 call to filedepot_add_views_templates()
- filedepot_theme in ./
filedepot.module - Implementation of hook_theme().
File
- ./
filedepot.module, line 109 - 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 filedepot_add_views_templates() {
$templates_path = drupal_get_path('module', 'filedepot') . '/views';
$templates = array();
//$views_templates_types = views_theme();
$files = file_scan_directory($templates_path, '/^views.*\\.tpl\\.php$/');
foreach ($files as $file) {
$template_name = str_replace('.tpl.php', '', $file->filename);
$template_info = explode('--', $template_name);
$views_hook = str_replace('-', '_', $template_info[0]);
$file_path = str_replace('/' . $file->filename, '', $file->uri);
$templates[str_replace('-', '_', $template_name)] = array(
//'arguments' => $views_templates_types[$views_hook]['arguments'],
'path' => $file_path,
'template' => $template_name,
'original hook' => $views_hook,
'preprocess functions' => array(
'template_preprocess',
'template_preprocess_' . $views_hook,
),
);
}
return $templates;
}