コード例 #1
0
         $calc_name = _formulize_DE_CALC_AVG;
         break;
     case "min":
         $calc_name = _formulize_DE_CALC_MIN;
         break;
     case "max":
         $calc_name = _formulize_DE_CALC_MAX;
         break;
     case "count":
         $calc_name = _formulize_DE_CALC_COUNT;
         break;
     case "per":
         $calc_name = _formulize_DE_CALC_PER;
         break;
 }
 $tray = new xoopsFormElementTray("&nbsp;&nbsp&nbsp;" . $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']])) {
コード例 #2
0
print "<head>";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . _CHARSET . "\" />";
print "<title>" . _formulize_DE_BUILDQUERY . "</title>\n";
searchJavascript($items);
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>";
print "<body style=\"background: white; margin-top:20px;\"><center>";
print "<table style=\"width: 100%;\"><tr><td style=\"width: 5%;\"></td><td style=\"width: 90%;\">";
$advsearch = new xoopsThemeForm(_formulize_DE_BUILDQUERY, 'buildq', XOOPS_URL . "/modules/formulize/include/advsearch.php?fid={$fid}&frid={$frid}");
//$returned = addReqdCalcs($pickcalc);
//$pickcalc = $returned['form'];
$columns_andor = new xoopsFormElementTray('', "<br />");
$columns_and = new xoopsFormRadio('', 'multi_andor', '1');
$columns_and->addOption(1, _formulize_DE_AS_MULTI_AND);
$columns_andor->addElement($columns_and);
$columns_or = new xoopsFormRadio('', 'multi_andor', '1');
$columns_or->addOption(2, _formulize_DE_AS_MULTI_OR);
$columns_andor->addElement($columns_or);
$columns = new xoopsFormSelect(_formulize_DE_AS_FIELD . "<br /><br />" . $columns_andor->render(), 'column', '', 5, true);
$columns->addOption("creation_uid", _formulize_DE_CALC_CREATOR);
$columns->addOption("mod_uid", _formulize_DE_CALC_MODIFIER);
$columns->addOption("creation_datetime", _formulize_DE_CALC_CREATEDATE . ' (YYYY-mm-dd)');
$columns->addOption("mod_datetime", _formulize_DE_CALC_MODDATE . ' (YYYY-mm-dd)');
$columns->addOption("creator_email", _formulize_DE_CALC_CREATOR_EMAIL);
$columns->addOptionArray($options);
$opterm = new xoopsFormElementTray(_formulize_DE_AS_OPTERM, "&nbsp;&nbsp;");
$op = new xoopsFormSelect('', 'op');
コード例 #3
0
 function formulize_disableElement($element, $type, $ele_desc)
 {
     if ($type == "text" or $type == "textarea" or $type == "date" or $type == "colorpick") {
         $newElement = new xoopsFormElementTray($element->getCaption(), "\n");
         $newElement->setName($element->getName());
         switch ($type) {
             case 'date':
                 if ($timeval = $element->getValue()) {
                     if (is_string($timeval)) {
                         $timeval = strtotime($timeval);
                     }
                     $hiddenValue = date(_SHORTDATESTRING, $timeval);
                 } else {
                     $hiddenValue = "";
                 }
                 break;
             default:
                 // should work for all elements, since non-textbox type elements where the value would not be passed straight back, are handled differently at the time they are constructed
                 $hiddenValue = formulize_numberFormat($element->getValue(), $this->_ele->getVar('ele_handle'));
         }
         if (is_array($hiddenValue)) {
             // not sure when/if this would ever happen
             foreach ($hiddenValue as $value) {
                 $newElement->addElement(new xoopsFormHidden($element->getName() . "[]", $value));
                 unset($value);
             }
             $newElement->addElement(new xoopsFormLabel('', implode(", ", $hiddenValue)));
         } else {
             $newElement->addElement(new xoopsFormHidden($element->getName(), $hiddenValue));
             $newElement->addElement(new xoopsFormLabel('', $hiddenValue));
         }
         if (substr($element->getName(), 0, 9) != "desubform") {
             // we should consider not having a cue at all for any disabled elements, but we're not going to pull it out just yet...more investigation of this is necessary
             $newElement->addElement(new xoopsFormHidden("decue_" . trim($element->getName(), "de_"), 1));
         }
         $newElement->setDescription(html_entity_decode($ele_desc, ENT_QUOTES));
         return $newElement;
     } else {
         return $element;
     }
 }
コード例 #4
0
    function render($elementObject, $form_ele_id, $isDisabled)
    {
        $order = new xoopsFormHidden($form_ele_id, '');
        // this element will receive the order of the sortable options upon saving, which is then read by prepDataForWrite
        if (!isset($GLOBALS['formulize_jQuery_included'])) {
            // may already be included by formdisplay.php, otherwise we're rendering element at a time and we need to account for this here
            $sortableListHTML = "<script type=\"text/javascript\" src=\"" . XOOPS_URL . "/modules/formulize/libraries/jquery/jquery-1.3.2.min.js\"></script>\r\n<script type=\"text/javascript\" src=\"" . XOOPS_URL . "/modules/formulize/libraries/jquery/jquery-ui-1.7.2.custom.min.js\"></script>";
            $GLOBALS['formulize_jQuery_included'] = true;
        }
        if (!isset($GLOBALS['formulize_sortable_style_included'])) {
            print "<style>\r\n      .sortableitem {\r\n        width: 200px; background-color: white; border: 1px solid black; margin-top: 2px; margin-bottom: 2px; padding: 2px;        \r\n      }\r\n      </style>";
            $GLOBALS['formulize_sortable_style_included'] = true;
        }
        $sortableListHTML .= '
    
	<script type="text/javascript">
	$(function() {
		$("#sortable-' . $elementObject->getVar('ele_id') . '").sortable({
      axis: "y",
      items: "div"
    });
		$("#sortable-' . $elementObject->getVar('ele_id') . '").disableSelection();
	});
	</script>

<div id="sortable-' . $elementObject->getVar('ele_id') . '">';
        $counter = 1;
        foreach ($elementObject->getVar('ele_value') as $thisOption => $dummyValue) {
            $sortableListHTML .= "<div id=\"sortable-{$counter}\" class=\"sortableitem\">{$thisOption}</div>\n";
            $counter++;
        }
        $sortableListHTML .= "</div>";
        $list = new xoopsFormLabel('', $sortableListHTML);
        $tray = new xoopsFormElementTray($elementObject->getVar('ele_caption'), '\\n');
        $tray->addElement($order);
        $tray->addElement($list);
        return $tray;
    }
コード例 #5
0
ファイル: setnot.php プロジェクト: LeeGlendenning/formulize
    $_POST['setfor'] = 'all';
}
$setfor = new xoopsFormElementTray(_formulize_DE_SETNOT_FOR, "<br />");
$setfor_all = new xoopsFormRadio('', 'setfor', $_POST['setfor']);
$setfor_all->addOption('all', _formulize_DE_SETNOT_FOR_ALL);
// process existing conditions...
if ($_POST['addcon']) {
    for ($i = 0; $i < count($_POST['elements']); $i++) {
        $setnot->addElement(new xoopsFormHidden('elements[]', $_POST['elements'][$i]));
        $setnot->addElement(new xoopsFormHidden('ops[]', $_POST['ops'][$i]));
        $setnot->addElement(new xoopsFormHidden('terms[]', $_POST['terms'][$i]));
        $conditionlist .= $options[$_POST['elements'][$i]] . " " . $_POST['ops'][$i] . " " . $_POST['terms'][$i] . "<br />";
    }
}
// setup the operator boxes...
$opterm = new xoopsFormElementTray('', "&nbsp;&nbsp;");
$element = new xoopsFormSelect('', 'new_element');
$element->setExtra("onfocus=\"javascript:window.document.setnot.setfor[1].checked=true\"");
$element->addOptionArray($options);
$op = new xoopsFormSelect('', 'new_op');
$ops['='] = "=";
$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);
コード例 #6
0
ファイル: save.php プロジェクト: LeeGlendenning/formulize
        $lastpubgroups[0] = "donotpub";
        $currentlock = 1;
        // default to locked
    }
    $overlap = array_intersect($lastpubgroups, array_keys($publishgroups));
    if (count($overlap) == 0) {
        // ie: no default is actually part of the available groups
        $lastpubgroups[0] = "donotpub";
    }
    $size = count($publishgroups);
    if ($size > 7) {
        $size = 7;
    }
    $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) {
コード例 #7
0
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('', "&nbsp;&nbsp;");
    $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;
}
コード例 #8
0
function formulize_createFilterUIMatch($newElementName, $formName, $filterName, $options, $newOpName, $newTermName, $conditionlist)
{
    // setup the new element, operator, term boxes
    $new_elementOpTerm = new xoopsFormElementTray('', "&nbsp;&nbsp;");
    $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();
}