View source
<?php
function domain_taxonomy_install() {
$vocs = taxonomy_get_vocabularies();
if (count($vocs) > 0) {
$voc_options[] = '';
foreach ($vocs as $voc) {
variable_set('domain_disable_voc_' . $voc->vid, TRUE);
variable_set('domain_share_voc_' . $voc->vid, TRUE);
}
}
}
function domain_taxonomy_schema() {
$schema['domain_taxonomy_access'] = array(
'fields' => array(
'tid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'gid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'realm' => array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'grant_view' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
),
'grant_update' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
),
'grant_delete' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
),
),
'primary key' => array(
'tid',
'gid',
'realm',
),
'indexes' => array(
'tid' => array(
'tid',
),
),
);
$schema['domain_taxonomy_source'] = array(
'fields' => array(
'tid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'domain_id' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'tid',
),
);
return $schema;
}
function domain_taxonomy_uninstall() {
$vocs = taxonomy_get_vocabularies();
if (count($vocs) > 0) {
$voc_options[] = '';
foreach ($vocs as $voc) {
variable_del('domain_disable_voc_' . $voc->vid);
variable_del('domain_share_voc_' . $voc->vid);
}
}
foreach (node_type_get_names() as $type => $name) {
variable_del('domain_inherit_type_voc_' . $type);
}
variable_del('domain_taxonomy_options');
variable_del('domain_taxonomy_debug');
variable_del('domain_taxonomy_seo');
variable_del('domain_taxonomy_paths');
}