You are here

semantic_panels.install in Semantic Panels 7.2

Same filename and directory in other branches
  1. 7 semantic_panels.install

File

semantic_panels.install
View source
<?php

function semantic_panels_enable() {
  if (!_semantic_panels_can_use_fences()) {

    // Notify user of fences awesomenss.
    drupal_set_message(t('Install the <a href="@fences_link">Fences</a> module to access all HTML elements that Fences provides, also in Semantic Panels.', array(
      '@fences_link' => url('http://drupal.org/project/fences'),
    )), 'warning', FALSE);
  }
}

/**
 * Implementation of hook_schema().
 */
function semantic_panels_schema() {
  $schema['semantic_panels_style'] = array(
    'description' => t('Semantic Panels styles'),
    'export' => array(
      'key' => 'name',
      'key name' => 'Name',
      'primary key' => 'sid',
      'identifier' => 'style',
      // Exports will be defined as $preset
      'load callback' => 'semantic_panels_style_load',
      'load all callback' => 'semantic_panels_style_load_all',
      'api' => array(
        'owner' => 'semantic_panels',
        'api' => 'default_semantic_panels_style',
        // Base name for api include files.
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Unique ID for presets. Used to identify them programmatically.',
      ),
      'category' => array(
        'type' => 'varchar',
        'length' => '64',
        'description' => 'The category this mini panel appears in on the add content pane.',
      ),
      'sid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'no export' => TRUE,
      ),
      'style' => array(
        'type' => 'text',
        'size' => 'big',
        'serialize' => TRUE,
        'object default' => array(),
        'initial' => array(),
      ),
      'admin_title' => array(
        'type' => 'varchar',
        'length' => '128',
        'description' => 'The administrative title of the style.',
      ),
    ),
    'primary key' => array(
      'sid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}

Functions