You are here

function theme_memcache_admin_stats_table in Memcache API and Integration 5

Same name and namespace in other branches
  1. 5.2 memcache_admin/memcache_admin.module \theme_memcache_admin_stats_table()
  2. 6 memcache_admin/memcache_admin.module \theme_memcache_admin_stats_table()
  3. 7 memcache_admin/memcache_admin.module \theme_memcache_admin_stats_table()

Theme function for rendering the output from memcache_admin_stats

Parameters

string $server - Server name:port for caption for the table:

array $stats - array of key/value string pairs for the table results:

Return value

string

1 theme call to theme_memcache_admin_stats_table()
memcache_admin_stats in memcache_admin/memcache_admin.module
Memcahe Stats page

File

memcache_admin/memcache_admin.module, line 180

Code

function theme_memcache_admin_stats_table($server, $stats) {
  $rows = array();
  foreach ($stats as $key => $value) {
    if (is_array($value)) {
      $rs = array();
      foreach ($value as $k => $v) {
        $rs[] = array(
          $k,
          $v,
        );
      }
      $rows[] = array(
        $key,
        theme('table', array(), $rs),
      );
    }
    else {
      $rows[] = array(
        $key,
        $value,
      );
    }
  }
  return theme('table', array(
    t('Property'),
    t('Value'),
  ), $rows, array(), $server);
}