当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsFormElementTray::setClass方法代码示例

本文整理汇总了PHP中XoopsFormElementTray::setClass方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsFormElementTray::setClass方法的具体用法?PHP XoopsFormElementTray::setClass怎么用?PHP XoopsFormElementTray::setClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsFormElementTray的用法示例。


在下文中一共展示了XoopsFormElementTray::setClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addSubmitButton

function addSubmitButton($form, $subButtonText, $go_back = "", $currentURL, $button_text, $settings, $entry, $fids, $formframe, $mainform, $cur_entry, $profileForm, $elements_allowed = "", $allDoneOverride = false, $printall = 0, $screen = null)
{
    //nmc 2007.03.24 - added $printall
    if ($printall == 2) {
        // 2 is special setting in multipage screens that means do not include any printable buttons of any kind
        return $form;
    }
    if (strstr($currentURL, "printview.php")) {
        // don't do anything if we're on the print view
        return $form;
    } else {
        drawGoBackForm($go_back, $currentURL, $settings, $entry);
        if (!$button_text or $button_text == "{NOBUTTON}" and $go_back['form'] > 0) {
            // presence of a goback form (ie: parent form) overrides {NOBUTTON} -- assumption is the save button will not also be overridden at the same time
            $button_text = _formulize_DONE;
        } elseif (is_array($button_text)) {
            if (!$button_text[0]) {
                $done_text_temp = _formulize_DONE;
            } else {
                $done_text_temp = $button_text[0];
            }
            if (!$button_text[1]) {
                $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
//.........这里部分代码省略.........
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:101,代码来源:formdisplay.php


注:本文中的XoopsFormElementTray::setClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。