You are here

function theme_cufon_selectors in Cufón 7.2

Returns HTML for an admin selectors form.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.
1 theme call to theme_cufon_selectors()
cufon_admin in includes/cufon.admin.inc
Administration settings page

File

./cufon.module, line 42
Adds simple Cufón support to Drupal.

Code

function theme_cufon_selectors($variables) {
  $form = $variables['form'];
  $headers = array(
    t('Enabled'),
    t('Selector'),
    t('Font family'),
    t('Enable hover state'),
    t('Text shadow'),
  );
  $rows = array();
  foreach (element_children($form) as $key) {

    // Build the table row.
    $row = array(
      'no_striping' => TRUE,
      'data' => array(
        drupal_render($form[$key]['options']['enabled']),
        drupal_render($form[$key]['selector']),
        drupal_render($form[$key]['options']['fontFamily']),
        drupal_render($form[$key]['options']['hover']),
        drupal_render($form[$key]['options']['textShadow']),
      ),
    );

    // Add any additional classes set on the row.
    if (!empty($form[$key]['#attributes']['class'])) {
      $row['class'] = array_merge($row['class'], $form[$key]['#attributes']['class']);
    }
    $rows[] = $row;
  }
  $output = theme('table', array(
    'header' => $headers,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'cufon-selector-table',
    ),
  ));
  $output .= drupal_render_children($form);
  return $output;
}