You are here

function piwik_stats_menu in Piwik Statistic Integration 7.2

Same name and namespace in other branches
  1. 7 piwik_stats.module \piwik_stats_menu()

Implements hook_menu().

File

./piwik_stats.module, line 82
Integrates piwik statistics as entity fields.

Code

function piwik_stats_menu() {
  $items = array();

  // Provide a piwik statistics tab for some entities.
  // @TODO determine all possible entities automatically.
  $entities = array(
    // path => entity_type.
    'node' => 'node',
    'user' => 'user',
  );
  foreach ($entities as $uri => $entity) {
    $items[$uri . '/%' . $entity . '/piwik'] = array(
      'title' => 'Piwik statistics',
      'page callback' => 'piwik_stats_tab_page',
      'page arguments' => array(
        $entity,
        1,
      ),
      'access callback' => 'piwik_stats_tab_page_access',
      'access arguments' => array(
        $entity,
        1,
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'piwik_stats.pages.inc',
      'weight' => 10,
    );
  }
  return $items;
}