You are here

function fontyourface_get_font in @font-your-face 7.2

Same name and namespace in other branches
  1. 6.2 fontyourface.module \fontyourface_get_font()
  2. 6 fontyourface.module \fontyourface_get_font()
  3. 7 fontyourface.module \fontyourface_get_font()

Gets a single font.

21 calls to fontyourface_get_font()
FontyourfaceSaveFontTestCase::test in ./fontyourface.test
fontyourface_save_font in ./fontyourface.module
Adds or updates font, depending on whether it already exists.
fontyourface_ui_admin_disable_ajax in modules/fontyourface_ui/fontyourface_ui.module
Disables font based on POSTed fid.
fontyourface_ui_admin_disable_form in modules/fontyourface_ui/fontyourface_ui.module
Disables a single font.
fontyourface_ui_admin_disable_form_submit in modules/fontyourface_ui/fontyourface_ui.module
Disable form submit handler.

... See full list

File

./fontyourface.module, line 278

Code

function fontyourface_get_font($fid, $clear = FALSE) {
  static $fonts = array();
  if ($clear) {
    $fonts = array();
  }

  // if
  if (!isset($fonts[$fid])) {
    $fonts[$fid] = db_query('SELECT * FROM {fontyourface_font} WHERE fid = :fid', array(
      ':fid' => $fid,
    ))
      ->fetchObject();
    fontyourface_add_font_tags($fonts[$fid]);
  }

  // if
  return $fonts[$fid];
}