You are here

function css_injector_schema in CSS Injector 7.2

Same name and namespace in other branches
  1. 6 css_injector.install \css_injector_schema()
  2. 7 css_injector.install \css_injector_schema()

Implements hook_schema().

File

./css_injector.install, line 12
css_injector.install

Code

function css_injector_schema() {
  $schema['css_injector_rule'] = array(
    'description' => t('Table storing CSS Injector rule definitions.'),
    'export' => array(
      'key' => 'name',
      'primary key' => 'crid',
      'identifier' => 'rule',
      // Exports will be defined as $rule
      'default hook' => 'css_injector_rule',
      'save callback' => 'css_injector_rule_save',
      'delete callback' => 'css_injector_rule_delete',
      'api' => array(
        'owner' => 'css_injector',
        'api' => 'css_injector_rules',
        // Base name for api include files.
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Unique ID for injections. Used to identify them programmatically.',
      ),
      'crid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'The primary identifier injection',
        'no export' => TRUE,
      ),
      'admin_description' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'A human readable name of a rule.',
      ),
      'css' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'The actual CSS code.',
      ),
      'media' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Media type for the stylesheet, e.g., all, print, screen.',
      ),
      'preprocess' => array(
        'description' => 'Boolean indicating whether the injection should be aggregated.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'inline' => array(
        'description' => 'Boolean indicating whether the rules should be inline (cannot be aggregated).',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'page_visibility' => array(
        'description' => 'Boolean indicating whether the rule has a white or black list for page visibility.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'page_visibility_pages' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'A list of pages to either hide or show the injection.',
      ),
    ),
    'primary key' => array(
      'crid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}