function theme_guestbook_form_entry_form in Guestbook 5.2
Same name and namespace in other branches
- 5 guestbook.module \theme_guestbook_form_entry_form()
- 6.2 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 585
Code
function theme_guestbook_form_entry_form($form) {
$output = '';
// @todo Since #access is set on the overall form now, this function along
// with the switch below is no longer executed.
$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>» ' . 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':
if (isset($form['entry_id'])) {
drupal_set_title(t('Edit guestbook entry'));
$output .= drupal_render($form);
}
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;
}