You are here

function _sharebar_get_node_type in ShareBar 7

Get type of current node.

See also

sharebar_preprocess_region()

1 call to _sharebar_get_node_type()
sharebar_preprocess_region in ./sharebar.module
Preprocess variables for region.tpl.php.

File

./sharebar.module, line 211
Various module information.

Code

function _sharebar_get_node_type($variables) {
  $node_type = '';
  if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == '') {
    if (array_key_exists('nodes', $variables['elements']['system_main'])) {
      $node_type = $variables['elements']['system_main']['nodes'][arg(1)]['#node']->type;
    }
    else {
      $node = node_load(arg(1));
      $node_type = $node->type;
    }
  }
  return $node_type;
}