You are here

function theme_anonymous_publishing_cl_admin_spam in Anonymous Publishing 7

Theme function to theme the spambot report in a table format.

File

modules/cl/anonymous_publishing_cl.admin.inc, line 664
Menu callbacks for the CL tabs on the module admin page.

Code

function theme_anonymous_publishing_cl_admin_spam($variables) {
  $form = $variables['form'];
  $output = drupal_render($form['apu_info']);
  $header = array(
    t('id'),
    t('ip-address'),
    t('first seen'),
    t('last seen'),
    t('total hits'),
    t('daily hits'),
    t('ban IP'),
  );
  $rows = array();
  foreach (element_children($form['bots']) as $id) {
    $row = array();
    foreach (element_children($form['bots'][$id]) as $entry_key) {
      unset($form['bots'][$id][$entry_key]['#title']);
      if (isset($form['bots'][$id][$entry_key]['#type']) && 'hidden' == $form['bots'][$id][$entry_key]['#type']) {

        // Hidden field.
      }
      else {
        $row[] = drupal_render($form['bots'][$id][$entry_key]);
      }
    }
    $rows[] = $row;
  }
  if (!$rows) {
    $rows[] = array(
      array(
        'data' => t('There are no IP-addresses for spambots on file.'),
        'colspan' => 7,
      ),
    );
  }
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  $output .= drupal_render_children($form);
  return $output;
}