You are here

power_menu.install in Power Menu 7

Same filename and directory in other branches
  1. 6 power_menu.install
  2. 7.2 power_menu.install

just containing the stuff for install and uninstall

File

power_menu.install
View source
<?php

/**
 * @file
 * 
 * just containing the stuff for install and uninstall
 */

/**
 * Implements hook_uninstall().
 */
function power_menu_uninstall() {
  variable_del('power_menu_taxonomy_field');
  variable_del('power_menu_menu');
}

/**
 * Implements hook_install().
 */
function power_menu_install() {

  // Nothing...
}

/**
 * Implements hook_schema().
 */
function power_menu_schema() {
  $schema['power_menu'] = array(
    'description' => 'Save the relation between menu and taxonomy term',
    'fields' => array(
      'mid' => array(
        'description' => 'Just a key',
        'type' => 'varchar',
        'length' => 40,
        'not null' => TRUE,
      ),
      'mlid' => array(
        'description' => 'Menu item id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'tid' => array(
        'description' => 'Termid',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nodetype' => array(
        'description' => 'Nodetype',
        'type' => 'varchar',
        'length' => 50,
        'not null' => FALSE,
      ),
      'path' => array(
        'description' => 'Path, this is redundant, but better performance',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'menu_name' => array(
        'description' => 'The menu which was selected',
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'mid',
    ),
    'indexes' => array(
      'tid' => array(
        'tid',
      ),
      'path' => array(
        'path',
      ),
      'nodetype' => array(
        'nodetype',
      ),
      'menu_name' => array(
        'menu_name',
      ),
    ),
  );
  $schema['power_menu_properties'] = array(
    'fields' => array(
      'mlid' => array(
        'description' => 'Menu item id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'property_name' => array(
        'description' => 'Name of the property',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'value' => array(
        'description' => 'The value of the property',
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'mlid',
      'property_name',
    ),
  );
  return $schema;
}

Functions