function GenSetting($fieldname = 'none', $dispname = 'none given', $description = '', $type = '0', $defvalue = '', $length = '30', $additional = '', $cfgvar = 'Cfg')
    {
        global ${$cfgvar}, $lang;
        if ($type < 7) {
            $settingdisp = '<tr><td width="25%"  valign="top"><b class="tabular" style="padding-right: 7px;">' . $dispname . ':</b></td>
					<td width="75%">';
        } else {
            $settingdisp = "";
        }
        // we do other stuff in the case's themselves because it's just easier.
        switch ($type) {
            case 0:
                $settingdisp .= GenTextfield($fieldname, $length, $additional, $defvalue, $cfgvar);
                break;
            case 1:
                $settingdisp .= GenPassfield($fieldname, $length, $additional, $cfgvar);
                break;
            case 2:
                $settingdisp .= GenCheckbox($fieldname, $additional, $defvalue, $cfgvar);
                break;
            case 3:
                $settingdisp .= GenDropdown($fieldname, $additional, $defvalue, $cfgvar);
                break;
            case 4:
                $settingdisp .= GenSelectbox($fieldname, $length, $defvalue, $cfgvar);
                break;
            case 5:
                $settingdisp .= GenTextarea($fieldname, $length, $additional, $defvalue, $cfgvar);
                break;
            case 6:
                $settingdisp .= GenRadios($fieldname, $defvalue, $cfgvar);
                break;
            case 7:
                $settingdisp .= GenHidden($fieldname, $additional, $defvalue, $cfgvar);
                break;
            case 8:
                $settingdisp = '<tr><td class="sHeading" colspan="' . $length . '"><hr size=1 noshade><h2 style="margin-left:0px;">' . $dispname . '</h2></td></tr>';
                break;
        }
        if ($type < 7) {
            $settingdisp .= '</td></tr>';
            if (strlen($description) > strlen($dispname)) {
                $settingdisp .= '<tr><td width="85%" colspan="2" style="padding-left: 18%; padding-bottom: 7px;">' . str_replace("&nbsp;", " ", $description) . '</td></tr>' . "\n";
            }
        }
        echo $settingdisp;
    }
Beispiel #2
0
function GenSetting($fieldname = 'none', $dispname = 'none given', $description = '', $type = '0', $defvalue = '', $length = '', $additional = '', $cfgvar = 'Cfg')
{
    global ${$cfgvar}, $lang;
    // set the default for length..
    if ($length == "") {
        $length = 40;
    }
    if ($type < 7) {
        $settingdisp = "<tr>\n<td width='25%'  valign='top'><b class='tabular' style='padding-right: 7px;'>" . $dispname . ":</b></td>\n\r\n\t\t<td width='75%'>";
    } else {
        $settingdisp = "";
    }
    // we do other stuff in the case's themselves because it's just easier.
    switch ($type) {
        case 0:
            $settingdisp .= GenTextfield($fieldname, $length, $additional, $defvalue, $cfgvar);
            break;
        case 1:
            $settingdisp .= GenPassfield($fieldname, $length, $additional, $cfgvar);
            break;
        case 2:
            $settingdisp .= GenCheckbox($fieldname, $additional, $defvalue, $cfgvar);
            break;
        case 3:
            $settingdisp .= GenDropdown($fieldname, $additional, $defvalue, $cfgvar);
            break;
        case 4:
            $settingdisp .= GenSelectbox($fieldname, $length, $defvalue, $cfgvar);
            break;
        case 5:
            $settingdisp .= GenTextarea($fieldname, $length, $additional, $defvalue, $cfgvar);
            break;
        case 6:
            $settingdisp .= GenRadios($fieldname, $defvalue, $cfgvar);
            break;
        case 7:
            $settingdisp .= GenHidden($fieldname, $additional, $defvalue, $cfgvar);
            break;
        case 8:
            $settingdisp = "<tr>\n<td class='sHeading' colspan='" . $length . "'><hr size='1' noshade='noshade' />\n<h2 style='margin-left:0px;'>" . $dispname . "</h2>\n</td>\n</tr>\n";
            break;
    }
    // JM - just for checkboxes...
    if (2 == $type) {
        $settingdisp .= "</td>\n</tr>\n";
        if ('' != $additional) {
            $settingdisp = str_replace('<tr>', '<tr ' . $additional . '>', $settingdisp);
        }
        // perhaps add the line with the description.
        if (strlen($description) > strlen($dispname)) {
            $settingdisp .= "<tr>\n<td width='85%' colspan='2' style='padding-left: 18%; padding-bottom: 7px;'>" . str_replace("&nbsp;", " ", $description) . "</td>\n</tr>\n";
        }
    } else {
        if ($type < 7) {
            $settingdisp .= "</td>\n</tr>\n";
            // perhaps add the line with the description.
            if (strlen($description) > strlen($dispname)) {
                $settingdisp .= "<tr>\n<td width='85%' colspan='2' style='padding-left: 18%; padding-bottom: 7px;'>" . str_replace("&nbsp;", " ", $description) . "</td>\n</tr>\n";
            }
        }
    }
    echo $settingdisp;
}