You are here

function theme_discussthis_admin_settings_theming in Discuss This! 7

Same name and namespace in other branches
  1. 7.2 discussthis.admin.inc \theme_discussthis_admin_settings_theming()

Themer function for the admin setting page.

This method renders an array to configure the node type discussion selection.

1 theme call to theme_discussthis_admin_settings_theming()
discussthis_admin_settings in ./discussthis.admin.inc
Generate the administration form.

File

./discussthis.admin.inc, line 243
Settings callbacks

Code

function theme_discussthis_admin_settings_theming($vars) {

  // Elements to render.
  $element = $vars['element'];

  // Build headers.
  $header = array(
    'Content Type',
    'Forum Container',
    'Input Format',
  );
  $rows = array();

  // Build rows.
  foreach (element_children($element) as $key) {

    // Create the row.
    $row = array();
    $row['data'] = array();

    // Add the row elements.
    foreach ($element[$key] as $fieldname => $value) {

      // Do not render property elements.
      if (substr($fieldname, 0, 1) === "#") {
        continue;
      }
      $row['data'][] = drupal_render($element[$key][$fieldname]);
    }
    $rows[] = $row;
  }

  // Render the table.
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'discussthis_types_config',
    ),
  ));
}