You are here

function kml_block_content in KML 6

Same name and namespace in other branches
  1. 5 kml.module \kml_block_content()

Function to generate block content

1 call to kml_block_content()
kml_block in ./kml.module
Implementation of hook_block()

File

./kml.module, line 459
KML Module

Code

function kml_block_content($block) {
  if ($block == 0) {

    // TODO: allow admin to choose if network links are used, or normal links
    if (arg(0) == 'taxonomy' && arg(1) == 'term') {
      $path = 'kml/term/' . arg(2);
      if (variable_get('kml_usenetworklinks', 1)) {
        $path .= '/networklink';
      }
      return theme('kml_link', url($path));
    }
    else {
      if (module_exists('og') && ($groupnode = og_get_group_context())) {
        if ($groupnode->nid == arg(1)) {

          // show block only on group homepage
          $path = 'kml/group/' . $groupnode->nid;
          if (variable_get('kml_usenetworklinks', 1)) {
            $path .= '/networklink';
          }
          return theme('kml_link', url($path));
        }
      }
      else {
        if (arg(0) == 'search' && arg(1) == 'node' && arg(2)) {
          $path = 'kml/search/' . arg(1) . '/' . arg(2);
          if (variable_get('kml_usenetworklinks', 1)) {
            $path .= '/networklink';
          }
          return theme('kml_link', url($path));
        }
      }
    }
  }
}