You are here

function _spaces_core_block_tags in Spaces 6

Same name and namespace in other branches
  1. 5.2 spaces_core/spaces_core.module \_spaces_core_block_tags()
  2. 5 spaces_core/spaces_core.module \_spaces_core_block_tags()

BLOCKS =============================================================

1 call to _spaces_core_block_tags()
spaces_core_block in spaces_core/spaces_core.module
Implementation of hook_block().

File

spaces_core/spaces_core.module, line 265

Code

function _spaces_core_block_tags() {
  $space = spaces_get_space();
  if (context_get('spaces', 'feature') == 'taxonomy') {
    $terms = taxonomy_terms_parse_string(arg(2));
    $tid = $terms['tids'][0];
    if ($term = taxonomy_get_term($tid)) {
      $vocab = taxonomy_get_vocabulary($term->vid);
      $view = views_get_view('spaces_tags');
      $view->filter[1]['value'] = array(
        $term->vid,
      );
      $block['content'] = views_build_view('block', $view, array(
        $space->sid,
      ));
      $block['subject'] = $vocab->name;
      return $block;
    }
  }
}