Example #1
0
/**
 * Implements hook_preprocess_table().
 */
function bootstrap_preprocess_table(&$variables)
{
    // Prepare classes array if necessary.
    if (!isset($variables['attributes']['class'])) {
        $variables['attributes']['class'] = array();
    } elseif (isset($variables['attributes']['class']) && is_string($variables['attributes']['class'])) {
        $variables['attributes']['class'] = explode(' ', $variables['attributes']['class']);
    }
    // Add the necessary classes to the table.
    _bootstrap_table_add_classes($variables['attributes']['class'], $variables);
}
/**
 * Pre-processes variables for the "views_view_table" theme hook.
 *
 * See template for list of available variables.
 *
 * @see views-view-table.tpl.php
 *
 * @ingroup theme_preprocess
 */
function bootstrap_preprocess_views_view_table(&$variables)
{
    bootstrap_include('bootstrap', 'templates/system/table.vars.php');
    _bootstrap_table_add_classes($variables['classes_array'], $variables);
}