<h3>{#edit_series#}</h3>
{if hasPerm($SERIES_DATA, 'change') }
<table class="tab">
<tr>
<td nowrap class="tab">{#general_data#}</td>
</tr>
</table>
<table class="tabarea">
<tr>
<td class="tabarea">
<table width="100%">
<tr><td>
<form method="post">
<table>
<tr>
<td>{#title#}:</td>
<td><input name="name" value="{$SERIES_DATA.name}" size="60" maxlength="255" onChange="if(value != defaultValue) data_changed++;" /></td>
</tr>
<tr>
<td>{#languages#}:</td>
<td>
<select name="language1">
<option value="0">{#no_lang#}</option>
{html_options values=$LANG_CODES output=$LANG_NAMES selected=$PRG_LANG1}
</select>
<select name="language2">
<option value="0">{#no_second_lang#}</option>
{html_options values=$LANG_CODES output=$LANG_NAMES selected=$PRG_LANG2}
</select>
<select name="language3">
<option value="0">{#no_third_lang#}</option>
{html_options values=$LANG_CODES output=$LANG_NAMES selected=$PRG_LANG3}
</select>
</td>
</tr>
<tr>
<td>{#url#}:</td>
<td><input name="url" onChange="if(value != defaultValue) data_changed++;" value="{$SERIES_DATA.url|default:"http://"}" size="50" /></td>
</tr>
<tr>
<td>{#description#}:</td>
<td><textarea cols="50" rows="10" name="description" onChange="if(value != defaultValue) data_changed++;" >{$SERIES_DATA.description}</textarea></td>
</tr>
</table>
<input type="submit" name="save" value="{#save#}"> <input type="submit" name="finish" value="{#finish#}">
</form>
</td></tr>
</table>
</td>
</tr>
</table>
<p></p>
<a name="roles"></a>
<form>
<table class="tab">
<tr>
<td nowrap class="tab">{#Roles#}</td>
</tr>
</table>
<table class="tabarea">
<tr>
<td class="tabarea">
{if $ROLES}
<table>
<tr class="listhead"><th>{#Role#}</th><th>{#Contact#}</th><th>{#actions#}</th></tr>
{cycle name="roles" values="list1,list2" print=false advance=false}
{foreach item=item from=$ROLES}
<tr class="{cycle name=roles}">
<td>
{$item.role_name}
</td>
<td>
{$item.contact_data.name}
</td>
<td nowrap>
<input class="action" type="button" name="b1" value="{#change#}" onClick="popup('editRole.php?roleid={$item.id}&objectid={$SERIES_ID}','EditRole',300,550,false)" />
{if $item.change_contact }
<input class="action" type="button" name="b1" value="{#edit_contact#}" onClick="popup('editContact.php?id={$item.contact_id}','EditContact',500,500,true)" />
{/if}
<input class="action" type="button" name="b1" value="{#delete#}" onClick="redir(this.form, 'editSeries.php?delrole=1&roleid={$item.id}&seriesid={$SERIES_ID}')" />
</td>
</tr>
{/foreach}
</table>
{else}
<p>{#no_roles#}</p>
{/if}
<p>
<input class="action" type="button" name="b1" value="{#add_new_role#}" onClick="popup('editRole.php?new=1&objectid={$SERIES_ID}','EditRole',300,550,false)" />
</p>
</td>
</tr>
</table>
</form>
{/if}
<p></p>
{if hasPerm($SERIES_DATA, 'authorize') }
<a name="perms"></a>
<table class="tab">
<tr>
<td nowrap class="tab">{#access_permissions#}</td>
</tr>
</table>
<table class="tabarea">
<tr>
<td class="tabarea">
{if $PERMISSIONS}
<form>
<table>
<tr class="listhead"><th>{#username#}</th><th>{#permissions#}</th><th>{#actions#}</th></tr>
{cycle name="perms" values="list1,list2" print=false advance=false}
{foreach item=user key=userid from=$PERMISSIONS}
<tr class="{cycle name=perms}">
<td>{$user.name}</td>
<td>
{section name=i loop=$user.permissions}
{$user.permissions[i]}{if ! $smarty.section.i.last}, {/if}
{/section}
</td>
<td nowrap>
{if $USERNAME ne $user.name}
<input class="action" type="button" name="b1" value="{#change#}" onClick="popup('editPermissions.php?context=series&objectid={$SERIES_ID}&objectname={$SERIES}&userid={$userid}','Permissions',350,400,false)" />
<input class="action" type="button" name="b1" value="{#delete#}" onClick="redir(this.form, 'editSeries.php?delperm=1&userid={$userid}&seriesid={$SERIES_ID}')" />
{/if}
</td>
</tr>
{/foreach}
<tr class="{cycle name=perms}">
<td colspan="3">{#inherited_perms#}</td>
</tr>
</table>
</form>
{else}
<p>{#inherited_perms#}</p>
{/if}
<input type="button" name="addperm" value="{#change_perm#}" onClick="popup('editPermissions.php?context=series&objectid={$SERIES_ID}&objectname={$SERIES|escape}','Permissions',450,450, false)">
</td>
</tr>
</table>
{/if}
<p></p>
{if hasPerm($SERIES_DATA, 'change') }
<a name="icon"></a>
<table class="tab">
<tr>
<td nowrap class="tab">{#icons_and_jingles#}</td>
</tr>
</table>
<table class="tabarea">
<tr>
<td class="tabarea">
<form>
<table>
<tr>
<th>{#icon#}</th><th>{#jingle_list#}</th>
</tr>
<tr>
<td>
{if $ICON}
<img src="{$CACHE_URL}/{$SERIES_ID}.png" border="1">
{else}
<p>{#no_icon#}</p>
{/if}
</td>
<td>
<table>
<tr class="listhead"><th> </th><th>{#format#}</th><th>{#bitrate#}</th><th>{#channels#}</th><th>{#samplerate#}</th><th></th></tr>
{cycle values="list1,list2" print=false advance=false}
{foreach item=item from=$JINGLE}
<tr class="{cycle}">
<td>
{if $item.filename}
<a href="getJingle.php/{$SERIES_DATA.name}_jingle.mp3?id={$SERIES_ID}&file={$item.filename}">{#exists#}</a>
{else}
<font color="red">{#missing#}</font>
{/if}
</td>
<td>
{$item.format}
</td>
<td>
{$item.bitrate}
</td>
<td>
{$item.channels}
</td>
<td>
{$item.samplerate}
</td>
<td>
{if empty($item.filename) }
{if $HAS_JINGLE}
<input class="action" type="button" name="b1" value="{#convert#}" onClick="window.open('convert.php?jingle=1&id={$SERIES_ID}&index={$item.index}','mp3progress','menubar=no, status=no, toolbar=no, width=350, height=80')" />
{/if}
{else}
<input class="action" type="button" name="b1" value="{#delete#}" onClick="redir(this.form, 'editSeries.php?deljingle=1&filename={$item.filename}&index={$item.index}&seriesid={$SERIES_ID}')" />
{/if}
</td>
</tr>
{/foreach}
</table>
</td>
</tr>
</table>
</form>
{if $USERFILES}
{literal}
<script language="javascript">
function getSelected() {
return document.userfiles['filename'].options[document.userfiles['filename'].selectedIndex].value;
}
</script>
{/literal}
<form method="post" name="userfiles">
<input type="hidden" name="okURL" value="{$OKURL}">
<input type="hidden" name="seriesid" value="{$SERIES_ID}">
<p>{#userfiles#}: <select name="filename">{html_options values=$USERFILES output=$USERFILES}</select>
<input type="button" name="view" value="{#view#}" onClick="var file=getSelected(); popup('getUserFile.php/'+escape(file)+'?filename='+escape(file),'UserFile',400,400,false)">
<input type="submit" name="seticon" value="{#set_icon#}" onClick="return confirmUnsaved()" onClick="return confirmUnsaved()" >
<input type="submit" name="setjingle" value="{#set_jingle#}" onClick="return confirmUnsaved()" >
<br \><small>{#userfiles_expl#}</small>
</form>
{else}
<p>{#no_files#}</p>
{/if}
<small>
<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="15000000" />
<input type="hidden" name="seriesid" value="{$SERIES_ID}" />
<input name="userfile" type="file" />
<input type="submit" name="uploadicon" value="{#set_icon#}" onClick="return checkIfEmpty(this.form.userfile,'{#select_file#}') && confirmUnsaved()">
<input type="submit" name="uploadjingle" value="{#set_jingle#}" onClick="return checkIfEmpty(this.form.userfile,'{#select_file#}') && confirmUnsaved()" />
<br />{#upload_expl#}
</form>
</small>
</td>
</tr>
</table>
{/if}
<p></p>
<form method="post">
<input type="submit" name="finish2" value="{#finish#}">
<input type="button" onClick="self.close()" name="finish3" value="{#close#}">
</form>