You are here

function theme_dir_listing_statistics in Filebrowser 7.3

Same name and namespace in other branches
  1. 8 filebrowser.theme.inc \theme_dir_listing_statistics()
  2. 6.2 filebrowser.theme.inc \theme_dir_listing_statistics()
  3. 7.4 filebrowser.theme.inc \theme_dir_listing_statistics()
  4. 7.2 filebrowser.theme.inc \theme_dir_listing_statistics()

Theming function for icon-view.

Parameters

$node the node to transform to icon view.:

Return value

A string containing icon view XHTML.

1 theme call to theme_dir_listing_statistics()
filebrowser_view in ./filebrowser.module
Implements hook_init().

File

./filebrowser.theme.inc, line 56
Several theme functions for filebrowser

Code

function theme_dir_listing_statistics($statistics) {

  // $whitelist is used to restrict indexes to filebrowser indexes.
  // Issue #2616738 indicates addition of 'index' to the array
  $output = "<div class='dir-listing-status'>";
  if ($statistics['empty']) {
    $output .= $statistics['empty'];
  }
  else {
    $white_list = array(
      'files',
      'size',
      'empty',
      'folders',
    );
    $white_listed_statistics = array();
    foreach ($statistics as $key => $statistic) {
      if (in_array($key, $white_list) && !empty($statistic)) {
        $white_listed_statistics[] = $statistic;
      }
    }
    $output .= implode(" - ", $white_listed_statistics);
  }
  $output .= "</div>";
  return $output;
}