function theme_guestbook_form_entry_form in Guestbook 6.2
Same name and namespace in other branches
- 5.2 guestbook.module \theme_guestbook_form_entry_form()
- 5 guestbook.module \theme_guestbook_form_entry_form()
- 6 guestbook.module \theme_guestbook_form_entry_form()
- 7.2 guestbook.module \theme_guestbook_form_entry_form()
File
- ./
guestbook.module, line 674
Code
function theme_guestbook_form_entry_form($form_state) {
$output = '';
// @todo Since #access is set on the overall form now, this function along
// with the switch below is no longer executed.
$access = $form_state['#access'];
$display = $form_state['display']['#value'];
$uid = $form_state['uid']['#value'];
switch ($access) {
case 'allowed':
if ($display == 'link') {
// Output only a link to a page with the form.
$output .= '<p>» ' . l(t('Add guestbook entry'), guestbook_path($uid) . '/sign') . '</p>';
}
else {
$output .= $display == 'page' ? '' : '<h3>' . t('Add guestbook entry') . '</h3>';
$output .= drupal_render($form_state);
}
break;
case 'own guestbook':
if (isset($form_state['entry_id'])) {
drupal_set_title(t('Edit guestbook entry'));
$output .= drupal_render($form_state);
}
else {
$output .= ' ';
}
break;
case 'not logged in':
$output .= '<p class="links">» ' . t('You must be logged in to post a comment.') . '</p>';
break;
case 'not allowed':
$output .= '<p class="links">» ' . t('You are not allowed to post in this guestbook.') . '</p>';
break;
}
return $output;
}