featured_content.install in Featured Content 7.2
Same filename and directory in other branches
Install, update, and uninstall functions for the Featured Content module.
File
featured_content.installView source
<?php
/**
* @file
* Install, update, and uninstall functions for the Featured Content module.
*
*/
/**
* Implements hook_uninstall().
*/
function featured_content_uninstall() {
// Delete Featured Content variables.
variable_del('featured_content_blocks');
// Array with all blocks data.
variable_del('featured_content_block_ids');
// Array with all block ids.
// Remove block configurations.
db_delete('block')
->condition('module', 'featured_content')
->execute();
db_delete('block_role')
->condition('module', 'featured_content')
->execute();
cache_clear_all();
}
/**
* Implements hook_enable().
*/
function featured_content_enable() {
drupal_set_message(t('To add Featured Content blocks, find the "Add Featured Content block" action link on the <a href="@url">administer blocks page</a>.', array(
'@url' => url('admin/structure/block'),
)));
}
/**
* Implements hook_install().
*/
function featured_content_install() {
// Nothing to do.
}
/**
* Update the view mode display settings.
*/
function featured_content_update_7100() {
$featured_blocks = variable_get('featured_content_blocks', array());
if (!empty($featured_blocks)) {
foreach ($featured_blocks as $delta => $data) {
// Convert block view mode settings.
if ($data['display'] == 'teasers') {
$featured_blocks[$delta]['display'] = 'teaser';
}
elseif ($data['display'] == 'full_nodes') {
$featured_blocks[$delta]['display'] = 'full';
}
// Convert more page view mode settings.
if ($data['more']['display'] == 'teasers') {
$featured_blocks[$delta]['more']['display'] = 'teaser';
}
elseif ($data['display'] == 'full_nodes') {
$featured_blocks[$delta]['more']['display'] = 'full';
}
}
}
variable_set('featured_content_blocks', $featured_blocks);
return array();
}
Functions
Name![]() |
Description |
---|---|
featured_content_enable | Implements hook_enable(). |
featured_content_install | Implements hook_install(). |
featured_content_uninstall | Implements hook_uninstall(). |
featured_content_update_7100 | Update the view mode display settings. |