本文整理汇总了PHP中XoopsFormElementTray::getElements方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsFormElementTray::getElements方法的具体用法?PHP XoopsFormElementTray::getElements怎么用?PHP XoopsFormElementTray::getElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsFormElementTray
的用法示例。
在下文中一共展示了XoopsFormElementTray::getElements方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addSubmitButton
//.........这里部分代码省略.........
$save_text_temp = _formulize_SAVE;
} else {
$save_text_temp = $button_text[1];
}
}
// override -- the "no-all-done-button" config option turns off the all done button and changes save into a save-and-leave button
// need to grab the $nosubforms variable created by the multiple page function, so we know to put the printable view button (and nothing else) on the screen for multipage forms
global $nosubforms;
if (!$profileForm and ($save_text_temp != "{NOBUTTON}" or $nosubforms)) {
// do not use printable button for profile forms, or forms where there is no Save button (ie: a non-standard saving process is in use and access to the normal printable option may be prohibited)
$printbutton = new XoopsFormButton('', 'printbutton', _formulize_PRINTVIEW, 'button');
if (is_array($elements_allowed)) {
$ele_allowed = implode(",", $elements_allowed);
}
$printbutton->setExtra("onclick='javascript:PrintPop(\"{$ele_allowed}\");'");
$rendered_buttons = $printbutton->render();
// nmc 2007.03.24 - added
if ($printall) {
// nmc 2007.03.24 - added
$printallbutton = new XoopsFormButton('', 'printallbutton', _formulize_PRINTALLVIEW, 'button');
// nmc 2007.03.24 - added
$printallbutton->setExtra("onclick='javascript:PrintAllPop();'");
// nmc 2007.03.24 - added
$rendered_buttons .= " " . $printallbutton->render();
// nmc 2007.03.24 - added
}
$buttontray = new XoopsFormElementTray($rendered_buttons, " ");
// nmc 2007.03.24 - amended [nb: FormElementTray 'caption' is actually either 1 or 2 buttons]
} else {
$buttontray = new XoopsFormElementTray("", " ");
}
$buttontray->setClass("no-print");
if ($subButtonText == _formulize_SAVE) {
// _formulize_SAVE is passed only when the save button is allowed to be drawn
if ($save_text_temp) {
$subButtonText = $save_text_temp;
}
if ($subButtonText != "{NOBUTTON}") {
$saveButton = new XoopsFormButton('', 'submitx', trans($subButtonText), 'button');
// doesn't use name submit since that conflicts with the submit javascript function
$saveButton->setExtra("onclick=javascript:validateAndSubmit();");
$buttontray->addElement($saveButton);
// also add in the save and leave button
$saveAndLeaveButton = new XoopsFormButton('', 'submit_save_and_leave', trans(_formulize_SAVE_AND_LEAVE), 'button');
$saveAndLeaveButton->setExtra("onclick=javascript:validateAndSubmit('leave');");
$buttontray->addElement($saveAndLeaveButton);
}
}
if (($button_text != "{NOBUTTON}" and !$done_text_temp or isset($done_text_temp) and $done_text_temp != "{NOBUTTON}") and !$allDoneOverride) {
if ($done_text_temp) {
$button_text = $done_text_temp;
}
$donebutton = new XoopsFormButton('', 'donebutton', trans($button_text), 'button');
$donebutton->setExtra("onclick=javascript:verifyDone();");
$buttontray->addElement($donebutton);
}
if (!$profileForm) {
// do not use printable button for profile forms
$newcurrentURL = XOOPS_URL . "/modules/formulize/printview.php";
print "<form name='printview' action='" . $newcurrentURL . "' method=post target=_blank>\n";
// add security token
if (isset($GLOBALS['xoopsSecurity'])) {
print $GLOBALS['xoopsSecurity']->getTokenHTML();
}
$currentPage = "";
$screenid = "";
if ($screen) {
$screenid = $screen->getVar('sid');
// check for a current page setting
if (isset($settings['formulize_currentPage'])) {
$currentPage = $settings['formulize_currentPage'];
}
}
print "<input type=hidden name=screenid value='" . $screenid . "'>";
print "<input type=hidden name=currentpage value='" . $currentPage . "'>";
print "<input type=hidden name=lastentry value=" . $cur_entry . ">";
if ($go_back['form']) {
// we're on a sub, so display this form only
print "<input type=hidden name=formframe value=" . $fids[0] . ">";
} else {
// otherwise, display like normal
print "<input type=hidden name=formframe value='" . $formframe . "'>";
print "<input type=hidden name=mainform value='" . $mainform . "'>";
}
if (is_array($elements_allowed)) {
$ele_allowed = implode(",", $elements_allowed);
print "<input type=hidden name=elements_allowed value='" . $ele_allowed . "'>";
} else {
print "<input type=hidden name=elements_allowed value=''>";
}
print "</form>";
//added by Cory Aug 27, 2005 to make forms printable
}
$trayElements = $buttontray->getElements();
if (count($trayElements) > 0 or $nosubforms) {
$form->addElement($buttontray);
}
return $form;
}
}