You are here

function fontyourface_views_pre_render in @font-your-face 6.2

Same name and namespace in other branches
  1. 8.3 fontyourface.module \fontyourface_views_pre_render()
  2. 7 fontyourface.module \fontyourface_views_pre_render()

Implements hook_views_pre_render().

File

./fontyourface.module, line 64

Code

function fontyourface_views_pre_render(&$view) {
  if ($view->name == 'fontyourface_disabled') {
    $breadcrumb = drupal_get_breadcrumb();
    $breadcrumb[] = l('@font-your-face', 'admin/build/themes/fontyourface');
    drupal_set_breadcrumb($breadcrumb);
    $providers = module_implements('fontyourface_info');
    if (count($providers) == 0) {
      drupal_set_message(t('No font providers enabled. !enable before adding fonts.', array(
        '!enable' => l(t('Enable font providers'), 'admin/build/modules'),
      )), 'error');
    }

    // if
    foreach (module_implements('fontyourface_info') as $module) {
      $has_fonts = db_fetch_object(db_query_range("SELECT fid FROM {fontyourface_font} WHERE provider = '%s'", $module, 0, 1));
      if (!$has_fonts) {
        $function = $module . '_fontyourface_info';
        $info = $function();
        drupal_set_message(t('@provider currently has no fonts. This is probably because the import has not been run yet. !import to add fonts.', array(
          '@provider' => $info['name'],
          '!import' => l(t('Run import'), 'admin/settings/fontyourface'),
        )), 'error');
      }

      // if
    }

    // foreach
  }

  // if
}