You are here

function fontyourface_fyf_status in @font-your-face 7.2

Callback for Drush command 'fyf-status'.

1 string reference to 'fontyourface_fyf_status'
fontyourface_drush_command in drush/fontyourface.drush.inc
Implements hook_drush_command().

File

drush/fontyourface.drush.inc, line 57
Drush integration for @font-your-face.

Code

function fontyourface_fyf_status() {

  // Provider info.
  $modules = module_implements('fontyourface_info', TRUE);
  if (count($modules) > 0) {
    drush_print(dt('Providers enabled (@count):', array(
      '@count' => count($modules),
    )));
    $rows = array();
    $rows[] = array(
      dt('Provider'),
      dt('Total fonts'),
      dt('Enabled fonts'),
    );
    foreach ($modules as $module) {
      $row = array();
      $row[] = $module;
      $row[] = fontyourface_count_fonts($module);
      $row[] = fontyourface_count_fonts($module, TRUE);
      $rows[] = $row;
    }
    drush_print_table($rows, TRUE);
  }
  else {
    drush_print(dt('No font providers are enabled.'));

    // If there are no providers, we can call it quits as there will be no
    // fonts either.
    return;
  }

  // Font info.
  $fonts = fontyourface_get_fonts('enabled = 1');
  if (count($fonts) > 0) {
    drush_print(dt('Fonts enabled (@count):', array(
      '@count' => count($fonts),
    )));
    $rows = array();
    $rows[] = array(
      dt('Font'),
      dt('Provider'),
      dt('CSS selector'),
    );
    foreach ($fonts as $font) {
      $row = array();
      $row[] = $font->name;
      $row[] = $font->provider;
      $row[] = $font->css_selector;
      $rows[] = $row;
    }
    drush_print_table($rows, TRUE);
  }
  else {
    drush_print(dt('No fonts are enabled.'));
  }
}