From 8db38b9a8417f536efe95e9b0815e827b4626a8f Mon Sep 17 00:00:00 2001
From: Alex Weber <alexweber15@gmail.com>
Date: Sat, 31 Mar 2012 00:18:46 -0300
Subject: [PATCH] Issue #1460728 by sreynen

Only implement hook_views_api() if fontyourface_ui module is enabled.
---
 modules/google_fonts_api/google_fonts_api.module |   25 ++++++++++++---------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/modules/google_fonts_api/google_fonts_api.module b/modules/google_fonts_api/google_fonts_api.module
index 82f9c8e..8ff8f1d 100644
--- a/modules/google_fonts_api/google_fonts_api.module
+++ b/modules/google_fonts_api/google_fonts_api.module
@@ -175,17 +175,20 @@ function google_fonts_api_fontyourface_import() {
   
 } // google_fonts_api_fontyourface_import
 
-/**
- * Implements hook_views_api().
- */
-function google_fonts_api_views_api() {
-
-  return array(
-    'api' => 2,
-    'path' => drupal_get_path('module', 'google_fonts_api') . '/views',
-  );
-
-} // google_fonts_api_views_api
+// Only implement hook_views_api() if @font-your-face UI module is enabled.
+if (module_exists('fontyourface_ui')) {
+  /**
+   * Implements hook_views_api().
+   */
+  function google_fonts_api_views_api() {
+
+    return array(
+      'api' => 2,
+      'path' => drupal_get_path('module', 'google_fonts_api') . '/views',
+    );
+
+  } // google_fonts_api_views_api
+}
 
 /**
  * Converts the Google Fonts API JSON results to a generic Fonts object array
-- 
1.7.5.4

