Esempio n. 1
0
 function buildControl($value, $mode, $fieldNum = 0, $validate, $additionalCtrlParams, $data)
 {
     parent::buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data);
     $nWidth = $this->pageObject->pSetEdit->getNCols($this->field);
     $nHeight = $this->pageObject->pSetEdit->getNRows($this->field);
     if ($this->pageObject->pSetEdit->isUseRTE($this->field)) {
         $value = RTESafe($value);
     } else {
         echo '<textarea id="' . $this->cfield . '" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? 'alt="' . $this->strLabel . '" ' : '') . 'name="' . $this->cfield . '" style="';
         if (!isMobile()) {
             echo "width: " . $nWidth . "px;";
         }
         echo 'height: ' . $nHeight . 'px;">' . htmlspecialchars($value) . '</textarea>';
     }
     $this->buildControlEnd($validate);
 }
Esempio n. 2
0
function do_textarea_row($title, $name, $value = '')
{
    // ==============================
    // WYSIWYG Editor
    // ==============================
    $value = RTESafe($value);
    echo <<<EOF

\t<TR>
\t\t<TD CLASS="formlabel" COLSPAN="2">
\t\t<B>{$title}</B><BR />
        <script language="JavaScript" type="text/javascript">
        function submitForm() {
           updateRTEs('{$name}');
           return true;
        }
        initRTE("../images/wysiwyg/", "", "");
        </script>
        <noscript><b>Javascript must be enabled to use this WYSIWYG editor.</b></noscript>

        <script language="JavaScript" type="text/javascript">
        writeRichText('{$name}', '{$value}', 400, 200, true, false);
        </script>
\t\t</TD>
\t</TR>

EOF;
}
            $run_result .= <<<END
                            <script language="JavaScript" type="text/javascript">
                            <!--
                            function submitForm() {
                                //make sure hidden and iframe values are in sync before submitting form
                                //to sync only 1 rte, use updateRTE(rte)
                                //to sync all rtes, use updateRTEs
                                updateRTE('<?php echo {$parameter['0']}; ?>');
                                //updateRTEs();
                                //alert("rte1 = " + document.elggform.<?php echo {$parameter['0']}; ?>.value);
                                
                                //change the following line to true to submit form
                                return true;
                            }
END;
            $content = RTESafe(stripslashes($parameter[1]));
            $run_result .= <<<END
                            //Usage: initRTE(imagesPath, includesPath, cssFile)
                                initRTE("/units/display/rtfedit/images/", "/units/display/rtfedit/", "/units/display/rtfedit/rte.css");
                                </script>
                                <noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
                                <script language="JavaScript" type="text/javascript">
                                <!--
                                writeRichText('<?php echo {$parameter['0']};?>', '<?php echo {$content}; ?>', 220, 200, true, false);
                            // -->
                            </script>
END;
            break;
        case "blank":
            $run_result .= "<input type=\"hidden\" name=\"" . $parameter[0] . "\" value=\"blank\" id=\"" . $cleanid . "\" />";
            break;
function display_input_field($parameter)
{
    // Displays different HTML depending on input field type
    /*
    $parameter(
                        0 => input name to display (for forms etc)
                            1 => data
                            2 => type of input field
                            3 => reference name (for tag fields and so on)
                            4 => ID number (if any)
                            5 => Owner
                    )
    */
    global $CFG;
    $run_result = '';
    if (isset($parameter) && sizeof($parameter) > 2) {
        if (!isset($parameter[4])) {
            $parameter[4] = -1;
        }
        if (!isset($parameter[5])) {
            $parameter[5] = $_SESSION['userid'];
        }
        $cleanid = $parameter[0];
        if (!ereg("^[A-Za-z][A-Za-z0-9_:\\.-]*\$", $cleanid)) {
            if (!ereg("^[A-Za-z]", $cleanid)) {
                $cleanid = "id_" . $cleanid;
            }
            $cleanid = ereg_replace("[^A-Za-z0-9_:\\.-]", "__", $cleanid);
        }
        switch ($parameter[2]) {
            case "text":
                $run_result .= "<input type=\"text\" name=\"" . $parameter[0] . "\" value=\"" . htmlspecialchars(stripslashes($parameter[1]), ENT_COMPAT, 'utf-8') . "\" style=\"width: 95%\" id=\"" . $cleanid . "\" />";
                break;
            case "password":
                $run_result .= "<input type=\"password\" name=\"" . $parameter[0] . "\" value=\"" . htmlspecialchars(stripslashes($parameter[1]), ENT_COMPAT, 'utf-8') . "\" style=\"width: 95%\" id=\"" . $cleanid . "\" />";
                break;
            case "mediumtext":
                $run_result .= "<textarea name=\"" . $parameter[0] . "\" id=\"" . $cleanid . "\" style=\"width: 95%; height: 100px\">" . htmlspecialchars(stripslashes($parameter[1]), ENT_COMPAT, 'utf-8') . "</textarea>";
                break;
            case "keywords":
                /*
                            $keywords = stripslashes($parameter[1]);
                            preg_match_all("/\[\[([A-Za-z0-9 ]+)\]\]/i",$keywords,$keyword_list);
                            $keyword_list = $keyword_list[1];
                            $keywords = "";
                            if (is_array($keyword_list) && sizeof($keyword_list) > 0) {
                                sort($keyword_list);
                                foreach($keyword_list as $key => $list_item) {
                                    $keywords .= $list_item;
                                    if ($key < sizeof($keyword_list) - 1) {
                                        $keywords .= ", ";
                                    }
                                }
                            }
                            $parameter[1] = $keywords;
                */
                if (!isset($data['profile:preload'][$parameter[3]])) {
                    $keywords = "";
                    if ($tags = get_records_select('tags', "tagtype = ? and ref = ? and owner = ?", array($parameter[3], $parameter[4], $parameter[5]), 'tag ASC')) {
                        $first = true;
                        foreach ($tags as $key => $tag) {
                            if (empty($first)) {
                                $keywords .= ", ";
                            }
                            $keywords .= stripslashes($tag->tag);
                            $first = false;
                        }
                    }
                    $parameter[1] = $keywords;
                } else {
                    // $parameter[1] = $data['profile:preload'][$parameter[3]];
                }
                // $parameter[1] = var_export($parameter,true);
                $run_result .= "<textarea name=\"" . $parameter[0] . "\" id=\"" . $cleanid . "\" style=\"width: 95%; height: 100px\">" . htmlspecialchars(stripslashes($parameter[1]), ENT_COMPAT, 'utf-8') . "</textarea>";
                break;
            case "longtext":
                $run_result .= "<textarea name=\"" . $parameter[0] . "\" id=\"" . $cleanid . "\" style=\"width: 95%; height: 200px\">" . htmlspecialchars(stripslashes($parameter[1]), ENT_COMPAT, 'utf-8') . "</textarea>";
                break;
            case "richtext":
                // Rich text editor:
                $run_result .= <<<END
                <script language="JavaScript" type="text/javascript">
                <!--
                function submitForm() {
                    //make sure hidden and iframe values are in sync before submitting form
                    //to sync only 1 rte, use updateRTE(rte)
                    //to sync all rtes, use updateRTEs
                    updateRTE('<?php echo {$parameter['0']}; ?>');
                    //updateRTEs();
                    //alert("rte1 = " + document.elggform.<?php echo {$parameter['0']}; ?>.value);

                    //change the following line to true to submit form
                    return true;
                }
END;
                $content = RTESafe(stripslashes($parameter[1]));
                $run_result .= <<<END
                //Usage: initRTE(imagesPath, includesPath, cssFile)
                initRTE("/units/display/rtfedit/images/", "/units/display/rtfedit/", "/units/display/rtfedit/rte.css");
            </script>
                  <noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
                  <script language="JavaScript" type="text/javascript">
                  <!--
                  writeRichText('<?php echo {$parameter['0']};?>', '<?php echo {$content}; ?>', 220, 200, true, false);
            // -->
            </script>
END;
                break;
            case "blank":
                $run_result .= "<input type=\"hidden\" name=\"" . $parameter[0] . "\" value=\"blank\" id=\"" . $cleanid . "\" />";
                break;
            case "web":
            case "email":
            case "aim":
            case "msn":
            case "skype":
            case "icq":
                $run_result .= "<input type=\"text\" name=\"" . $parameter[0] . "\" value=\"" . htmlspecialchars(stripslashes($parameter[1]), ENT_COMPAT, 'utf-8') . "\" style=\"width: 95%\" id=\"" . $cleanid . "\" />";
                break;
            case "weblogtext":
                $run_result .= "<textarea name=\"" . $parameter[0] . "\" id=\"" . $parameter[0] . "\" style=\"width: 95%; height: 200px\">" . htmlspecialchars(stripslashes($parameter[1]), ENT_COMPAT, 'utf-8') . "</textarea>";
                break;
            default:
                if (isset($CFG->display_field_module[$parameter[2]])) {
                    $callback = $CFG->display_field_module[$parameter[2]] . "_display_input_field";
                    if (is_callable($callback)) {
                        $run_result .= $callback($parameter);
                    }
                }
                break;
        }
    }
    return $run_result;
}
function BuildEditControl($field, $value, $format, $edit, $fieldNum = 0, $id = "", $validate, $additionalCtrlParams, &$pageObj)
{
    global $rs, $data, $strTableName, $filenamelist, $keys, $locale_info, $jscode;
    $inputStyle = 'style="';
    $inputStyle .= $additionalCtrlParams['style'] ? $additionalCtrlParams['style'] : '';
    //$inputStyle .= ($additionalCtrlParams['hidden'] ? 'display: none;' : '');
    $inputStyle .= '"';
    $cfieldname = GoodFieldName($field) . "_" . $id;
    $cfield = "value_" . GoodFieldName($field) . "_" . $id;
    $ctype = "type_" . GoodFieldName($field) . "_" . $id;
    $is508 = isEnableSection508();
    $strLabel = Label($field);
    if ($fieldNum) {
        $cfield = "value" . $fieldNum . "_" . GoodFieldName($field) . "_" . $id;
        $ctype = "type" . $fieldNum . "_" . GoodFieldName($field) . "_" . $id;
    }
    $type = GetFieldType($field);
    $arr = "";
    $iquery = "field=" . rawurlencode($field);
    $keylink = "";
    $arrKeys = GetTableKeys($strTableName);
    for ($j = 0; $j < count($arrKeys); $j++) {
        $keylink .= "&key" . ($j + 1) . "=" . rawurlencode($data[$arrKeys[$j]]);
    }
    $iquery .= $keylink;
    $isHidden = isset($additionalCtrlParams['hidden']) && $additionalCtrlParams['hidden'];
    echo '<span id="edit' . $id . '_' . GoodFieldName($field) . '_' . $fieldNum . '" class="runner-nowrap"' . ($isHidden ? ' style="display:none"' : '') . '">';
    if ($format == EDIT_FORMAT_FILE && $edit == MODE_SEARCH) {
        $format = "";
    }
    if ($format == EDIT_FORMAT_TEXT_FIELD) {
        if (IsDateFieldType($type)) {
            echo '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="date' . EDIT_DATE_SIMPLE . '">' . GetDateEdit($field, $value, 0, $fieldNum, $edit, $id, $pageObj);
        } else {
            if ($edit == MODE_SEARCH) {
                echo '<input id="' . $cfield . '" ' . $inputStyle . ' type="text" autocomplete="off" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($value) . '">';
            } else {
                echo '<input id="' . $cfield . '" ' . $inputStyle . ' type="text" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($value) . '">';
            }
        }
    } else {
        if ($format == EDIT_FORMAT_TIME) {
            echo '<input id="' . $ctype . '" ' . $inputStyle . ' type="hidden" name="' . $ctype . '" value="time">';
            $arr_number = parsenumbers((string) $value);
            if (count($arr_number) == 6) {
                $value = mysprintf("%d:%02d:%02d", array($arr_number[3], $arr_number[4], $arr_number[5]));
            }
            $timeAttrs = GetFieldData($strTableName, $field, "FormatTimeAttrs", array());
            if (count($timeAttrs)) {
                if ($timeAttrs["useTimePicker"]) {
                    $convention = $timeAttrs["hours"];
                    $loc = getLacaleAmPmForTimePicker($convention, true);
                    $tpVal = getValForTimePicker($type, $value, $loc['locale']);
                    echo '<input type="text" ' . $inputStyle . ' name="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'id="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($tpVal['val']) . '">';
                    echo '&nbsp;';
                    echo '<img class="runner-imgclock" src="images/clock.gif" alt="Time" border="0" style="margin:4px 0 0 6px; visibility: hidden;" id="trigger-test-' . $cfield . '" />';
                } else {
                    echo '<input id="' . $cfield . '" ' . $inputStyle . ' type="text" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($value) . '">';
                }
            }
        } else {
            if ($format == EDIT_FORMAT_TEXT_AREA) {
                $nWidth = GetNCols($field);
                $nHeight = GetNRows($field);
                if (UseRTE($field)) {
                    $value = RTESafe($value);
                } else {
                    echo '<textarea id="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" style="';
                    if (!isMobile()) {
                        echo "width: " . $nWidth . "px;";
                    }
                    echo 'height: ' . $nHeight . 'px;">' . htmlspecialchars($value) . '</textarea>';
                }
            } else {
                if ($format == EDIT_FORMAT_PASSWORD) {
                    echo '<input ' . $inputStyle . ' id="' . $cfield . '" type="Password" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($value) . '">';
                } else {
                    if ($format == EDIT_FORMAT_DATE) {
                        echo '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="date' . DateEditType($field) . '">' . GetDateEdit($field, $value, DateEditType($field), $fieldNum, $edit, $id, $pageObj);
                    } else {
                        if ($format == EDIT_FORMAT_RADIO) {
                            BuildRadioControl($field, $value, $fieldNum, $id, $edit);
                        } else {
                            if ($format == EDIT_FORMAT_CHECKBOX) {
                                if ($edit == MODE_ADD || $edit == MODE_INLINE_ADD || $edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                    $checked = "";
                                    if ($value && $value != 0) {
                                        $checked = " checked";
                                    }
                                    echo '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="checkbox">';
                                    echo '<input id="' . $cfield . '" type="Checkbox" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . $checked . '>';
                                } else {
                                    echo '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="checkbox">';
                                    echo '<select id="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '">';
                                    $val = array("", "on", "off");
                                    $show = array("", "True", "False");
                                    foreach ($val as $i => $v) {
                                        $sel = "";
                                        if ($value === $v) {
                                            $sel = " selected";
                                        }
                                        echo '<option value="' . $v . '"' . $sel . '>' . $show[$i] . '</option>';
                                    }
                                    echo "</select>";
                                }
                            } else {
                                if ($format == EDIT_FORMAT_DATABASE_IMAGE || $format == EDIT_FORMAT_DATABASE_FILE) {
                                    $disp = "";
                                    $strfilename = "";
                                    //$onchangefile="";
                                    if ($edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                        $value = db_stripslashesbinary($value);
                                        $itype = SupposeImageType($value);
                                        $thumbnailed = false;
                                        $thumbfield = "";
                                        if ($itype) {
                                            if ($thumbnailed) {
                                                $disp = "<a ";
                                                if (IsUseiBox($field, $strTableName)) {
                                                    $disp .= " rel='ibox'";
                                                } else {
                                                    $disp .= " target=_blank";
                                                }
                                                $disp .= " href=\"imager.php?table=" . GetTableURL($strTableName) . "&" . $iquery . "&rndVal=" . rand(0, 32768) . "\">";
                                                $disp .= "<img id=\"image_" . GoodFieldName($field) . "_" . $id . "\" name=\"" . $cfield . "\" border=0";
                                                if (isEnableSection508()) {
                                                    $disp .= " alt=\"Image from DB\"";
                                                }
                                                $disp .= " src=\"imager.php?table=" . GetTableURL($strTableName) . "&field=" . rawurlencode($thumbfield) . "&alt=" . rawurlencode($field) . $keylink . "&rndVal=" . rand(0, 32768) . "\">";
                                                $disp .= "</a>";
                                            } else {
                                                $disp = '<img id="image_' . GoodFieldName($field) . '_' . $id . '" name="' . $cfield . '"';
                                                if (isEnableSection508()) {
                                                    $disp .= ' alt="Image from DB"';
                                                }
                                                $disp .= ' border=0 src="imager.php?table=' . GetTableURL($strTableName) . '&' . $iquery . "&rndVal=" . rand(0, 32768) . '">';
                                            }
                                        } else {
                                            if (strlen($value)) {
                                                $disp = '<img id="image_' . GoodFieldName($field) . '_' . $id . '" name="' . $cfield . '" border=0 ';
                                                if (isEnableSection508()) {
                                                    $disp .= ' alt="file"';
                                                }
                                                $disp .= ' src="images/file.gif">';
                                            } else {
                                                $disp = '<img id="image_' . GoodFieldName($field) . '_' . $id . '" name="' . $cfield . '" border="0"';
                                                if (isEnableSection508()) {
                                                    $disp .= ' alt=" "';
                                                }
                                                $disp .= ' src="images/no_image.gif">';
                                            }
                                        }
                                        //	filename
                                        if ($format == EDIT_FORMAT_DATABASE_FILE && !$itype && strlen($value)) {
                                            if (!($filename = @$data[GetFilenameField($field)])) {
                                                $filename = "file.bin";
                                            }
                                            $disp = '<a href="getfile.php?table=' . GetTableURL($strTableName) . '&filename=' . htmlspecialchars($filename) . '&' . $iquery . '".>' . $disp . '</a>';
                                        }
                                        //	filename edit
                                        if ($format == EDIT_FORMAT_DATABASE_FILE && GetFilenameField($field)) {
                                            if (!($filename = @$data[GetFilenameField($field)])) {
                                                $filename = "";
                                            }
                                            if ($edit == MODE_INLINE_EDIT) {
                                                $strfilename = '<br><label for="filename_' . $cfieldname . '">' . mlang_message("FILENAME") . '</label>&nbsp;&nbsp;<input type="text" ' . $inputStyle . ' id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="20" maxlength="50" value="' . htmlspecialchars($filename) . '">';
                                            } else {
                                                $strfilename = '<br><label for="filename_' . $cfieldname . '">' . mlang_message("FILENAME") . '</label>&nbsp;&nbsp;<input type="text" ' . $inputStyle . ' id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="20" maxlength="50" value="' . htmlspecialchars($filename) . '">';
                                            }
                                        }
                                        $strtype = '<br><input id="' . $ctype . '_keep" type="Radio" name="' . $ctype . '" value="file0" checked>' . mlang_message("KEEP");
                                        if ((strlen($value) || $edit == MODE_INLINE_EDIT) && !IsRequired($field)) {
                                            $strtype .= '<input id="' . $ctype . '_delete" type="Radio" name="' . $ctype . '" value="file1">' . mlang_message("DELETE");
                                        }
                                        $strtype .= '<input id="' . $ctype . '_update" type="Radio" name="' . $ctype . '" value="file2">' . mlang_message("UPDATE");
                                    } else {
                                        //	if Add mode
                                        $strtype = '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="file2">';
                                        if ($format == EDIT_FORMAT_DATABASE_FILE && GetFilenameField($field)) {
                                            $strfilename = '<br><label for="filename_' . $cfieldname . '">' . mlang_message("FILENAME") . '</label>&nbsp;&nbsp;<input type="text" ' . $inputStyle . ' id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="20" maxlength="50">';
                                        }
                                    }
                                    if ($edit == MODE_INLINE_EDIT && $format == EDIT_FORMAT_DATABASE_FILE) {
                                        $disp = "";
                                    }
                                    echo $disp . $strtype;
                                    if ($edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                        echo '<br>';
                                    }
                                    echo '<input type="File" ' . $inputStyle . ' id="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . ' name="' . $cfield . '" >' . $strfilename;
                                    echo '<input type="Hidden" id="notempty_' . $cfieldname . '" value="' . (strlen($value) ? 1 : 0) . '">';
                                } else {
                                    if ($format == EDIT_FORMAT_LOOKUP_WIZARD) {
                                        BuildSelectControl($field, $value, $fieldNum, $edit, $id, $additionalCtrlParams, $pageObj);
                                    } else {
                                        if ($format == EDIT_FORMAT_HIDDEN) {
                                            echo '<input id="' . $cfield . '" type="Hidden" name="' . $cfield . '" value="' . htmlspecialchars($value) . '">';
                                        } else {
                                            if ($format == EDIT_FORMAT_READONLY) {
                                                echo '<input id="' . $cfield . '" type="Hidden" name="' . $cfield . '" value="' . htmlspecialchars($value) . '">';
                                            } else {
                                                if ($format == EDIT_FORMAT_FILE) {
                                                    $disp = "";
                                                    $strfilename = "";
                                                    $function = "";
                                                    if ($edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                                        //	show current file
                                                        if (ViewFormat($field) == FORMAT_FILE || ViewFormat($field) == FORMAT_FILE_IMAGE) {
                                                            $disp = GetData($data, $field, ViewFormat($field)) . "<br>";
                                                        }
                                                        $filename = $value;
                                                        //	filename edit
                                                        $filename_size = 30;
                                                        if (UseTimestamp($field)) {
                                                            $filename_size = 50;
                                                        }
                                                        $strfilename = '<input type=hidden name="filenameHidden_' . $cfieldname . '" value="' . htmlspecialchars($filename) . '"><br>' . mlang_message("FILENAME") . '&nbsp;&nbsp;<input type="text" style="background-color:gainsboro" disabled id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="' . $filename_size . '" maxlength="100" value="' . htmlspecialchars($filename) . '">';
                                                        if ($edit == MODE_INLINE_EDIT) {
                                                            $strtype = '<br><input id="' . $ctype . '_keep" type="Radio" name="' . $ctype . '" value="upload0" checked class="runner-uploadtype">' . mlang_message("KEEP");
                                                        } else {
                                                            $strtype = '<br><input id="' . $ctype . '_keep" type="Radio" name="' . $ctype . '" value="upload0" checked class="runner-uploadtype">' . mlang_message("KEEP");
                                                        }
                                                        if ((strlen($value) || $edit == MODE_INLINE_EDIT) && !IsRequired($field)) {
                                                            $strtype .= '<input id="' . $ctype . '_delete" type="Radio" name="' . $ctype . '" value="upload1" class="runner-uploadtype">' . mlang_message("DELETE");
                                                        }
                                                        $strtype .= '<input id="' . $ctype . '_update" type="Radio" name="' . $ctype . '" value="upload2" class="runner-uploadtype">' . mlang_message("UPDATE");
                                                    } else {
                                                        //	if Adding record
                                                        $filename_size = 30;
                                                        if (UseTimestamp($field)) {
                                                            $filename_size = 50;
                                                        }
                                                        $strtype = '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="upload2">';
                                                        $strfilename = '<br>' . mlang_message("FILENAME") . '&nbsp;&nbsp;<input type="text" id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="' . $filename_size . '" maxlength="100">';
                                                    }
                                                    echo $disp . $strtype . $function;
                                                    if ($edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                                        echo '<br>';
                                                    }
                                                    echo '<input type="File" id="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . ' name="' . $cfield . '" >' . $strfilename;
                                                    echo '<input type="Hidden" id="notempty_' . $cfieldname . '" value="' . (strlen($value) ? 1 : 0) . '">';
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if (count($validate['basicValidate']) && array_search('IsRequired', $validate['basicValidate']) !== false) {
        echo '&nbsp;<font color="red">*</font></span>';
    } else {
        echo '</span>';
    }
}