View source
<?php
function command_buttons_schema() {
$schema = array();
$schema['command_buttons'] = array(
'description' => 'Entity table for panel pane content with fields.',
'fields' => array(
'bid' => array(
'description' => 'The primary identifier for the entity.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'bundle' => array(
'description' => 'The bundle of the entity.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'name' => array(
'description' => 'The machine name of the entity.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'module' => array(
'description' => 'The module name.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'title' => array(
'description' => 'The title of the entity.',
'type' => 'varchar',
'length' => 255,
),
'created' => array(
'description' => 'The Unix timestamp when the entity was created.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'changed' => array(
'description' => 'The Unix timestamp when the entity was most recently saved.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'language' => array(
'description' => 'The {languages}.language of this entity.',
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => '',
),
'status' => array(
'description' => 'The entity status.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'bid',
),
);
return $schema;
}
function command_buttons_update_7002() {
}
function command_buttons_update_7104() {
foreach (array(
'lg' => 'large',
'sm' => 'small',
'xs' => 'mini',
) as $new => $old) {
db_update('field_data_field_button_size')
->fields(array(
'field_button_size_value' => 'btn-' . $new,
))
->condition('field_button_size_value', 'btn-' . $old)
->execute();
db_update('field_revision_field_button_size')
->fields(array(
'field_button_size_value' => 'btn-' . $new,
))
->condition('field_button_size_value', 'btn-' . $old)
->execute();
}
}
function command_buttons_update_7105() {
db_change_field('command_buttons', 'name', 'name', array(
'description' => 'The machine name of the entity.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
));
db_change_field('command_buttons', 'module', 'module', array(
'description' => 'The module name.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
));
}
function command_buttons_update_7106() {
entity_entitycache_installed_modules(array(
'command_buttons',
));
}
function command_buttons_update_7107() {
$file_buttons = array_keys(command_buttons_load_multiple(FALSE, array(
'module' => 'oa_files',
)));
command_buttons_delete_multiple($file_buttons);
}
function command_buttons_update_7108() {
$node_info = entity_get_info('node');
foreach ($node_info['bundles'] as $type => $definition) {
command_buttons_create_node_button($type, $definition['label']);
}
}