You are here

function flag_lists_block_view in Flag Lists 7

Same name and namespace in other branches
  1. 7.3 flag_lists.module \flag_lists_block_view()

Implements hook_block_view().

File

./flag_lists.module, line 756
The Flag Lists module.

Code

function flag_lists_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'flag_lists':
      if (user_access('create flag lists')) {
        $block = array(
          'subject' => t('My lists'),
          'content' => theme('flag_lists_list', array(
            'node' => NULL,
            'create' => variable_get('flag_lists_create_lists', 0),
            'ops' => variable_get('flag_lists_ops', 0),
            'use_flags' => variable_get('flag_lists_include_flags', 0),
          )),
        );
      }
      break;
    case 'flag_lists_list':
      if (user_access('create flag lists')) {
        global $user;
        $account = user_load($user->uid);
        $block = array(
          'subject' => t('My lists'),
          'content' => flag_lists_user_page($account),
        );
      }
      break;
  }
  return !empty($block['content']) ? $block : array();
}