You are here

function _cufon_selector_form in Cufón 7.2

@file Provides the administration page for Cufon.

1 call to _cufon_selector_form()
cufon_admin in includes/cufon.admin.inc
Administration settings page

File

includes/cufon.admin.inc, line 7
Provides the administration page for Cufon.

Code

function _cufon_selector_form($selector = array(), $new = FALSE) {

  // Read fonts form cache if possible
  // and generate list for display
  $fonts['autoDetect'] = '-- AutoDetect --';
  foreach (_cufon_find_fonts() as $family => $file) {
    $fonts[$family] = $family;
  }
  $form = array(
    'selector' => array(
      '#type' => 'textfield',
      '#size' => 60,
      '#maxlength' => 128,
      '#default_value' => empty($selector['selector']) ? NULL : $selector['selector'],
    ),
    'options' => array(
      '#tree' => TRUE,
      'enabled' => array(
        '#type' => 'checkbox',
        '#default_value' => empty($selector['options']['enabled']) ? NULL : $selector['options']['enabled'],
      ),
      'fontFamily' => array(
        '#type' => 'select',
        '#options' => $fonts,
        '#default_value' => empty($selector['options']['fontFamily']) ? NULL : $selector['options']['fontFamily'],
      ),
      'hover' => array(
        '#type' => 'checkbox',
        '#default_value' => empty($selector['options']['hover']) ? 0 : $selector['options']['hover'],
      ),
      'textShadow' => array(
        '#type' => 'textfield',
        '#size' => 30,
        '#maxlength' => 128,
        '#default_value' => empty($selector['options']['textShadow']) ? NULL : $selector['options']['textShadow'],
      ),
    ),
  );
  return $form;
}