function theme_privatemsg_admin_settings_display_fields

7-2 privatemsg.theme.inc theme_privatemsg_admin_settings_display_fields($variables)
6-2 privatemsg.theme.inc theme_privatemsg_admin_settings_display_fields($element = array())

Output the admin settings display fields and weight settings as a drag and drop sortable table.

Related topics

2 string references to the theme hook from theme_privatemsg_admin_settings_display_fields()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

privatemsg_admin_settings in ./privatemsg.admin.inc
privatemsg_theme in ./privatemsg.module

File

./privatemsg.theme.inc, line 160
Theme functions for privatemsg.

Code

function theme_privatemsg_admin_settings_display_fields($variables) {
  $element = $variables['element'];
  $header = array(array(
      'data' => t('Field'),
      'class' => array('field'),
    ), array(
      'data' => t('Enable'),
      'class' => array('enable'),
    ), array(
      'data' => t('Weight'),
      'class' => array('weight'),
    ));
  $rows = array();
  foreach (element_children($element['privatemsg_display_fields']) as $child) {
    $row = array();

    // Title.
    $row[] = array(
      'data' => $element['privatemsg_display_fields'][$child]['#title'],
      'class' => array('field'),
    );
    unset($element['privatemsg_display_fields'][$child]['#title']);

    // Enable checkbox.
    $row[] = array(
      'data' => drupal_render($element['privatemsg_display_fields'][$child]),
      'class' => array('enable'),
    );

    // Weight selector.
    unset($element['privatemsg_display_fields_weights'][$child]['#title']);
    $element['privatemsg_display_fields_weights'][$child]['#attributes']['class'] = array('privatemsg-display-fields-weight');
    $row[] = array(
      'data' => drupal_render($element['privatemsg_display_fields_weights'][$child]),
      'class' => array('weight'),
    );

    $rows[] = array(
      'data' => $row,
      'class' => array('draggable'),
    );
  }
  if (!empty($rows)) {
    drupal_add_tabledrag('privatemsg-list-display-fields', 'order', 'sibling', 'privatemsg-display-fields-weight');
    return theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'privatemsg-list-display-fields'))) . drupal_render_children($element);
  }
  else {
    return drupal_render_children($element);
  }
}