$calc_name = _formulize_DE_CALC_COUNT; break; case "per": $calc_name = _formulize_DE_CALC_PER; break; } $tray = new xoopsFormElementTray("   " . $calc_name, "<br>"); $tempcalc1 = new xoopsFormSelect("", $tempname, $current_val); $tempcalc1->addOption("noblanks", _formulize_DE_CALCNOBLANKS); $tempcalc1->addOption("all", _formulize_DE_CALCALL); $tempcalc1->addOption("onlyblanks", _formulize_DE_CALCONLYBLANKS); $tempcalc1->addOption("justnoblanks", _formulize_DE_CALCJUSTNOBLANKS); $tempcalc1->addOption("justnozeros", _formulize_DE_CALCJUSTNOZEROS); $tempcalc1->addOption("custom", _formulize_DE_CALCCUSTOM); $tempcalc1->setExtra("onchange='javascript:setCalcCustom(\"" . $calc . $hidden['column'] . "\");'"); $tempcalcCustom = new xoopsFormText("", $tempname . "_custom", 12, 255, $current_val_custom); $tempcalcCustom->setExtra("onclick='javascript:window.document.pickcalc.elements[\"" . $calc . $hidden['column'] . "\"].options[5].selected = true;window.document.pickcalc.elements[\"" . $calc . $hidden['column'] . "\"].value=\"custom\"'"); $tempcalclabel = new xoopsFormLabel("", _formulize_DE_CALC_BTEXT . " " . $tempcalc1->render() . " " . $tempcalcCustom->render()); $groupingDefaults = explode("!@^%*", $_POST['grouping_' . $calc . "_" . $hidden['column']]); // get the individual grouping settings from the one value that has been passed back $groupingDefaults1 = $groupingDefaults[0]; if (isset($_POST['grouping2_' . $calc . "_" . $hidden['column']])) { $groupingDefaults2 = $_POST['grouping2_' . $calc . "_" . $hidden['column']]; } elseif (isset($groupingDefaults[1])) { $groupingDefaults2 = $groupingDefaults[1]; } else { $groupingDefaults2 = ""; } // grouping option $grouping = new xoopsFormSelect(_formulize_DE_CALC_GTEXT, 'grouping_' . $calc . "_" . $hidden['column'], $groupingDefaults1); $grouping->addOption("none", _formulize_DE_NOGROUPING);
$op->setExtra("onfocus=\"javascript:window.document.setnot.setfor[1].checked=true\""); $term = new xoopsFormText('', 'new_term', 10, 255); $term->setExtra("onfocus=\"javascript:window.document.setnot.setfor[1].checked=true\""); $opterm->addElement($element); $opterm->addElement($op); $opterm->addElement($term); $addcon = new xoopsFormButton('', 'addcon', _formulize_DE_SETNOT_ADDCON, 'submit'); $addcon->setExtra("onfocus=\"javascript:window.document.setnot.setfor[1].checked=true\""); $conditionui = "<br />{$conditionlist}" . $opterm->render() . "<br />" . $addcon->render(); $setfor_con = new xoopsFormRadio('', 'setfor', $_POST['setfor']); $setfor_con->addOption('con', _formulize_DE_SETNOT_FOR_CON . $conditionui); $setfor->addElement($setfor_all); $setfor->addElement($setfor_con); $setnot->addElement($setfor); if ($canSetNots) { $setnot_cust_template = new xoopsFormText(_formulize_DE_SETNOT_TEMP, 'template', 50, 255, $_POST['template']); $setnot_cust_template->setDescription(_formulize_DE_SETNOT_TEMP_DESC); $setnot->addElement($setnot_cust_template); $setnot->addElement(new xoopsFormText(_formulize_DE_SETNOT_SUBJ, 'subject', 50, 255, $_POST['subject'])); } $setnot->addElement(new xoopsFormButton('', 'save', _formulize_DE_SETNOT_SAVE, 'submit')); print $setnot->render(); // if there are notifications to show if (!$noNots) { print "<br />\n"; $notlist = new xoopsThemeForm(_formulize_DE_NOTLIST, 'notlist', XOOPS_URL . "/modules/formulize/include/setnot.php?fid={$fid}"); foreach ($nots as $thisnot) { $text .= _formulize_DE_NOT_WHENTEXT; switch ($thisnot['not_cons_event']) { case "new_entry": $text .= _formulize_DE_SETNOT_WHEN_NEW;
function drawPageUI($pageNumber, $pageTitle, $elements, $conditions, $form, $options, $ops) { // insert page here button $form->addElement(new xoopsFormButton('', 'insertpage' . $pageNumber, _AM_FORMULIZE_SCREEN_INSERTPAGE, 'submit')); // pageNumbers start at 0, since that's how the arrays are indexed, they start from zero // but whatever we show users must start at 1 (there is no page 0 as far as they are concerned), so we add one to make the visiblePageNumber $visiblePageNumber = $pageNumber + 1; // page title $pageTitleBox = new xoopsFormText(_AM_FORMULIZE_SCREEN_PAGETITLE . ' ' . $visiblePageNumber, 'pagetitle_' . $pageNumber, 50, 255, $pageTitle); $form->addElement($pageTitleBox, true); // elements $elementSelection = new xoopsFormSelect(_AM_FORMULIZE_SCREEN_A_PAGE . ' ' . $visiblePageNumber . '<br><br><input type=submit name=delete' . $pageNumber . ' value="' . _AM_FORMULIZE_DELETE_THIS_PAGE . '" onclick="javascript:return confirmDeletePage(\'' . $pageNumber . '\');">', 'page' . $pageNumber, $elements, 10, true); $elementSelection->addOptionArray($options); $form->addElement($elementSelection); // page conditions -- september 6 2007 if (!isset($conditions['pagecons'])) { $conditionsYesNo = 'none'; } else { $conditionsYesNo = $conditions['pagecons']; } $conditionsTray = new xoopsFormElementTray(_AM_FORMULIZE_SCREEN_CONS_PAGE . ' ' . $visiblePageNumber, '<br />'); $conditionsTray->setDescription(_AM_FORMULIZE_SCREEN_CONS_HELP); $nocons = new xoopsFormRadio('', 'pagecons' . $pageNumber, $conditionsYesNo); $nocons->addOption('none', _AM_FORMULIZE_SCREEN_CONS_NONE); $conditionlist = ""; foreach ($conditions['details']['elements'] as $conIndex => $elementValue) { $form->addElement(new xoopsFormHidden('pageelements' . $pageNumber . '[]', $elementValue)); $form->addElement(new xoopsFormHidden('pageops' . $pageNumber . '[]', $conditions['details']['ops'][$conIndex])); $form->addElement(new xoopsFormHidden('pageterms' . $pageNumber . '[]', $conditions['details']['terms'][$conIndex])); $conditionlist .= $options[$conditions['details']['elements'][$conIndex]] . " " . $conditions['details']['ops'][$conIndex] . " " . $conditions['details']['terms'][$conIndex] . "<br />"; } // setup the operator boxes... $opterm = new xoopsFormElementTray('', " "); $element = new xoopsFormSelect('', 'pageelements' . $pageNumber . '[]'); $element->setExtra("onfocus=\"javascript:window.document.editscreenform.pagecons" . $pageNumber . "[1].checked=true\""); $element->addOptionArray($options); $op = new xoopsFormSelect('', 'pageops' . $pageNumber . '[]'); $op->addOptionArray($ops); $op->setExtra("onfocus=\"javascript:window.document.editscreenform.pagecons" . $pageNumber . "[1].checked=true\""); $term = new xoopsFormText('', 'pageterms' . $pageNumber . '[]', 10, 255); $term->setExtra("onfocus=\"javascript:window.document.editscreenform.pagecons" . $pageNumber . "[1].checked=true\""); $opterm->addElement($element); $opterm->addElement($op); $opterm->addElement($term); $addcon = new xoopsFormButton('', 'addcon', _AM_FORMULIZE_SCREEN_CONS_ADDCON, 'submit'); $addcon->setExtra("onfocus=\"javascript:window.document.editscreenform.pagecons" . $pageNumber . "[1].checked=true\""); $conditionui = "<br />{$conditionlist}<nobr>" . $opterm->render() . "</nobr><br />" . $addcon->render(); $yescons = new xoopsFormRadio('', 'pagecons' . $pageNumber, $conditionsYesNo); $yescons->addOption('yes', _AM_FORMULIZE_SCREEN_CONS_YES . $conditionui); $conditionsTray->addElement($nocons); $conditionsTray->addElement($yescons); $form->addElement($conditionsTray); return $form; }
function render($ele_value, $caption, $markupName, $isDisabled, $element, $entry_id, $screen) { if ($isDisabled) { $formElement = new xoopsFormLabel($caption, $this->formatDataForList($ele_value, $element->getVar('ele_handle'), $entry_id)); } else { static $scriptIncluded = false; if (!$scriptIncluded) { global $xoTheme; $xoTheme->addStylesheet(XOOPS_URL . '/modules/formulize/libraries/jquery/timeentry/jquery.timeentry.css', array('media' => 'screen')); $xoTheme->addScript(XOOPS_URL . '/modules/formulize/libraries/jquery/timeentry/jquery.plugin.min.js', array('type' => 'text/javascript')); $xoTheme->addScript(XOOPS_URL . '/modules/formulize/libraries/jquery/timeentry/jquery.timeentry.min.js', array('type' => 'text/javascript')); $xoTheme->addScript(XOOPS_URL . '/modules/formulize/libraries/jquery/timeentry/jquery.mousewheel.js', array('type' => 'text/javascript')); $scriptIncluded = true; } $timeElement = new xoopsFormText($caption, $markupName, 10, 10, $ele_value); // caption, markup name, size, maxlength, default value, according to the xoops form class $timeScript = "<script type='text/javascript'>jQuery(document).ready(function(){jQuery('#{$markupName}').timeEntry({spinnerImage: '" . XOOPS_URL . "/modules/formulize/libraries/jquery/timeentry/spinnerDefault.png'});});</script>\n"; $formElement = new xoopsFormLabel($caption, $timeElement->render() . $timeScript); } return $formElement; }
function formulize_createFilterUIMatch($newElementName, $formName, $filterName, $options, $newOpName, $newTermName, $conditionlist) { // setup the new element, operator, term boxes $new_elementOpTerm = new xoopsFormElementTray('', " "); $element = new xoopsFormSelect('', $newElementName); $element->addOptionArray($options); $op = new xoopsFormSelect('', $newOpName); $ops['='] = "="; $ops['NOT'] = "NOT"; $ops['>'] = ">"; $ops['<'] = "<"; $ops['>='] = ">="; $ops['<='] = "<="; $ops['LIKE'] = "LIKE"; $ops['NOT LIKE'] = "NOT LIKE"; $op->addOptionArray($ops); $term = new xoopsFormText('', $newTermName, 10, 255); $term->setExtra(" class=\"condition_term\" "); $new_elementOpTerm->addElement($element); $new_elementOpTerm->addElement($op); $new_elementOpTerm->addElement($term); return "<br />{$conditionlist}" . $new_elementOpTerm->render(); }