/[drupal]/contributions/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.install
ViewVC logotype

Contents of /contributions/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.7 - (show annotations) (download) (as text)
Thu Mar 12 18:51:39 2009 UTC (8 months, 1 week ago) by mgn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +12 -1 lines
File MIME type: text/x-php
#359319: by stevenghines, radj and MGN: new feature provides option to append
node title at end of breadcrumb trail.
#395082 by kndr and MGN: correctly set weight of taxonomy_breadcrumb module to be greater than the taxonomy module.
1 <?php
2 // $Id: taxonomy_breadcrumb.install,v 1.6 2009/01/12 02:19:26 mgn Exp $
3
4 /**
5 * @file
6 * .install file for the taxonomy_breadcrumb module.
7 */
8
9 /**
10 * Implementation of hook_install().
11 */
12 function taxonomy_breadcrumb_install() {
13 // Create tables.
14 drupal_install_schema('taxonomy_breadcrumb');
15
16 $weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'taxonomy'"));
17 db_query("UPDATE {system} SET weight = %d WHERE name = 'taxonomy_breadcrumb'", $weight + 1);
18
19 variable_set('taxonomy_breadcrumb_home', t('Home'));
20 drupal_set_message('Taxonomy breadcrumb: Taxonomy based breadcrumbs should now appear on node pages and taxonomy/term pages. For the most common applications this module will work "out of the box" and no further configuration is necessary. If customization is desired settings can be changed on the '. l('administration page', 'admin/settings/taxonomy-breadcrumb') .'.');
21
22 }
23
24 /**
25 * Implementation of hook_uninstall().
26 */
27 function taxonomy_breadcrumb_uninstall() {
28 // Remove tables.
29 drupal_uninstall_schema('taxonomy_breadcrumb');
30
31 // Remove global variables.
32 variable_del('taxonomy_breadcrumb_home');
33 variable_del('taxonomy_breadcrumb_show_current_term');
34 variable_del('taxonomy_breadcrumb_include_nodes');
35 variable_del('taxonomy_breadcrumb_node_types');
36 }
37
38 /**
39 * Implementation of hook_schema().
40 */
41 function taxonomy_breadcrumb_schema() {
42 return array(
43 'taxonomy_breadcrumb_vocabulary' => array(
44 'description' => t('Stores categories for aggregator feeds and feed items.'),
45 'fields' => array(
46 'vid' => array(
47 'type' => 'int',
48 'not null' => TRUE,
49 ),
50 'path' => array(
51 'type' => 'varchar',
52 'length' => 128,
53 'not null' => TRUE,
54 ),
55 ),
56 'primary key' => array('vid'),
57 ),
58 'taxonomy_breadcrumb_term' => array(
59 'description' => t('Stores categories for aggregator feeds and feed items.'),
60 'fields' => array(
61 'tid' => array(
62 'type' => 'int',
63 'not null' => TRUE,
64 ),
65 'path' => array(
66 'type' => 'varchar',
67 'length' => 128,
68 'not null' => TRUE,
69 ),
70 ),
71 'primary key' => array('tid'),
72 ),
73 );
74 }
75
76 /**
77 * Implementation of hook_update().
78 */
79 function taxonomy_breadcrumb_update_1() {
80
81 // Ensure this module's weight is larger than the core taxonomy module.
82 // This allows for this module's menu callback for taxonomy/term to get called
83 // instead of the core taxonomy/term callback.
84 $ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE name = 'taxonomy_breadcrumb'");
85 return $ret;
86 }
87
88 function taxonomy_breadcrumb_update_6001() {
89 // Ensure this module's weight is larger than the core taxonomy module.
90 // This allows for this module's menu callback for taxonomy/term to get called
91 // instead of the core taxonomy/term callback.
92 $weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'taxonomy'"));
93 db_query("UPDATE {system} SET weight = %d WHERE name = 'taxonomy_breadcrumb'", $weight + 1);
94 }

  ViewVC Help
Powered by ViewVC 1.1.2