You are here

function theme_legal_administration in Legal 6.7

Same name and namespace in other branches
  1. 5 legal.module \theme_legal_administration()
  2. 6.8 legal.admin.inc \theme_legal_administration()
  3. 7.2 legal.admin.inc \theme_legal_administration()
  4. 7 legal.admin.inc \theme_legal_administration()

File

./legal.module, line 323

Code

function theme_legal_administration($form) {
  if (empty($form['current_id']['#value'])) {
    $output = '<p><strong>' . t('Terms & Conditions will not be shown to users, as no T&C have been saved.') . '</strong></p>';
  }
  else {
    $output = '<h4>' . t('Current Version') . '</h4><p><strong>' . t('Version ID:') . '</strong> ' . $form['current_id']['#value'] . '<br /><strong>' . t('Last saved:') . '</strong> ' . date("l jS \\of F Y h:i:s A", $form['current_date']['#value']) . '</p>';
  }

  // preview
  if (empty($form['legal']['conditions']['#value'])) {
    drupal_render($form['legal']);
  }
  else {
    $output .= '<div id="preview">';
    $output .= '<h3>' . t('Preview') . '</h3>';
    $form = theme('legal_display', $form);
    $output .= drupal_render($form['legal']);
    $output .= '</div>';
  }
  $output .= drupal_render($form);
  return $output;
}