View source
<?php
function panels_mini_schema() {
return panels_mini_schema_1();
}
function panels_mini_schema_1() {
$schema = array();
$schema['panels_mini'] = array(
'fields' => array(
'pid' => array(
'type' => 'serial',
'not null' => TRUE,
),
'name' => array(
'type' => 'varchar',
'length' => '255',
),
'category' => array(
'type' => 'varchar',
'length' => '64',
),
'did' => array(
'type' => 'int',
),
'title' => array(
'type' => 'varchar',
'length' => '128',
),
'requiredcontexts' => array(
'type' => 'text',
'size' => 'big',
),
'contexts' => array(
'type' => 'text',
'size' => 'big',
),
'relationships' => array(
'type' => 'text',
'size' => 'big',
),
),
'primary key' => array(
'pid',
),
'unique keys' => array(
'name' => array(
'name',
),
),
);
return $schema;
}
function panels_mini_install() {
drupal_install_schema('panels_mini');
}
function panels_mini_uninstall() {
$result = db_query("SELECT * FROM {panels_mini} ORDER BY title");
$panels_exists = db_table_exists('panels_display');
while ($panel_mini = db_fetch_object($result)) {
if (!function_exists('panels_delete_display')) {
require_once drupal_get_path('module', 'panels') . '/panels.module';
}
if ($panels_exists) {
panels_delete_display($panel_mini->did);
}
db_query("DELETE FROM {blocks} WHERE module = 'panels_mini' AND delta = %d", $panel_mini->pid);
}
drupal_uninstall_schema('panels_mini');
}