defaultcontent.install in Default Content 7
Same filename and directory in other branches
Installation file for Default Content module
File
defaultcontent.installView source
<?php
/**
* @file
*
* Installation file for Default Content module
*/
/**
* Implements hook_install().
*/
function defaultcontent_install() {
//drupal_install_schema('defaultcontent');
db_update('system')
->fields(array(
'weight' => 1,
))
->condition('type', 'module')
->condition('name', 'defaultcontent_install')
->execute();
}
/**
* Implements hook_schema().
*/
function defaultcontent_schema() {
$schema['defaultcontent'] = array(
'description' => 'Store state of default content nodes',
'fields' => array(
'name' => array(
'description' => 'Then machine name of the node',
'type' => 'varchar',
'length' => 225,
'not null' => TRUE,
),
'nid' => array(
'description' => 'Node id or NULL if there is no current node',
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
),
),
'primary key' => array(
'name',
),
);
return $schema;
}
/**
* Implements hook_uninstall().
*/
function defaultcontent_uninstall() {
// Remove module variables.
$result = db_query("SELECT name FROM {variable} WHERE name LIKE 'defaultcontent_%'");
foreach ($result as $record) {
variable_del($record->name);
}
}
Functions
Name | Description |
---|---|
defaultcontent_install | Implements hook_install(). |
defaultcontent_schema | Implements hook_schema(). |
defaultcontent_uninstall | Implements hook_uninstall(). |