$calcs['avg'] = _formulize_DE_CALC_AVG; $calcs['min'] = _formulize_DE_CALC_MIN; $calcs['max'] = _formulize_DE_CALC_MAX; $calcs['count'] = _formulize_DE_CALC_COUNT; $calcs['per'] = _formulize_DE_CALC_PER; $calculations = new xoopsFormSelect(_formulize_DE_CALC_CALCS, 'calculations', '', count($calcs), true); $calculations->addOptionArray($calcs); $subButton = new xoopsFormButton('', 'submitx', _formulize_DE_CALCSUB, 'submit'); $pickcalc->addElement($columns); $pickcalc->addElement($calculations); $pickcalc->addElement($subButton); //$pickcalc->addElement(new xoopsFormHidden("frid", $frid)); //$pickcalc->addElement(new xoopsFormHidden("fid", $fid)); //$doneTray = new xoopsFormElementTray(_formulize_DE_REQDCALCS, "<br>"); $doneButton = new xoopsFormButton('', 'done', _formulize_DE_CALCGO, 'button'); $doneButton->setExtra("onclick=\"javascript:sendCalcs(this.form);return false;\""); //$nolistdisplay = new xoopsFormCheckbox('', 'nolistdisplay', $_POST['nolistdisplay']); //$nolistdisplay->addOption("1", _formulize_DE_CALC_LISTDISPLAY); //$doneTray->addElement($doneButton); //$doneTray->addElement($nolistdisplay); if (count($returned['rc']) > 0) { $pickcalc->insertBreak("</td></tr></table><table class=outer><tr><th colspan=2>" . _formulize_DE_REQDCALCS . "</th></tr><tr><td class=even colspan=2><center>" . $doneButton->render() . "</center>", ""); // $pickcalc->addElement($doneButton); } foreach ($returned['rc'] as $hidden) { switch ($hidden['column']) { case "creation_uid": $colname = _formulize_DE_CALC_CREATOR; break; case "mod_uid": $colname = _formulize_DE_CALC_MODIFIER;
$ops['NOT'] = "NOT"; $ops['>'] = ">"; $ops['<'] = "<"; $ops['>='] = ">="; $ops['<='] = "<="; $ops['LIKE'] = "LIKE"; $ops['NOT LIKE'] = "NOT LIKE"; $op->addOptionArray($ops); $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
$pubgrouplist = new xoopsFormSelect(_formulize_DE_SAVE_PUBGROUPS, 'pubgrouplist', $lastpubgroups, $size, true); $pubgrouplist->addOptionArray($publishgroups); $lockcontrols = new xoopsFormElementTray(_formulize_DE_SAVE_LOCKCONTROLS, "<br>"); $yes = new xoopsFormRadio('', 'lockcontrols', $currentlock); $yes->addOption("1", _YES); $no = new xoopsFormRadio('', 'lockcontrols', $currentlock); $no->addOption("0", _NO); $lockcontrols->addElement($yes); $lockcontrols->addElement($no); $saveform->addElement($pubgrouplist); $saveform->addElement($lockcontrols); } $viewselection = new xoopsFormHidden("viewselection", ""); $saveform->addElement($viewselection); $subButton = new xoopsFormButton('', 'submitx', _formulize_DE_SAVE_BUTTON, 'button'); $subButton->setExtra("onclick=\"javascript:saveSettings(this.form);\""); $saveform->addElement($subButton); if ($pubflag) { $saveform->insertBreak(_formulize_DE_SAVE_LOCKCONTROLS_HELP1 . " " . _formulize_DE_SAVE_LOCKCONTROLS_HELP2, "head"); } saveJavascript($pubflag); print $saveform->render(); print "</td><td width=5%></td></tr></table>"; print "</center></body>"; print "</HTML>"; // THIS FUNCTION RETURNS THE ARRAY OF OPTIONS FOR THE SAVE BOX, PLUS THE DEFAULT SELECTION function makeSaveList($s_reports, $ns_reports, $other_p_reports, $other_np_reports, $lastloaded, $viewselection) { // reports to include in the list are the saved ones, plus the other_p/np ones // default value is only derived from the actual reports, so if viewselection is anything other than a valid report name, then the initial [save as new] option gets selected $saveoptions["new"] = _formulize_DE_SAVE_AS;
} } else { exit("Error: no advanced scope permission detected."); } include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; print "<HTML>"; print "<head>"; print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . _CHARSET . "\" />"; print "<title>" . _formulize_DE_PICKASCOPE . "</title>\n"; scopeJavascript(); print "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"" . XOOPS_URL . "/xoops.css\" />\n"; $themecss = xoops_getcss(); //$themecss = substr($themecss, 0, -6); //$themecss .= ".css"; print "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"{$themecss}\" />\n"; print "</head>\n"; print "<body style=\"background: white; margin-top:20px;\"><center>"; print "<table style=\"width: 100%;\"><tr><td style=\"width: 5%;\"></td><td style=\"width: 90%;\">"; $advscope = new xoopsThemeForm(_formulize_DE_PICKASCOPE, 'advscope', XOOPS_URL . "/modules/formulize/include/advscope.php?fid={$fid}&frid={$frid}"); $gcount = count($availgroups); $size = $gcount < 10 ? $gcount : 10; $grouplist = new xoopsFormSelect(_formulize_DE_AVAILGROUPS, 'newscope', $curgroups, $size, true); $grouplist->addOptionArray($availgroups); $doneButton = new xoopsFormButton('', 'done', _formulize_DE_USETHISSCOPE, 'button'); $doneButton->setExtra("onclick=\"javascript:updateScope(this.form);return false;\""); $advscope->addElement($grouplist); $advscope->addElement($doneButton); print $advscope->render(); print "</td><td style=\"width: 5%;\"></td></tr></table>\n"; print "</center></body>\n"; print "</HTML>";
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; }