function copyright_block_block_save in Copyright Block module 7
Same name and namespace in other branches
- 7.2 copyright_block.module \copyright_block_block_save()
Implements hook_block_save().
Stores the copyright holder and the inception year.
File
- ./
copyright_block.module, line 148 - Module file for "Copyright block".
Code
function copyright_block_block_save($delta = '', $edit = array()) {
if ($delta == 'copyright') {
$copyright_block_copyrightholder = $edit['copyright_block_copyrightholder'];
if ($copyright_block_copyrightholder == variable_get('site_name', '')) {
$copyright_block_copyrightholder = '';
}
variable_set('copyright_block_copyrightholder', $copyright_block_copyrightholder);
$copyright_block_inceptionyear = intval($edit['copyright_block_inceptionyear']);
$current_year = date('Y', REQUEST_TIME);
if ($copyright_block_inceptionyear > $current_year) {
$copyright_block_inceptionyear = $current_year;
}
variable_set('copyright_block_inceptionyear', $copyright_block_inceptionyear);
variable_set('copyright_block_template', $edit['copyright_block_template']);
variable_set('copyright_block_spacertemplate', $edit['copyright_block_spacertemplate']);
}
}