-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patht3_species_glossary.module
executable file
·50 lines (45 loc) · 1.84 KB
/
t3_species_glossary.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* @file
* Code for the t3_species_glossary feature.
*/
include_once 't3_species_glossary.features.inc';
// include_once 'theme/views-view-table--t3_species_glossary.tpl.php';
/**
* Implements hok_theme_registry_alter()
*/
/* function t3_species_glossary_theme_registry_alter(&$theme_registry) {
// Defined path to the current module.
$module_path = drupal_get_path('module', 't3_species_glossary');
// Find all .tpl.php files in this module's folder recursively.
$template_file_objects = drupal_find_theme_templates($theme_registry, '.tpl.php', $module_path);
// Iterate through all found template file objects.
foreach ($template_file_objects as $key => $template_file_object) {
// If the template has not already been overridden by a theme.
if (!isset($theme_registry[$key]['theme path']) || !preg_match('#/themes/#', $theme_registry[$key]['theme path'])) {
// Alter the theme path and template elements.
$theme_registry[$key]['theme path'] = $module_path;
$theme_registry[$key] = array_merge($theme_registry[$key], $template_file_object);
$theme_registry[$key]['type'] = 'module';
}
}
} */
/**
* Implements of hook_update_N().
*/
function t3_species_glossary_update_7001() {
// Load the view by its machine name
$view = views_get_view('t3_species_glossary');
if ($view) {
// We have a view, let's get the $handler for it.
$handler = &$view->display['default'];
if ($handler) {
// Add Species to the Sort criterion.
$handler->display_options['sorts']['taxrank__species']['id'] = 'taxrank__species';
$handler->display_options['sorts']['taxrank__species']['table'] = 'OBI__0100026';
$handler->display_options['sorts']['taxrank__species']['field'] = 'taxrank__species';
}
// Save the changes to the view
views_save_view($view);
}
}