You are here

function theme_page_title_admin_settings in Page Title 7

File

./page_title.admin.inc, line 136
Admin include file.

Code

function theme_page_title_admin_settings($variables) {
  $form = $variables['form'];
  $rows = array();
  foreach (element_children($form['patterns']['pattern']) as $key) {
    $title = array(
      '#markup' => $form['patterns']['pattern'][$key]['#title'],
      '#required' => $form['patterns']['pattern'][$key]['#required'],
    );
    unset($form['patterns']['pattern'][$key]['#title']);
    $row = array(
      render($title),
      render($form['patterns']['scope'][$key]),
      render($form['patterns']['pattern'][$key]),
      isset($form['patterns']['showfield'][$key . '_showfield']) ? render($form['patterns']['showfield'][$key . '_showfield']) : '',
    );
    $rows[] = $row;
  }
  $output = theme('table', array(
    'header' => array(
      t('Page Type'),
      t('Token Scope'),
      t('Pattern'),
      t('Show Field'),
    ),
    'rows' => $rows,
  ));
  $output .= drupal_render_children($form);
  return $output;
}