<?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"> </th>
<td scope="col"> </th>
<td scope="col"> </th>
</tr>
<tr>
<th scope="col"> </th>
<th scope="col"><?=_TOPMUSIC_CUSTOMFIELDS_ARTIST?></th>
<th scope="col"> </th>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>
<table width="100%" border="0">
<tr>
<td><strong><?=_TOPMUSIC_NAME?></strong></td>
<td> </td>
<td><strong><?=_TOPMUSIC_DESCRIPTION?></strong></td>
<td> </td>
<td><strong><?=_TOPMUSIC_TYPE?></strong></td>
<td> </td>
<td><strong><?=_TOPMUSIC_IMAGEWIDTH?></strong></td>
<td> </td>
<td><strong><?=_TOPMUSIC_FILEPATH?></strong></td>
<td> </td>
<td><strong><?=_TOPMUSIC_FILEICON?></strong></td>
<td> </td>
<td><strong><?=_TOPMUSIC_VALUES?></strong></td>
</tr>
<?php
if(count($fieldsList)>0){
foreach($fieldsList as $field){ ?>
<tr>
<td><?=$field->name?></td>
<td> </td>
<td><?=$field->description?></td>
<td> </td>
<td><?=$field->type?></td>
<td> </td>
<td><?=($field->image_width!="" && $field->image_width>0)?$field->image_width:"-";?></td>
<td> </td>
<td><?=($field->file_path!="")?$field->file_path:"-";?></td>
<td> </td>
<td><?=($field->file_icon!="")?$field->file_icon:"-";?></td>
<td> </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> </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"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </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> </td>
<td><a href="#" onClick="addField()"><?=_TOPMUSIC_ADD?></a></td>
</tr>
</form>
</table>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<?php
} else {
OpenTable();
echo "Access Denied";
CloseTable();
}
?>