<?php
// $Id: stylizer.install,v 1.1.2.2 2010/07/14 01:57:42 merlinofchaos Exp $

/**
 * Schema for stylizer.
 */
function stylizer_schema() {
  return stylizer_schema_1();
}

function stylizer_schema_1() {
  $schema = array();

  $schema['stylizer'] = array(
    'description' => 'Customized stylizer styles created by administrative users.',
    'export' => array(
      'bulk export' => TRUE,
      'export callback' => 'stylizer_style_export',
      'can disable' => TRUE,
      'identifier' => 'style',
      'primary key' => 'sid',
    ),
    'fields' => array(
      'sid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Unique ID for this style. Used to identify it programmatically.',
      ),
      'admin_title' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Human readable title for this style.',
      ),
      'admin_description' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Administrative description of this style.',
        'object default' => '',
      ),
      'settings' => array(
        'type' => 'text',
        'size' => 'big',
        'serialize' => TRUE,
        'object default' => array(),
        'initial ' => array(
          'name' => '_temporary',
          'style_base' => NULL,
          'palette' => array(),
        ),
        'description' => 'A serialized array of settings specific to the style base that describes this plugin.',
      ),
    ),
    'primary key' => array('sid'),
    'unique keys' => array(
      'name' => array('name'),
    ),
  );

  return $schema;
}

/**
 * Implementation of hook_install().
 */
function stylizer_install() {
  $ret = array();
  if (db_table_exists('panels_style')) {
    db_rename_table($ret, 'panels_style', 'stylizer');
  }
  else {
    drupal_install_schema('stylizer');
  }
}

/**
 * Implementation of hook_uninstall().
 */
function stylizer_uninstall() {
  drupal_uninstall_schema('stylizer');
}
