You are here

function fontyourface_ui_apply_page in @font-your-face 7.2

Admin page shows enabled fonts with options to add.

1 string reference to 'fontyourface_ui_apply_page'
fontyourface_ui_menu in modules/fontyourface_ui/fontyourface_ui.module
Implements hook_menu().

File

modules/fontyourface_ui/fontyourface_ui.module, line 681

Code

function fontyourface_ui_apply_page() {
  $fonts = fontyourface_get_fonts('enabled = 1');
  if (count($fonts) == 0) {
    drupal_set_message(t('No fonts enabled yet, please !enable first.', array(
      '!enable' => l(t('enable some fonts'), 'admin/appearance/fontyourface/browse'),
    )), 'error');
  }

  // if
  drupal_add_css(drupal_get_path('module', 'fontyourface_ui') . '/css/fontyourface_ui.css');
  drupal_add_library('system', 'ui.tabs');
  drupal_add_js(drupal_get_path('module', 'fontyourface_ui') . '/js/apply.js');
  $output = array(
    'header' => array(
      '#markup' => '<div id="fontyourface-apply-tabs"><ul>' . '<li><a href="#apply-by-font">' . t('By Font') . '</a></li>' . '<li><a href="#apply-by-selector">' . t('By CSS Selector') . '</a></li>' . '<li><a href="#apply-in-theme">' . t('In Theme') . '</a></li>' . '</ul>' . '<div id="apply-by-font">',
    ),
    'by_font' => drupal_get_form('fontyourface_ui_apply_by_font_form'),
    'between_font_and_selector' => array(
      '#markup' => '</div>' . '<div id="apply-by-selector">',
    ),
    'by_selector' => drupal_get_form('fontyourface_ui_apply_by_selector_form'),
    'between_selector_and_theme' => array(
      '#markup' => '</div>' . '<div id="apply-in-theme">',
    ),
    'in_theme' => fontyourface_ui_theme_instructions(),
    'footer' => array(
      '#markup' => '</div></div>' . '<div>' . l(t('Browse to enable more fonts.'), 'admin/appearance/fontyourface/browse') . '</div>',
    ),
  );
  return $output;
}