You are here

function shurly_block_view in ShURLy 7

Implements hook_block_view().

File

./shurly.module, line 148
description http://www.youtube.com/watch?v=Qo7qoonzTCE

Code

function shurly_block_view($delta = '') {
  $block = array();

  // don't show the block when user is on the callback page
  switch ($delta) {
    case 'form':
      if (user_access('Create short URLs') && arg(0) != 'shurly') {
        $block['subject'] = t('Create a short URL');
        $block['content'] = shurly_block_content_form();
      }
      break;
    case 'bookmarklet':
      if (user_access('Create short URLs')) {
        $block['subject'] = t('Bookmarklet');
        $block['content'] = shurly_block_content_bookmarklet();
      }
      break;
  }
  return $block;
}