You are here

function theme_context_prefix_settings_form in Context 5

Theme function for context_prefix_settings_form()

File

context_prefix/context_prefix.module, line 507

Code

function theme_context_prefix_settings_form($form) {
  $output = '';
  $rows = array();
  foreach (element_children($form) as $id) {
    $row = array();
    if (isset($form[$id]['#provider'])) {
      $name = $form[$id]['#title'];
      $description = $form[$id]['#description'];
      unset($form[$id]['#title']);
      unset($form[$id]['#description']);
      $row[] = "<strong>{$name}</strong><div class='description'>{$description}</div>";
      foreach (element_children($form[$id]) as $item) {
        unset($form[$id][$item]['#title']);
        $row[] = drupal_render($form[$id][$item]);
      }
    }
    $rows[] = $row;
  }
  $output .= theme('table', array(
    t('Provider'),
    t('Prefix method'),
    t('Key'),
  ), $rows);
  $output .= drupal_render($form);
  drupal_add_js(drupal_get_path("module", "context_prefix") . "/context_prefix_admin.js");
  return $output;
}