Location: PHPKode > projects > Top Music module > Top Music 3.0.7/html/modules/topMusic/admin/customFieldsArtist.php
<?php
/************************************************************************/
/* Top Music: Administration Module                                     */
/* ================================                                     */
/*                                                                      */
/* Copyright (c) 2004 by SergiDs.com                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$aid = trim($aid);
$result = mysql_query("select radminsuper from ".$prefix."_authors where aid='$aid'");
list($radminsuper) = mysql_fetch_row($result);
if ($radminsuper==1) {
?>
<script language="javascript">
function delField(field){
	if(confirm('Are you sure? This will delete all the data in this field on every artist')){
		document.getElementById("fieldForm").idfield.value=field;
		document.getElementById("fieldForm").fieldaction.value='del';
		document.getElementById("fieldForm").submit();
	}
}
function addField(){
	//TODO: check that there are no spaces
	var form = document.getElementById("fieldForm");
	form.action='admin.php?op=topmusic&action=addCustomfield';
	form.from.value='Artist';
	form.submit();
}
</script>
<table border="0" align="center">
  <tr>
    <td scope="col">&nbsp;</th>
    <td scope="col">&nbsp;</th>
    <td scope="col">&nbsp;</th>
  </tr>
  <tr>
    <th scope="col">&nbsp;</th>
    <th scope="col"><?=_TOPMUSIC_CUSTOMFIELDS_ARTIST?></th>
    <th scope="col">&nbsp;</th>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
    <table width="100%" border="0">
    <tr>
        <td><strong><?=_TOPMUSIC_NAME?></strong></td>
        <td>&nbsp;</td>
        <td><strong><?=_TOPMUSIC_DESCRIPTION?></strong></td>
        <td>&nbsp;</td>
        <td><strong><?=_TOPMUSIC_TYPE?></strong></td>
        <td>&nbsp;</td>
        <td><strong><?=_TOPMUSIC_IMAGEWIDTH?></strong></td>
        <td>&nbsp;</td>
        <td><strong><?=_TOPMUSIC_FILEPATH?></strong></td>
        <td>&nbsp;</td>
        <td><strong><?=_TOPMUSIC_FILEICON?></strong></td>
        <td>&nbsp;</td>
        <td><strong><?=_TOPMUSIC_VALUES?></strong></td>
      </tr>
	<?php
	 if(count($fieldsList)>0){
		foreach($fieldsList as $field){ ?>
	<tr>
        <td><?=$field->name?></td>
        <td>&nbsp;</td>
        <td><?=$field->description?></td>
        <td>&nbsp;</td>
        <td><?=$field->type?></td>
        <td>&nbsp;</td>
        <td><?=($field->image_width!="" && $field->image_width>0)?$field->image_width:"-";?></td>
        <td>&nbsp;</td>
        <td><?=($field->file_path!="")?$field->file_path:"-";?></td>
        <td>&nbsp;</td>
        <td><?=($field->file_icon!="")?$field->file_icon:"-";?></td>
        <td>&nbsp;</td>
        <td>
        <?php if($field->type=="select"){ ?>
        <select name="values_sample">
        <?php foreach(explode(";",$field->select_values) as $value){ ?>
        	<option><?=$value?></option>	
        <?php } ?>
        </select>
        <?php }else{ echo "-";}?>
        </td>
        <td>&nbsp;</td>
        <td><a href="#" onClick="delField(<?=$field->idfield?>)"><?=_TOPMUSIC_DELETE?></a></td>
      </tr>
	<?php } } ?>
      <form id="fieldForm" name="fieldForm" action="" method="post">
      <input type="hidden" name="idfield">
      <input type="hidden" name="fieldaction">
      <input type="hidden" name="from">
      <tr>
        <td colspan="7">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><select name="type">
        		<option value="text">Text</option>
        		<option value="textarea">Textarea</option>
        		<option value="select">Select</option>
        		<option value="file">File</option>
        		<option value="image">Image</option>
        		<option value="link">Link</option>
        	</select></td>
        <td>&nbsp;</td>
        <td><a href="#" onClick="addField()"><?=_TOPMUSIC_ADD?></a></td>
      </tr>
      </form>
    </table>
    </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<?php
} else {
	OpenTable();
    echo "Access Denied";
    CloseTable();
}
?>
Return current item: Top Music module