You are here

function theme_anonymous_publishing_pet_realnames in Anonymous Publishing 7

Theme function to theme the real names form in a table format.

File

modules/pet/anonymous_publishing_pet.module, line 194
Main hooks for Anonymous Publishing PET module.

Code

function theme_anonymous_publishing_pet_realnames($variables) {
  $form = $variables['form'];
  $output = drupal_render($form['apu_info']);
  $header = array(
    t('rnid'),
    t('nid'),
    t('cid'),
    t('real name (#uid)'),
    t('subject'),
  );
  $rows = array();
  foreach (element_children($form['realnames']) as $nid) {
    $row = array();
    foreach (element_children($form['realnames'][$nid]) as $entry_key) {
      unset($form['realnames'][$nid][$entry_key]['#title']);
      $row[] = drupal_render($form['realnames'][$nid][$entry_key]);
    }
    $rows[] = $row;
  }
  if (!$rows) {
    $rows[] = array(
      array(
        'data' => t('There is no real names for authenticated users publishing as anonymous on file.'),
        'colspan' => 4,
      ),
    );
  }
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  $output .= drupal_render_children($form);
  $output .= theme('admin_block', array(
    'title' => 'title',
    'content' => 'content',
  ));
  $output .= drupal_render($form['addnode']);
  return $output;
}