'This is default site footer content.')); $form['footer_message_msg'] = array( '#type' => 'text_format', '#base_type' => 'textarea', '#title' => t('Site Footer message'), '#default_value' => $site_footer['value'], '#format' => isset($site_footer['format']) ? $site_footer['format'] : NULL, '#required' => TRUE, ); } /** * Implements hook_block_info(). */ function footer_message_block_info() { // Add a block containing the site footer message. $blocks['footer_message'] = array( 'info' => t('Footer Message'), 'cache' => DRUPAL_CACHE_GLOBAL, ); return $blocks; } /** * Implements hook_block_view(). */ function footer_message_block_view($delta = '') { $block = array(); switch ($delta) { // Display the footer message block. Note that we apply the appropriate filter format before outputting HTML. case 'footer_message': $site_footer = variable_get('footer_message_msg', array('value' => 'This is default site footer content.')); $format = isset($site_footer['format']) ? $site_footer['format'] : NULL; $block['content'] = check_markup($site_footer['value'], $format); break; } return $block; } /** * Implements hook_preprocess_HOOK() */ function footer_message_preprocess_page(&$variables) { // Provide $footer_message as a theme variable to hook_preprocess_page() and page.tpl.php. // Note that we apply filter format before outputting HTML. $site_footer = variable_get('footer_message_msg', array('value' => 'This is default site footer content.')); $format = isset($site_footer['format']) ? $site_footer['format'] : NULL; $variables['footer_message'] = check_markup($site_footer['value'], $format); }