<?php
  require_once "lib/menus/database/editField_functions.php";
  $field = getFieldAttributes($FORM['fieldname']);

  $showValidation = @$_COOKIE['showAdvancedFieldEditorOptions'];
  $showAdvanced   = @$_COOKIE['showAdvancedFieldEditorOptions'];

  $tablesAndFieldnames = getTablesAndFieldnames();
  $optionFieldnames    = @$tablesAndFieldnames[@$field['optionsTablename']];
  if (!$optionFieldnames) { $optionFieldnames = array(); }

  echo "<?xml version=\"1.0\"?>\n";
?>
<!DOCTYPE html
          PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <link rel="stylesheet" type="text/css" href="css/ui.css" />
  <!--[if IE]>  <link rel="stylesheet" type="text/css" href="css/ui_ie.css" /><![endif]-->
  <!--[if IE 7]><link rel="stylesheet" type="text/css" href="css/ui_ie7.css" /><![endif]-->
  <style type="text/css">
  body  { background-color: #FFFFFF; margin: 0px; }
  .label { width: 125px; float: left;  };
  </style>

  <script type="text/javascript"><!--
    tablesAndFieldnames = <?php echo json_encode($tablesAndFieldnames); ?>;
  //--></script>

 </head>
<body>

<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" autocomplete="off" id="editFieldForm" onsubmit="return false;">
<input type="hidden" name="menu" value="database" />
<input type="hidden" name="_defaultAction" value="editTable" />
<input type="hidden" name="tableName" id="tableName" value="<?php echo htmlspecialchars($FORM['tableName']) ?>" />
<input type="hidden" name="fieldname" id="fieldname" value="<?php echo htmlspecialchars($FORM['fieldname']) ?>" />
<input type="hidden" name="order" id="order" value="<?php echo htmlspecialchars(@$field['order']) ?>" />
<input type="hidden" name="editField" value="1" />
<input type="hidden" name="save" value="1" />
<input type="hidden" name="saveAndCopy" id="saveAndCopy" value="0" />
<input type="hidden" name="customColumnType" value="<?php echo htmlspecialchars(@$field['customColumnType']) ?>" />

<div style="width: 690px; background-color: #FFFFFF; padding: 10px 10px 0px 10px; position: fixed; top: 0px; left: 0px;">
  <div style="float: right">
    <input type="submit" name="save" value=" Save " class="inputButton" /><!-- form saved via ajax on submit, see js file) -->
    <input type="button" onclick="$('#saveAndCopy').val(1); $('form').submit();" value="Save & Copy" class="inputButton" />
    <input type="button" onclick="self.parent.tb_remove()" value="Cancel" class="inputButton" />
  </div>
  <div class="title">Admin &gt; Section Editors &gt; Field Editor</div>
  <div class="divider_line"></div>
</div>

<?php displayAlerts(); ?>

<div style="padding-top: 30px; margin: 10px; ">

<table border="0" cellspacing="0" cellpadding="5" width="690" bgcolor="#FFFFFF"><tr><td>
   <table border="0" cellspacing="1" cellpadding="1" width="100%">
    <tr>
     <td class="columnFieldEditorTop">Field Label</td>
     <td><input name="label" id="label" size="30" value="<?php echo htmlspecialchars($field['label']) ?>" style="width: 225px;"
          onkeyup="autoFillBlankFieldName()" onchange="autoFillBlankFieldName()" /> (displayed beside field in editor)</td>
    </tr>
    <tr>
     <td valign="top" style="padding-top: 4px">Field Name</td>
     <td>
      <input name="newFieldname" id="newFieldname" size="30" value="<?php echo htmlspecialchars(@$field['newFieldname']) ?>" style="width: 225px;" spellcheck="false" onkeyup="showSpecialFieldDescription();"/>
      (used in PHP viewer code)<br/>
       <div id="specialFieldDescription"></div>
     </td>
    </tr>
<?php if (@$field['customColumnType']): ?>
    <tr>
     <td valign="top" style="padding: 3px 0px;">Custom Column Type</td>
     <td><?php echo htmlspecialchars(@$field['customColumnType']); ?></td>
    </tr>
<?php endif; ?>
    <tr>
     <td>Field Type</td>
      <td>
      <select name="type" id="fieldType" onchange="displayOptionsForFieldType(0)" onkeyup="displayOptionsForFieldType(0)" style="width: 225px;">
      <option value="none"      <?php selectedIf($field['type'], 'none') ?>>none</option>
      <option value="textfield" <?php selectedIf($field['type'], 'textfield') ?>>text field</option>
      <option value="textbox"   <?php selectedIf($field['type'], 'textbox') ?>>text box</option>
      <option value="wysiwyg"   <?php selectedIf($field['type'], 'wysiwyg') ?>>wysiwyg</option>
      <option value="date"      <?php selectedIf($field['type'], 'date') ?>>date/time</option>
      <option value="list"      <?php selectedIf($field['type'], 'list') ?>>list</option>
      <option value="checkbox"  <?php selectedIf($field['type'], 'checkbox') ?>>checkbox</option>
      <option value="upload"    <?php selectedIf($field['type'], 'upload') ?>>upload</option>
      <option value="separator" <?php selectedIf($field['type'], 'separator') ?>>--- separator ---</option>
<!--
      debugging feature
      <option value="all"       <?php selectedIf($field['type'], 'all') ?>>show all options (for debugging)</option>
-->
      <?php if ($field['type'] == 'parentCategory'): ?>
        <option value="<?php echo $field['type'] ?>" <?php selectedIf(1,1) ?>><?php echo $field['type'] ?></option>
      <?php endif; ?>
      </select>
     </td>
    </tr>

</table><br/>


  <fieldset>
  <legend><b>Field Options</b></legend>

  <div id="fieldOptionsContainer">
  <br/>

  <div style="display: none" class="fieldOption noOptions" align="center">
    There are no options for this field type.<br/><br/>
  </div>

  <div style="display: none" class="fieldOption defaultValue">
    <div class="label">Default Value</div>
    <div><input name="defaultValue" size="40" value="<?php echo htmlspecialchars($field['defaultValue']) ?>" /></div>
  </div>

  <div style="display: none" class="fieldOption defaultContent">
    <div class="label">Default Value</div>
    <div><textarea name="defaultContent" cols="60" rows="3" onfocus="this.rows=10" onblur="this.rows=3" ><?php echo htmlspecialchars($field['defaultContent']) ?></textarea></div>
  </div>


  <div style="display: none" class="fieldOption checkboxOptions">
    <div class="label">Default State</div>
    <div>
      <input type="radio" class="inputRadio" id="checkedByDefault.1" name="checkedByDefault" value="1" <?php checkedIf($field['checkedByDefault'], '1') ?>/> <label for="checkedByDefault.1">Checked</label>
      <input type="radio" class="inputRadio" id="checkedByDefault.0" name="checkedByDefault" value="0" <?php checkedIf($field['checkedByDefault'], '0') ?> /> <label for="checkedByDefault.0">Unchecked</label>
    </div>
  </div>

  <div style="display: none" class="fieldOption description">
    <div class="label">Field Description</div>
    <div>
      <input name="description" size="40" value="<?php echo htmlspecialchars($field['description']) ?>" />
      (displayed after field)
    </div>
  </div>

  <div style="display: none" class="fieldOption checkboxOptions">
    <div class="label">Checked Value</div>
    <div><input name="checkedValue" size="40" value="<?php echo htmlspecialchars($field['checkedValue']) ?>" /></div>
  </div>

  <div style="display: none" class="fieldOption checkboxOptions">
    <div class="label">Unchecked Value</div>
    <div><input name="uncheckedValue" size="40" value="<?php echo htmlspecialchars($field['uncheckedValue']) ?>" /></div>
  </div>


  <div style="display: none" class="fieldOption textboxHeight">
    <div class="label">Field Height</div>
    <div><input type="text" name="fieldHeight" value="<?php echo htmlspecialchars($field['fieldHeight']) ?>" size="4" /> pixels (leave blank for default height)</div>
  </div>

  <div style="display: none" class="fieldOption fieldWidth">
    <div class="label">Field Width</div>
    <div><input type="text" name="fieldWidth" value="<?php echo htmlspecialchars($field['fieldWidth']) ?>" size="4" /> pixels (leave blank for default width)</div>
  </div>

  <div style="display: none" class="fieldOption allowUploads"><br/>
    <div class="label">Allow Uploads</div>
    <div>
      <input type="hidden" name="allowUploads" value="0"/>
      <input type="checkbox" class="inputCheckbox" id="allowUploads" name="allowUploads" value="1" <?php checkedIf($field['allowUploads'], '1') ?> />
      <label for="allowUploads">Allow uploads for this field</label>
    </div>
  </div>


  <div style="display: none" class="fieldOption dateOptions">

    <div class="label">Year Range</div>
    <div>
      <input type="text" name="yearRangeStart" value="<?php echo htmlspecialchars($field['yearRangeStart']); ?>" size="4" maxlength="4" /> to
      <input type="text" name="yearRangeEnd" value="<?php echo htmlspecialchars($field['yearRangeEnd']); ?>" size="4" maxlength="4" />
    </div>

    <div class="label">Specify Time</div>
    <div>
      <input type="hidden" name="showTime" value="0"/>
      <input type="checkbox" class="inputCheckbox" id="date_showHourMinFields" name="showTime" value="1" <?php checkedIf($field['showTime'], '1') ?> />
      <label for="date_showHourMinFields">user specifies time (hour, minutes, and optionally seconds)</label>
    </div>

    <div class="label">Use 24 Hour Time</div>
    <div>
      <input type="hidden" name="use24HourFormat" value="0"/>
      <input type="checkbox" class="inputCheckbox inputSubfield"  id="date_use24HourFormat" name="use24HourFormat" value="1" <?php checkedIf($field['use24HourFormat'], '1') ?> />
      <label for="date_use24HourFormat">use 24 hour time when specifying hours</label>
    </div>

    <div class="label">Specify Seconds</div>
    <div>
      <input type="hidden" name="showSeconds" value="0"/>
      <input type="checkbox" class="inputCheckbox inputSubfield"  id="date_showSecondsField" name="showSeconds" value="1" <?php checkedIf($field['showSeconds'], '1') ?> />
      <label for="date_showSecondsField">user specifies seconds (requires &quot;Specify Time&quot; to be enabled)</label>
    </div>


  </div>

  <div style="display: none" class="fieldOption listOptions">
    <div class="label">Display As</div>
    <table border="0" cellspacing="0" cellpadding="0"><tr><td>
      <input type="radio" class="inputRadio" id="listType.pulldown" name="listType" value="pulldown" <?php checkedIf($field['listType'], 'pulldown') ?> />
      <label for="listType.pulldown">pulldown</label><br />

      <input type="radio" class="inputRadio"  id="listType.radios" name="listType" value="radios" <?php checkedIf($field['listType'], 'radios') ?> />
      <label for="listType.radios">radio buttons</label><br />


      <input type="radio" class="inputRadio" id="listType.pulldownMulti" name="listType" value="pulldownMulti" <?php checkedIf($field['listType'], 'pulldownMulti') ?> />
      <label for="listType.pulldownMulti">pulldown (multi value)</label><br />

      <input type="radio" class="inputRadio"  id="listType.checkboxes" name="listType" value="checkboxes" <?php checkedIf($field['listType'], 'checkboxes') ?> />
      <label for="listType.checkboxes">checkboxes (multi value)</label><br />
    </td></tr></table>

    <br/>

    <div class="label">List Options</div>
    <table border="0" cellspacing="0" cellpadding="0"><tr><td>

      <select name="optionsType" id="optionsType" onchange="displayListTypeOptions()">
        <option value="text"  <?php selectedIf($field['optionsType'], 'text'); ?>>Use options listed below</option>
        <option value="table" <?php selectedIf($field['optionsType'], 'table'); ?>>Get options from database (advanced)</option>
        <option value="query" <?php selectedIf($field['optionsType'], 'query'); ?>>Get options from MySQL query (advanced)</option>
      </select><br/>

      <textarea name="optionsText" id="optionsText" cols="60" rows="3" onfocus="this.rows=10" onblur="this.rows=3" style="display: none;"><?php echo htmlspecialchars($field['optionsText']) ?></textarea>

      <table border="0" cellspacing="0" cellspadding="0" id="optionsTable" style="display: none;">
       <tr>
        <td>Section Tablename &nbsp;</td>
        <td>
          <select name="optionsTablename" id="optionsTablename" onchange="updateListOptionsFieldnames( this.value )">
          <option value="">&lt;select table&gt;</option>
<?php
  foreach ($tablesAndFieldnames as $optionTableName => $fields) {
    $selectedAttr = selectedIf($optionTableName, $field['optionsTablename'], 1);
    print "<option value=\"$optionTableName\" $selectedAttr>$optionTableName</option>\n";
  }
?>
          </select>
        </td>
       </tr>
       <tr>
        <td>Use this field for option values &nbsp;</td>
        <td><select name="optionsValueField" id="optionsValueField"><option value="">&lt;select field&gt;</option>
<?php
  foreach ($optionFieldnames as $optionFieldname) {
    $selectedAttr = selectedIf($optionFieldname, $field['optionsValueField'], 1);
    print "<option $selectedAttr>$optionFieldname</option>\n";
  }
?>
        </select></td>
       </tr>
       <tr>
        <td>Use this field for option labels &nbsp;</td>
        <td><select name="optionsLabelField" id="optionsLabelField"><option value="">&lt;select field&gt;</option>
<?php
  foreach ($optionFieldnames as $optionFieldname) {
    $selectedAttr = selectedIf($optionFieldname, $field['optionsLabelField'], 1);
    print "<option $selectedAttr>$optionFieldname</option>\n";
  }
?>
        </select>
        </td>
       </tr>
      </table>

      <textarea name="optionsQuery" id="optionsQuery" cols="60" rows="3" onfocus="this.rows=10" onblur="this.rows=3" style="display: none;" spellcheck="false"><?php echo htmlspecialchars($field['optionsQuery']) ?></textarea>
    </td></tr></table>
  </div>



  <div style="display: none" class="fieldOption uploadOptions">
  </div>



  <div style="display: none" class="fieldOption separatorOptions">
    <div class="label">Separator Type</div>
    <table border="0" cellspacing="0" cellpadding="0"><tr><td>
      <input type="radio" class="inputRadio" id="separatorType.blankLine" name="separatorType" value="blank line" <?php checkedIf($field['separatorType'], 'blank line') ?> /> <label for="separatorType.blankLine">Blank Line</label><br />

      <input type="radio" class="inputRadio" id="separatorType.headerBar" name="separatorType" value="header bar" <?php checkedIf($field['separatorType'], 'header bar') ?> /> <label for="separatorType.headerBar">Header Bar</label> &nbsp;<br />
      <input type="text" name="separatorHeader" value="<?php echo htmlspecialchars($field['separatorHeader']) ?>" size="75" class="inputSubfield" /><br />

      <input type="radio" class="inputRadio" id="separatorType.html" name="separatorType" value="html" <?php checkedIf($field['separatorType'], 'html') ?> /> <label for="separatorType.html">HTML</label><br />
      <textarea name="separatorHTML" cols="60" rows="3"  onfocus="this.rows=12" onblur="this.rows=3" wrap="off" class="inputSubfield"><?php echo htmlspecialchars($field['separatorHTML']) ?></textarea>
    </td></tr></table>
  </div>


  </div>
  </fieldset><br/>


<fieldset>
  <legend><b>Input Validation</b> (
    <a href="#" class="showLink" style="<?php if ($showValidation) echo 'display:none' ?>">show all</a>
    <a href="#" class="hideLink" style="<?php if (!$showValidation) echo 'display:none' ?>">hide all</a>
  )</legend>

  <div style="text-align: center; padding-top: 5px; <?php if ($showValidation) echo 'display:none' ?>" class="sectionClosedMessage">
    <a href="#">Click here to display</a><br/>
  </div>

  <div id="validationRulesContainer" class="container" style="<?php if (!$showValidation) echo 'display:none' ?>">
  <br/>

  <div style="display: none" class="fieldOption noValidationRules" align="center">
    There are no validation rules for this field type.<br/><br/>
  </div>

  <div style="display: none" class="fieldOption requiredValue">
    <div class="label">Required</div>
    <div>
      <input type="hidden" name="isRequired" value="0" />
      <input type="checkbox" class="inputCheckbox" id="valueIsRequired" name="isRequired" value="1" <?php checkedIf($field['isRequired'], '1') ?> />
      <label for="valueIsRequired">user may not leave field blank</label>
    </div>
  </div>

  <div style="display: none" class="fieldOption uniqueValue">
    <div class="label">Unique</div>
    <div>
      <input type="hidden" name="isUnique" value="0"/>
      <input type="checkbox" class="inputCheckbox" id="valueMustBeUnique" name="isUnique" value="1" <?php checkedIf($field['isUnique'], '1') ?>/>
      <label for="valueMustBeUnique">user may not enter the same value as another record (not case-sensitive)</label>
    </div>
  </div>

  <div style="display: none" class="fieldOption minMaxLength">
    <br/>
    <div class="label">Min Length</div>
    <div>
      <input name="minLength" size="4" value="<?php echo htmlspecialchars(@$field['minLength']) ?>" /> characters
    </div>
    <div class="label">Max Length</div>
    <div>
      <input name="maxLength" size="4" value="<?php echo htmlspecialchars(@$field['maxLength']) ?>" /> characters
    </div>
  </div>

  <div style="display: none" class="fieldOption validationRule">
    <br/>
    <div class="label">Allowed Content</div>
    <div>
      <select name="charsetRule">
        <option value="">Allow all characters</option>
        <option value="allow"    <?php selectedIf($field['charsetRule'], 'allow') ?>>Only allow characters:</option>
        <option value="disallow" <?php selectedIf($field['charsetRule'], 'disallow') ?>>Disallow characters:</option>
      </select>
      <input type="text" name="charset" value="<?php echo htmlspecialchars(@$field['charset']) ?>" size="50" /><br/>

    </div>
  </div>

  <div style="display: none" class="fieldOption uploadValidationFields"><br/>
    <div class="label">Upload Settings</div>
    <table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>File extensions allowed: &nbsp;</td>
        <td><input type="text" name="allowedExtensions" value="<?php echo htmlspecialchars($field['allowedExtensions']) ?>" size="35" /><br /></td>
      </tr>
      <tr>
        <td>
          <input type="hidden"   name="checkMaxUploads" value="0" />
          <input type="checkbox" name="checkMaxUploads" id="checkMaxUploads" value="1" class="inputCheckbox" <?php checkedIf(@$field['checkMaxUploads'], '1'); ?> />
          <label for="checkMaxUploads">Maximum uploads:</label> &nbsp;
        </td>
        <td>
          <input type="text" name="maxUploads" value="<?php echo htmlspecialchars($field['maxUploads']) ?>" size="5" />
          files (uncheck for unlimited, set to 0 for none)
        </td>
      </tr>
      <tr>
        <td>
          <input type="hidden"   name="checkMaxUploadSize" value="0" />
          <input type="checkbox" name="checkMaxUploadSize" id="checkMaxUploadSize" value="1" class="inputCheckbox" <?php checkedIf(@$field['checkMaxUploadSize'], '1'); ?> />
          <label for="checkMaxUploadSize">Maximum upload size:</label> &nbsp;
        </td>
        <td>
          <input type="text" name="maxUploadSizeKB" value="<?php echo htmlspecialchars($field['maxUploadSizeKB']) ?>" size="5" />
          Kbytes (uncheck for unlimited)
        </td>
      </tr>
      <tr>
        <td>
          <input type="hidden"   name="resizeOversizedImages" value="0" />
          <input type="checkbox" name="resizeOversizedImages" id="resizeOversizedImages" value="1" class="inputCheckbox" <?php checkedIf(@$field['resizeOversizedImages'], '1'); ?> />
          <label for="resizeOversizedImages">Resize images larger than:</label> &nbsp;
        </td>
        <td>
          height <input type="text" size="4" name="maxImageHeight" value="<?php echo htmlspecialchars($field['maxImageHeight']) ?>" />&nbsp;&nbsp;
          width <input size="4" name="maxImageWidth" value="<?php echo htmlspecialchars($field['maxImageWidth']) ?>" />
        </td>
      </tr>
      <tr>
        <td>
          <input type="hidden"   name="createThumbnails" value="0" />
          <input type="checkbox" name="createThumbnails" id="createThumbnails" value="1" class="inputCheckbox" <?php checkedIf(@$field['createThumbnails'], '1'); ?> />
          <label for="createThumbnails">Create image thumbnails:</label>
        </td>
        <td>
          height <input type="text" size="4" name="maxThumbnailHeight" id="maxThumbnailHeight" value="<?php echo htmlspecialchars($field['maxThumbnailHeight']) ?>" />&nbsp;&nbsp;
          width <input size="4"              name="maxThumbnailWidth"  id="maxThumbnailWidth" value="<?php echo htmlspecialchars($field['maxThumbnailWidth']) ?>" />

          <a href="#" onclick="recreateThumbnails(); return false;" id="recreateThumbnailsLink">recreate</a>

          <span id="recreateThumbnailsStatus">

          </span>
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <input type="checkbox" name="null" value="" style="visibility: hidden" />
          <i>Resized images maintain proportions, height and width are "maximum" values.</i>
        </td>
      </tr>
    </table>
  </div>

  </div>
  </fieldset><br/>


<fieldset>
  <legend><b>Advanced Options</b> (
    <a href="#" class="showLink" style="<?php if ($showAdvanced) echo 'display:none' ?>">show all</a>
    <a href="#" class="hideLink" style="<?php if (!$showAdvanced) echo 'display:none' ?>">hide all</a>
  )</legend>


  <div style="text-align: center; padding-top: 5px; <?php if ($showAdvanced) echo 'display:none' ?>" class="sectionClosedMessage">
    <a href="#">Click here to display</a><br/>
  </div>


  <div id="advancedOptionsContainer" class="container" style="<?php if (!$showAdvanced) echo 'display:none' ?>">
  <br/>

   <!-- Field Attributes -->
  <div class="label">Field Attributes</div>
  <div>
    <input type="hidden"   name="isSystemField" value="0" />
    <input type="checkbox" name="isSystemField" value="1" id="isSystemField" <?php checkedIf(@$field['isSystemField'], '1') ?> class="inputCheckbox" />
    <label for="isSystemField">System Field - restrict field editor access to this field</label><br/>
  </div>

  <div class="label">&nbsp;</div>
  <div>
    <input type="hidden"   name="adminOnly" value="0" />
    <input type="checkbox" name="adminOnly" value="1" id="adminOnly" <?php checkedIf(@$field['adminOnly'], '1') ?> class="inputCheckbox" />
    <label for="adminOnly">Admin Only - Field can only be modified by admin or section manager</label><br/>
  </div>

  <div style="display: none" class="fieldOption isPasswordField">
    <div class="label">&nbsp;</div>
    <div>
      <input type="hidden" name="isPasswordField" value="0"/>
      <input type="checkbox" class="inputCheckbox" id="textfield_isPasswordField" name="isPasswordField" value="1" <?php checkedIf($field['isPasswordField'], '1') ?> />
      <label for="textfield_isPasswordField">Password Field - hide text that users enter (show values as <code>*****</code>)</label>
    </div>
  </div>

  <div style="display: none" class="fieldOption disableAutoFormat">
    <div class="label">&nbsp;</div>
    <div>
      <input type="hidden" name="autoFormat" value="1"/>
      <input type="checkbox" class="inputCheckbox" id="textbox_autoFormat" name="autoFormat" value="0" <?php checkedIf($field['autoFormat'], '0') ?> />
      <label for="textbox_autoFormat">Disable auto-formatting (don't add break tags to content)</label>
    </div>
  </div>


  <!-- advanced upload options -->
  <div style="display: none" class="fieldOption advancedUploadFields"><br/>

    <div class="label">Upload Fields</div>
    <table border="0" cellspacing="0" cellpadding="0">
      <tr><td style="padding-bottom: 3px;">These extra fields will be display on the upload form and available in viewers.</td></tr>
      <tr><td style="padding-left: 15px">info1 &nbsp; <input type="text" name="infoField1" value="<?php echo htmlspecialchars(@$field['infoField1']) ?>" size="20" /></td></tr>
      <tr><td style="padding-left: 15px">info2 &nbsp; <input type="text" name="infoField2" value="<?php echo htmlspecialchars(@$field['infoField2']) ?>" size="20" /></td></tr>
      <tr><td style="padding-left: 15px">info3 &nbsp; <input type="text" name="infoField3" value="<?php echo htmlspecialchars(@$field['infoField3']) ?>" size="20" /></td></tr>
      <tr><td style="padding-left: 15px">info4 &nbsp; <input type="text" name="infoField4" value="<?php echo htmlspecialchars(@$field['infoField4']) ?>" size="20" /></td></tr>
      <tr><td style="padding-left: 15px">info5 &nbsp; <input type="text" name="infoField5" value="<?php echo htmlspecialchars(@$field['infoField5']) ?>" size="20" /></td></tr>
    </table>
  </div>

  <div style="display: none" class="fieldOption advancedUploadDir"><br/>
    <div class="label">Upload Directory</div>
    <table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
          <input type="hidden"   name="useCustomUploadDir" value="0" />
          <input type="checkbox" name="useCustomUploadDir" id="useCustomUploadDir" value="1" class="inputCheckbox" <?php checkedIf(@$field['useCustomUploadDir'], '1'); ?> />
        </td>
        <td colspan="2" valign="middle">&nbsp;<label for="useCustomUploadDir">Use custom upload directory:</label></td>
      </tr>
      <tr>
        <td></td>
        <td style="padding: 0px 5px 0px 12px">Directory Path</td>
        <td>
          <input type="text" name="customUploadDir" id="customUploadDir" value="<?php echo htmlspecialchars(@$field['customUploadDir']) ?>" size="50" />
          <a href="#" onclick="document.getElementById('customUploadDir').value='<?php echo $SETTINGS['uploadDir'] ?>'; return false;">reset</a><br/>
        </td>
      </tr>
      <tr>
        <td></td>
        <td style="padding: 0px 5px 0px 12px">Folder Url</td>
        <td>
          <input type="text" name="customUploadUrl" id="customUploadUrl" value="<?php echo htmlspecialchars(@$field['customUploadUrl']) ?>" size="50" />
          <a href="#" onclick="document.getElementById('customUploadUrl').value='<?php echo $SETTINGS['uploadUrl'] ?>'; return false;">reset</a><br/>
        </td>
      </tr>
    </table>
  </div>




  </div>
  </fieldset><br/>
</td></tr></table>

</div>
</form>

<script type="text/javascript" src="lib/jquery.js"></script>
<script type="text/javascript" src="lib/jqueryForm.js"></script>
<script type="text/javascript" src="lib/menus/database/editField_functions.js"></script>

</body>
</html>
