Same name and namespace in other branches
  1. 4.7.x modules/statistics.module \_statistics_link()
  2. 5.x modules/statistics/statistics.module \_statistics_link()
  3. 6.x modules/statistics/statistics.module \_statistics_link()

Generates a link to a path, truncating the displayed text to a given width.

Parameters

$path: The path to generate the link for.

$width: The width to set the displayed text of the path.

Return value

A string as a link, truncated to the width, linked to the given $path.

3 calls to _statistics_link()
statistics_node_tracker in modules/statistics/statistics.pages.inc
Page callback: Displays statistics for a node.
statistics_top_referrers in modules/statistics/statistics.admin.inc
Page callback: Displays the "top referrers" in the access logs.
_statistics_format_item in modules/statistics/statistics.module
Formats an item for display, including both the item title and the link.

File

modules/statistics/statistics.module, line 401
Logs and displays access statistics for a site.

Code

function _statistics_link($path, $width = 35) {
  $title = drupal_get_path_alias($path);
  $title = truncate_utf8($title, $width, FALSE, TRUE);
  return l($title, $path);
}