/[drupal]/contributions/modules/category/category_menu/category_menu.install
ViewVC logotype

Diff of /contributions/modules/category/category_menu/category_menu.install

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

revision 1.7, Sat Feb 7 09:01:16 2009 UTC revision 1.8, Wed Aug 5 04:52:54 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: category_menu.install,v 1.6 2008/07/21 17:48:50 jaza Exp $  // $Id: category_menu.install,v 1.7 2009/02/07 09:01:16 jaza Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 16  function category_menu_install() { Line 16  function category_menu_install() {
16  }  }
17    
18  /**  /**
19     * Implementation of hook_disable().
20     */
21    function category_menu_disable() {
22      drupal_set_message(t('The <em>category_menu</em> module is now disabled. This means that generated menu items are no longer maintained. In order to avoid future problems with outdated menu items, it\'s highly recommended to either enable <em>category_menu</em>, or <a href="!url">uninstall</a> it entirely (removes all generated menu items).', array('!url' => url('admin/build/modules/uninstall'))), 'warning');
23    }
24    
25    /**
26   * Implementation of hook_uninstall().   * Implementation of hook_uninstall().
27   */   */
28  function category_menu_uninstall() {  function category_menu_uninstall() {
29    drupal_uninstall_schema('category_menu');    drupal_uninstall_schema('category_menu');
30    
31      $types = node_get_types('names');
32      foreach ($types as $type => $name) {
33        variable_del('category_menu_links_'. $type);
34      }
35      // Remove all generated menu links, as these are no longer maintained,
36      // and user can't delete them (only just disable).
37      db_query("DELETE FROM {menu_links} WHERE module = 'category_menu'");
38      menu_rebuild();
39  }  }
40    
41  function category_menu_schema() {  function category_menu_schema() {
42    $schema['category_menu'] = array(    $schema['category_menu'] = array(
43      'description' => t('Stores menu settings for containers.'),      'description' => 'Stores menu settings for containers.',
44      'fields' => array(      'fields' => array(
45        'cid' => array(        'cid' => array(
46          'type' => 'int',          'type' => 'int',
47          'unsigned' => TRUE,          'unsigned' => TRUE,
48          'not null' => TRUE,          'not null' => TRUE,
49          'default' => 0,          'default' => 0,
50          'description' => t('Primary Key: The {category}.cid of the container.'),          'description' => 'Primary Key: The {category}.cid of the container.',
51        ),        ),
52        'links_for_cats' => array(        'links_for_cats' => array(
53          'type' => 'int',          'type' => 'int',
# Line 39  function category_menu_schema() { Line 55  function category_menu_schema() {
55          'not null' => TRUE,          'not null' => TRUE,
56          'default' => 0,          'default' => 0,
57          'size' => 'tiny',          'size' => 'tiny',
58          'description' => t('Whether or not generation of menu links for categories is enabled within the container. (0 = disabled, 1 = enabled)'),          'description' => 'Whether or not generation of menu links for categories is enabled within the container. (0 = disabled, 1 = enabled)',
59        ),        ),
60        'expanded_for_cats' => array(        'expanded_for_cats' => array(
61          'type' => 'int',          'type' => 'int',
# Line 47  function category_menu_schema() { Line 63  function category_menu_schema() {
63          'not null' => TRUE,          'not null' => TRUE,
64          'default' => 0,          'default' => 0,
65          'size' => 'tiny',          'size' => 'tiny',
66          'description' => t("Whether or not generated menu links for categories should be set to 'expanded' within the container. (0 = disabled, 1 = enabled)"),          'description' => "Whether or not generated menu links for categories should be set to 'expanded' within the container. (0 = disabled, 1 = enabled)",
67        ),        ),
68        'plid_for_container' => array(        'plid_for_container' => array(
69          'type' => 'int',          'type' => 'int',
70          'unsigned' => TRUE,          'unsigned' => TRUE,
71          'not null' => TRUE,          'not null' => TRUE,
72          'default' => 0,          'default' => 0,
73          'description' => t("The {menu_links}.mlid of a custom menu link to use as the parent of this container."),          'description' => "The {menu_links}.mlid of a custom menu link to use as the parent of this container.",
74        ),        ),
75        'menu_name' => array(        'menu_name' => array(
76          'type' => 'varchar',          'type' => 'varchar',
# Line 68  function category_menu_schema() { Line 84  function category_menu_schema() {
84    );    );
85    
86    $schema['category_menu_map'] = array(    $schema['category_menu_map'] = array(
87    'description' => t('Stores mappings of containers, categories, and assigned nodes to generated menu links. Uniquely connects each such node to a link in {menu_links}'),    'description' => 'Stores mappings of containers, categories, and assigned nodes to generated menu links. Uniquely connects each such node to a link in {menu_links}',
88      'fields' => array(      'fields' => array(
89        'mlid' => array(        'mlid' => array(
90          'type' => 'int',          'type' => 'int',
91          'unsigned' => TRUE,          'unsigned' => TRUE,
92          'not null' => TRUE,          'not null' => TRUE,
93          'default' => 0,          'default' => 0,
94          'description' => t("The node's {menu_links}.mlid."),          'description' => "The node's {menu_links}.mlid.",
95        ),        ),
96        'nid' => array(        'nid' => array(
97          'type' => 'int',          'type' => 'int',
98          'unsigned' => TRUE,          'unsigned' => TRUE,
99          'not null' => TRUE,          'not null' => TRUE,
100          'default' => 0,          'default' => 0,
101          'description' => t("The node's {node}.nid."),          'description' => "The node's {node}.nid.",
102        ),        ),
103      ),      ),
104      'primary key' => array('mlid'),      'primary key' => array('mlid'),
# Line 142  function category_menu_update_6001() { Line 158  function category_menu_update_6001() {
158    
159    return $ret;    return $ret;
160  }  }
161    
162    /**
163     * Ensure correct weight for category_menu module.
164     */
165    function category_menu_update_6002() {
166      $ret = array();
167      $ret[] = update_sql("UPDATE {system} SET weight = 8 WHERE name = 'category_menu'");
168      return $ret;
169    }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.2