<?PHP
#
#   FILE:  SPT--EditControlledNameList.html
#
#   REQUIRED FUNCTIONS:
#       DisplayControlledNameLists()
#           - Display list of controlled names from a query 
#
?>

<div align="center">
<table cellspacing="3" cellpadding="5" class="MDTable">
    <tr>
        <td colspan="2" class="colorHeader"><h1>Edit Option Lists</h1></td>
    </tr>
	<tr>
		<td colspan="2">
		    <?PHP PrintErrorMessages() ?>
    	</td>
    </tr>
    
<?PHP if(OptionListsExist()) { ?>

	<FORM NAME="updatecontrolledname" ACTION="index.php?P=UpdateControlledNameList" METHOD="POST">
    <tr>
    
        <td colspan="2">
				<b>Select options list:</b>&nbsp;&nbsp;
				<?php DisplayControlledNameLists(); ?>
		</td>
    </tr>
    </tr>
        <td colspan="2">
				<INPUT TYPE="SUBMIT" NAME="Submit" style="margin: 4px;" VALUE="Update Selected <?PHP PrintDisplayString(); ?>(s)">
				<INPUT TYPE="SUBMIT" NAME="Submit" style="margin: 4px;" VALUE="Delete Selected <?PHP PrintDisplayString(); ?>(s) from List">
				<INPUT TYPE="SUBMIT" NAME="Submit" style="margin: 4px;" VALUE="Cancel">
				<hr>
				<INPUT TYPE="SUBMIT" NAME="Submit" style="margin: 4px;" VALUE="Set Default Option For New Resources">
				<INPUT TYPE="SUBMIT" NAME="Submit" style="margin: 4px;" VALUE="Remove Default Option For New Resources">
				<hr>

				<INPUT TYPE="TEXT" SIZE="25" NAME="F_NewValue" VALUE="">
				<?PHP if(FieldUsesQualifiers())  PrintQualifierOrList(); ?>
				<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Add New <?PHP PrintDisplayString(); ?> to List">
        </td>
    </tr>
    </FORM>

<?PHP
}
else
{ ?>

    <tr>
        <td>
            <b>No Option List fields exist. Use the Metadata Field Editor to add an Option List.</b>
        </td>
    </tr>
    
<?PHP } ?>

</table>
</div>

<?PHP
function PrintBegin()
{
?>

        <b>Select <?php PrintDisplayString(); ?>(s) by checking box(es) below</b><hr noshade>
<?PHP
}

function PrintHeader()
{
?>
        </TD>
    </TR>
    <TR>
        <TD>
            <b><?PHP PrintDisplayString(); ?></b>
        </td>
        <?PHP if(FieldUsesQualifiers()) {  ?>
        <td>
            <b>Qualifier</b>
        </td>
        <?PHP
        }
}

function DisplayControlledNameSelection()
{
?>
        </TD>
    </TR>
    <TR>
        <TD>
    <INPUT TYPE="CHECKBOX" NAME="cnid_<?PHP PrintIndex() ; ?>" VALUE="<?PHP PrintControlledNameId(); ?>">
    <INPUT TYPE="TEXT" NAME="cn_<?PHP PrintIndex(); ?>" VALUE="<?PHP PrintControlledName(); ?>"><?PHP PrintDefaultString(); ?>
<?PHP
}

function DisplayQualifier()
{
?>

        </td>
        <td>
        <?PHP PrintQualifierOrList(); ?> 
        </td>

<?PHP
}

?>
