You are here

function theme_modr8_form in modr8 5

Same name and namespace in other branches
  1. 6 modr8_admin.inc \theme_modr8_form()
  2. 7 modr8_admin.inc \theme_modr8_form()

Themes the content moderation form.

1 theme call to theme_modr8_form()
modr8_form in ./modr8_admin.inc

File

./modr8_admin.inc, line 200

Code

function theme_modr8_form(&$form) {
  $headers = array(
    t('Operations'),
    t('Content'),
  );
  foreach (element_children($form) as $key) {

    // Only do this for nodes; not the submit button.
    if (is_numeric($key)) {
      $row = array();
      if (variable_get('modr8_send_approve', FALSE) || variable_get('modr8_send_deny', FALSE)) {
        $note_field = drupal_render($form[$key]['note']);
      }
      $row[] = array(
        'data' => drupal_render($form[$key]['ops']) . $note_field,
        'style' => 'vertical-align:top;',
      );

      // Apply extra filtering to insure we don't have nested form elements,
      // unexpected script, etc.
      $preview = filter_xss_admin($form[$key]['preview']['#value']);
      if (!empty($form[$key]['log_link']['#value'])) {
        $preview .= '<div><em>' . drupal_render($form[$key]['log_link']) . '</em></div>';
      }
      $row[] = array(
        'data' => $preview,
        'style' => 'vertical-align:top;',
      );
      $rows[] = $row;
    }
  }
  $output = theme('table', $headers, $rows);
  $output .= drupal_render($form);
  return $output;
}