You are here

function shoutbox_domain_block_view_alter in Shoutbox 7.2

Same name and namespace in other branches
  1. 7 shoutbox_domain/shoutbox_domain.module \shoutbox_domain_block_view_alter()

Implements hook_block_view_alter().

File

shoutbox_domain/shoutbox_domain.module, line 70

Code

function shoutbox_domain_block_view_alter(&$data, $block) {

  // Alter the shoutbox block when it is not on the shoutbox page.
  if ($block->module == 'shoutbox' && $block->delta == 'shoutbox' && arg(0) != 'shoutbox') {

    // The shoutbox block is surrounded only by user_access, so we need to override this
    // if the user has the correct permissions.
    if (shoutbox_domain_is_assigned_domain() && user_access('access shoutbox assigned domains')) {

      // Load block data.
      $block->subject = t('Shoutbox');
      $block->content = shoutbox_view(TRUE);
    }
  }
}