You are here

function block_class_install in Block Class 5

Same name and namespace in other branches
  1. 6.2 block_class.install \block_class_install()
  2. 6 block_class.install \block_class_install()
  3. 7.2 block_class.install \block_class_install()

File

./block_class.install, line 3

Code

function block_class_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query('CREATE TABLE IF NOT EXISTS {block_class} (
          `module` varchar(50) NOT NULL,
          `delta` varchar(32) NOT NULL,
          `css_class` varchar(50) NOT NULL,
          PRIMARY KEY  (`module`,`delta`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;');
      if (db_table_exists('pressflow_block_class')) {
        db_query('INSERT INTO {block_class} (module, delta, css_class) SELECT module, delta, css_class FROM {pressflow_block_class}');
      }
      drupal_set_message('Block Class successfully installed.');
  }
}