Exemplo n.º 1
0
$guestbookCreateMenu = $page->getMenu();
$guestbookCreateMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// Html des Modules ausgeben
if ($getGboId > 0) {
    $mode = '3';
} else {
    $mode = '1';
}
// show form
$form = new HtmlForm('guestbook_edit_form', $g_root_path . '/adm_program/modules/guestbook/guestbook_function.php?id=' . $getGboId . '&headline=' . $getHeadline . '&mode=' . $mode, $page);
if ($gCurrentUser->getValue('usr_id') > 0) {
    // registered users should not change their name
    $form->addInput('gbo_name', $gL10n->get('SYS_NAME'), $guestbook->getValue('gbo_name'), array('maxLength' => 60, 'property' => FIELD_DISABLED));
} else {
    $form->addInput('gbo_name', $gL10n->get('SYS_NAME'), $guestbook->getValue('gbo_name'), array('maxLength' => 60, 'property' => FIELD_REQUIRED));
}
$form->addInput('gbo_email', $gL10n->get('SYS_EMAIL'), $guestbook->getValue('gbo_email'), array('type' => 'email', 'maxLength' => 254));
$form->addInput('gbo_homepage', $gL10n->get('SYS_WEBSITE'), $guestbook->getValue('gbo_homepage'), array('maxLength' => 50));
$form->addEditor('gbo_text', $gL10n->get('SYS_MESSAGE'), $guestbook->getValue('gbo_text'), array('property' => FIELD_REQUIRED, 'toolbar' => 'AdmidioGuestbook'));
// if captchas are enabled then visitors of the website must resolve this
if (!$gValidLogin && $gPreferences['enable_mail_captcha'] == 1) {
    $form->openGroupBox('gb_confirmation_of_entry', $gL10n->get('SYS_CONFIRMATION_OF_INPUT'));
    $form->addCaptcha('captcha', $gPreferences['captcha_type']);
    $form->closeGroupBox();
}
// show information about user who creates the recordset and changed it
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
$form->addHtml(admFuncShowCreateChangeInfoById($guestbook->getValue('gbo_usr_id_create'), $guestbook->getValue('gbo_timestamp_create'), $guestbook->getValue('gbo_usr_id_change'), $guestbook->getValue('gbo_timestamp_change')));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();