You are here

function theme_guestbook_form_entry_form in Guestbook 5

Same name and namespace in other branches
  1. 5.2 guestbook.module \theme_guestbook_form_entry_form()
  2. 6.2 guestbook.module \theme_guestbook_form_entry_form()
  3. 6 guestbook.module \theme_guestbook_form_entry_form()
  4. 7.2 guestbook.module \theme_guestbook_form_entry_form()

File

./guestbook.module, line 528

Code

function theme_guestbook_form_entry_form($form) {
  $output = '';
  $access = $form['access']['#value'];
  $display = $form['display']['#value'];
  $uid = $form['uid']['#value'];
  switch ($access) {
    case 'allowed':
      if ($display == 'link') {

        // Output only a link to a page with the form.
        $output .= '<p>&raquo; ' . l(t('Add guestbook entry'), "guestbook/{$uid}/form") . '</p>';
      }
      else {
        $output .= $display == 'page' ? '' : '<h3>' . t('Add guestbook entry') . '</h3>';
        $output .= drupal_render($form);
      }
      break;
    case 'own guestbook':
      $output .= ' ';
      break;
    case 'not logged in':
      $output .= '<p class="links">&raquo; ' . t('You must be logged in to post a comment.') . '</p>';
      break;
    case 'not allowed':
      $output .= '<p class="links">&raquo; ' . t('You are not allowed to post in this guestbook.') . '</p>';
      break;
  }
  return $output;
}