예제 #1
0
$forum_form->addElement(new XoopsFormHidden('isreply', @$isreply));
$forum_form->addElement(new XoopsFormHidden('isedit', @$isedit));
$forum_form->addElement(new XoopsFormHidden('op', @$op));
$button_tray = new XoopsFormElementTray('');
$submit_button = new XoopsFormButton('', 'contents_submit', _SUBMIT, "submit");
$submit_button->setExtra("tabindex='3'");
$cancel_button = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
if (!empty($topic_id)) {
    $extra = "viewtopic.php?topic_id=" . intval($topic_id);
} else {
    $extra = "viewforum.php?forum=" . $forum_obj->getVar('forum_id');
}
$cancel_button->setExtra("onclick='location=\"" . $extra . "\"'");
$cancel_button->setExtra("tabindex='6'");
if (!empty($isreply) && !empty($hidden)) {
    $forum_form->addElement(new XoopsFormHidden('hidden', $hidden));
    $quote_button = new XoopsFormButton('', 'quote', _MD_QUOTE, 'button');
    $quote_button->setExtra("onclick='xoopsGetElementById(\"message\").value=xoopsGetElementById(\"message\").value+ xoopsGetElementById(\"hidden\").value;xoopsGetElementById(\"hidden\").value=\"\";'");
    $quote_button->setExtra("tabindex='4'");
    $button_tray->addElement($quote_button);
}
$preview_button = new XoopsFormButton('', 'btn_preview', _PREVIEW, "button");
$preview_button->setExtra("tabindex='5'");
$preview_button->setExtra('onclick="window.document.forms.' . $forum_form->getName() . '.contents_preview.value=1; window.document.forms.' . $forum_form->getName() . '.submit() ;"');
$forum_form->addElement(new XoopsFormHidden('contents_preview', 0));
$button_tray->addElement($preview_button);
$button_tray->addElement($submit_button);
$button_tray->addElement($cancel_button);
$forum_form->addElement($button_tray);
//$forum_form->display();
$forum_form->assign($xoopsTpl);
예제 #2
0
} else {
    $button[$i] = new XoopsFormButton("", "save", art_constant("MD_SAVE_DRAFT"), "submit");
}
$button[$i]->setExtra("tabindex={$i_tab}");
$help_btn[art_constant("MD_SAVE")] = art_constant("MD_HELP_SAVE");
$help_btn[art_constant("MD_SAVE_DRAFT")] = art_constant("MD_HELP_SAVE_DRAFT");
$i++;
$i_tab++;
$button[$i] = new XoopsFormButton("", "save_edit", art_constant("MD_SAVE_EDIT"), "submit");
$button[$i]->setExtra("tabindex={$i_tab}");
$help_btn[art_constant("MD_SAVE_EDIT")] = art_constant("MD_HELP_SAVE_EDIT");
$i++;
$i_tab++;
$button[$i] = new XoopsFormButton("", "btn_preview", _PREVIEW, "button");
$button[$i]->setExtra("tabindex={$i_tab}");
$button[$i]->setExtra('onclick="window.document.' . $form_art->getName() . '.preview.value=1; window.document.' . $form_art->getName() . '.submit()"');
$form_art->addElement(new XoopsFormHidden('preview', 0));
if ($article_obj->getVar("art_id")) {
    $i++;
    $i_tab++;
    $button[$i] = new XoopsFormButton("", "btn_del", art_constant("MD_DELETE_PAGE"), "button");
    $button[$i]->setExtra("tabindex={$i_tab}");
    $button[$i]->setExtra('onclick="window.document.' . $form_art->getName() . '.del.value=1; window.document.' . $form_art->getName() . '.submit()"');
    $form_art->addElement(new XoopsFormHidden('del', 0));
    if ($isAuthor || $category_handler->getPermission($category_obj, "moderate")) {
        $i++;
        $i_tab++;
        $button[$i] = new XoopsFormButton("", "btn_delete", art_constant("MD_DELETE_ARTICLE"), "button");
        $button[$i]->setExtra("tabindex={$i_tab}");
        $button[$i]->setExtra('onclick="window.document.' . $form_art->getName() . '.delart.value=1; window.document.' . $form_art->getName() . '.submit()"');
        $form_art->addElement(new XoopsFormHidden('delart', 0));