You are here

function simplenews_statistics_node_tab_access in Simplenews Statistics 7

Same name and namespace in other branches
  1. 7.2 simplenews_statistics.module \simplenews_statistics_node_tab_access()

Access callback for statistics landing page.

1 string reference to 'simplenews_statistics_node_tab_access'
simplenews_statistics_menu in ./simplenews_statistics.module
Implements hook_menu().

File

./simplenews_statistics.module, line 68
Main simplenews statistics file.

Code

function simplenews_statistics_node_tab_access($permission, $node) {

  // Show warning about HTML.
  if (isset($node->simplenews->tid)) {
    $category = simplenews_category_load($node->simplenews->tid);
    if ($category->format !== 'html') {
      drupal_set_message(t('Newsletter category %name format has not been set to HTML. There will be no statistics recorded for this newsletter.', array(
        '%name' => $category->name,
      )), 'warning', FALSE);
    }
  }
  return simplenews_check_node_types($node->type) && user_access($permission);
}