You are here

public static function Cleaner::cleanerGetCacheTablesTable in Cleaner 7

Helper function for getting all cache tables list in the table format.

Return value

string Table HTML.

2 calls to Cleaner::cleanerGetCacheTablesTable()
cleaner_cleaner_settings in ./cleaner.module
Implements hook_cleaner_settings().
hook_cleaner_settings in ./cleaner.api.php
Create Cleaner settings form.

File

./class.Cleaner.php, line 63
Cleaner base class file.

Class

Cleaner
Class Cleaner.

Code

public static function cleanerGetCacheTablesTable() {

  // Get all CACHE tables form database.
  $list = self::cleanerGetCacheTables();
  if (!empty($list)) {

    // Re-build cache tables list array by 4 items per array.
    $count = count($list);
    $cols = 4;
    $rows = ceil($count / $cols);
    $list = array_pad($list, $rows * $cols, ' ');
    $trows = array();
    for ($i = 0; $i < $count; $i += $cols) {
      $trows[] = array_slice($list, $i, $cols);
    }

    // Create theme table rendered HTML.
    $table = theme('table', array(
      'rows' => $trows,
      'attributes' => array(
        'class' => array(
          'cleaner-cache-tables',
        ),
      ),
    ));
    return t('The current cache tables are:') . $table;
  }
  return t('There is no cache tables in the database.');
}