page_title-admin-settings-form.tpl.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * @file
  4. * Template file for the admin settings form. Renders the settings form as a table.
  5. */
  6. $form = &$variables['form'];
  7. $rows = array();
  8. foreach (element_children($form['pattern']) as $key) {
  9. $title = array(
  10. '#markup' => $form['pattern'][$key]['#title'],
  11. '#required' => $form['pattern'][$key]['#required'],
  12. );
  13. unset($form['patterns']['pattern'][$key]['#title']);
  14. $row = array(
  15. array('data' => render($title), 'class' => 'page-type'),
  16. array('data' => render($form['scope'][$key]), 'class' => 'scope'),
  17. );
  18. if (isset($form['showfield'][$key .'_showfield'])) {
  19. $row[] = array('data' => render($form['pattern'][$key]), 'class' => 'pattern');
  20. $row[] = array('data' => render($form['showfield'][$key .'_showfield']), 'class' => 'showfield');
  21. }
  22. else {
  23. $row[] = array('data' => render($form['pattern'][$key]), 'colspan' => 2, 'class' => 'pattern');
  24. }
  25. $rows[] = $row;
  26. }
  27. $headers = array(
  28. array('data' => t('Page Type'), 'class' => 'page-type'),
  29. array('data' => t('Token Scope'), 'class' => 'scope'),
  30. array('data' => t('Pattern'), 'class' => 'pattern'),
  31. array('data' => t('Show Field'), 'class' => 'showfield'),
  32. );
  33. drupal_add_css(drupal_get_path('module', 'page_title') .'/page_title.admin.css', array('type' => 'file', 'preprocess' => FALSE));
  34. print theme('table', array('header' => $headers, 'rows' => $rows, 'attributed' => array('id' => 'page-title-settings')));
  35. //print drupal_render_children($form);