You are here

function sweaver_drush_print_styles in Sweaver 7

Same name and namespace in other branches
  1. 6 drush/sweaver.drush.inc \sweaver_drush_print_styles()

Print a list of styles.

Parameters

$styles: A collection of draft styles.

1 call to sweaver_drush_print_styles()
sweaver_drush_style in drush/sweaver.drush.inc
Edit a style via drush.

File

drush/sweaver.drush.inc, line 230
Sweaver Drush functions.

Code

function sweaver_drush_print_styles($styles) {
  if (empty($styles)) {
    drush_print('No styles found in the system');
  }
  else {
    foreach ($styles as $key => $style) {
      unset($styles[$key]->css);
      unset($styles[$key]->customcss);
      unset($styles[$key]->themesettings);
      $style->style_id = $key;
      if (isset($style->active)) {
        $style->style = $style->style . ' ' . dt('(live)');
        unset($style->active);
      }
    }
    $rows = array(
      0 => array(
        dt('ID'),
        dt('Theme'),
        dt('Name'),
      ),
    );
    $rows += $styles;
    drush_print_table($rows, TRUE);
  }
}