Location: PHPKode > projects > StreamOnTheFly > node/code/templates/editFiles.htm
{literal}
<SCRIPT language="javascript">
<!--
function setvalue(name, id, value){
var popurl="updatedb.php?name="+name+"&id="+id+"&value="+value
winpops=window.open(popurl,"","width=100,height=100,left=320,top=200")
}

function setcaption(name, id, value){
var str = prompt('Caption: ', value);
url = this.location.href;
if (url.indexOf('#') > 0) url = url.substring(0, url.indexOf('#'));
if(str) window.location.href = url+"&capname="+name+"&capid="+id+"&capvalue="+str+"&capurl="+escape(url)
else  window.location.href = this.location.href
}
// -->
</SCRIPT>
{/literal}

<form>
{if $NEW}
  <table width="100%">
    <tr valign="top">
      <td>
        <h4>{#New_prog_step1#}</h4>
        <h3>{#Edit_files#}</h3>
      </td>
      <td align="right">
        <input class="action" type="button" name="b1" value="{#goto_step2#}" onClick="redir(this.form, 'editMeta.php?new=1&id={$PRG_ID}')" />
      </td>
    </tr>
  </table>
{else}
<H3>{#Edit_files#}: <a class="goto_object" href="get.php?id={$PRG_DATA.id}">{$PRG_DATA.title}</a></h3>
    <div align="right">
      <input class="action" type="button" name="b1" value="{#edit_meta#}" onClick="redir(this.form, 'editMeta.php?id={$PRG_ID}')" />
    </div>
{/if}
</form>

<form>
<table class="tab">
  <tr> 
    <td nowrap class="tab">{#Prg_files#}</td>
  </tr>
</table>
<table class="tabarea" width="100%">
<tr> 
  <td class="tabarea"> 

    <table>
       <tr class="listhead">
          <th>{#filename#}</th>
          <th>{#format#}</th>
          <th>{#filesize#}</th>
          <th>{#last_modified#}</th>
          <th>{#play_length#}</th>
          <th>{#stream_access#}</th>
          <th>{#download_access#}</th>
          <th></th>
       </tr>
       {cycle name="prg" values="list1,list2" print=false advance=false}
       {foreach item=item from=$PRG_AUDIO}
          <tr class="{cycle name=prg}">
            <td>
              {if !empty($item.filename) }
              <a target="link" href="getFile.php/{$item.filename}?audio=1&id={$PRG_ID}&filename={$item.filename}">{$item.filename}</a>
              { else }
              <font color="red">{#missing#}</font>
              {/if}
            </td>
            <td>
              {$item.format}
            </td>
            <td>
              {$item.filesize}
            </td>
            <td>
              {$item.last_modified}
            </td>
            <td>
              { if $item.play_length }
              {$item.play_length} {#sec#}
              {/if}
            </td>
            <td>
                {if !empty($item.filename) }
                <input type="checkbox" onclick="javascript:setvalue('audiofilesa', '{$item.id}', this.checked);return true;"{ if $item.stream_access eq 't' } CHECKED="1" {/if} />
                {/if}
            </td>
            <td>
                {if !empty($item.filename) }
              <input type="checkbox" onclick="javascript:setvalue('audiofilesd', '{$item.id}', this.checked);return true;"{ if $item.download_access eq 't' } CHECKED="1" {/if} />
                {/if}
            </td>
            <td nowrap>
              {if empty($item.filename) }
              <input class="action" type="button" name="b1" value="{#convert#}" onClick="window.open('convert.php?id={$PRG_ID}&index={$item.index}','convert_progress','menubar=no, status=no, toolbar=no, width=350, height=180')" />
              {else}
                <input class="action" type="button" name="b1" value="{#delete#}" onClick="redir(this.form, 'editFiles.php?delfile={$item.id}&id={$PRG_ID}')" />
              {/if}
            </td>
          </tr>
          {/foreach}    
          <tr>
              <td colspan="4" align="left">
                 <input class="action" type="button" name="b1" value="{#add_content#}" onClick="popup('addFiles.php?main=1&prgid={$PRG_ID}','AddFiles',500,500,true)" />
              </td>
              <td colspan="8" align="right">
                {if $MAIN_AUDIO_COUNT gt 0 and $MISSING}
                   <input class="action" type="button" name="b2" value="{#convert_all#}" onClick="window.open('convert.php?id={$PRG_ID}&all=1','convert_progress','menubar=no, status=no, toolbar=no, width=350, height=400')" />
                {/if}
              </td>
          </tr>  
    </table>
 
 </td>
</tr>
</table>
</form>


<p></p>

	<a name="mfiles"></a>
<form>
<table class="tab">
  <tr> 
    <td nowrap class="tab">{#Files#}</td>
  </tr>
</table>
<table class="tabarea" width="100%">
<tr> 
  <td class="tabarea"> 
   {if $AUDIO_FILES }
        <div class="subheader">{#audio_file_list#}</div>
    <table>
       <tr class="listhead">
          <th>{#filename#}</th>
          <th>{#caption#}</th>
          <th>{#filesize#}</th>
          <th>{#last_modified#}</th>
          <th>{#play_length#}</th>
          <th>{#format#}</th>
          <th>{#stream_access#}</th>
          <th>{#download_access#}</th>
       </tr>
       {cycle name="audio" values="list1,list2" print=false advance=false}
       {foreach item=item from=$AUDIO_FILES}
          <tr class="{cycle name=audio}">
            <td>
              <a target="link" href="getFile.php/{$item.filename}?id={$PRG_ID}&filename={$item.filename}">{$item.filename}</a>
            </td>
            <td>
              {$item.caption}
            </td>
            <td>
              {$item.filesize}
            </td>
            <td>
              {$item.last_modified}
            </td>
            <td>
              {$item.play_length} {#sec#}
            </td>
            <td>
              {$item.format}
            </td>
            <td>
              <input type="checkbox" onclick="javascript:setvalue('audiofilesa', '{$item.id}', this.checked);return true;"{ if $item.stream_access eq 't' } CHECKED="1" {/if} />
            </td>
            <td>
              <input type="checkbox" onclick="javascript:setvalue('audiofilesd', '{$item.id}', this.checked);return true;"{ if $item.download_access eq 't' } CHECKED="1" {/if} />
            </td>
            <td nowrap>
              <input class="action" type="button" name="b1" value="{#change_caption#}" onClick="setcaption('mfiles', '{$item.id}', '{$item.caption}')" />
                <input class="action" type="button" name="b1" value="{#delete#}" onClick="redir(this.form, 'editFiles.php?delfile={$item.id}&id={$PRG_ID}')" />
            </td>
          </tr>
          {/foreach}    
    </table>
   {/if}
	<a name="ofiles"></a>
   {if $OTHER_FILES }
        <div class="subheader">{#other_file_list#}</div>
        <table>
       <tr class="listhead">
          <th>{#filename#}</th>
          <th>{#caption#}</th>
          <th>{#filesize#}</th>
          <th>{#last_modified#}</th>
          <th>{#mime_type#}</th>
          <th>{#public_access#}</th>
       </tr>
       {cycle name=other values="list1,list2" print=false advance=false}
       {foreach item=item from=$OTHER_FILES}
          <tr class="{cycle name=other}">
            <td>
              <a target="link" href="getFile.php/{$item.filename}?id={$PRG_ID}&filename={$item.filename}">{$item.filename}</a>
            </td>
            <td>
              {$item.caption}
            </td>
            <td>
              {$item.filesize}
            </td>
            <td>
              {$item.last_modified}
            </td>
            <td>
              {$item.mime_type}
            </td>
            <td>
              <input type="checkbox" onclick="javascript:setvalue('otherfiles', '{$item.id}', this.checked);return true;" { if $item.public_access eq 't' } CHECKED="1" {/if} />
            </td>
            <td nowrap>
                <input class="action" type="button" name="b1" value="{#change_caption#}" onClick="setcaption('ofiles', '{$item.id}', '{$item.caption}')" />
                <input class="action" type="button" name="b1" value="{#delete#}" onClick="redir(this.form, 'editFiles.php?delfile={$item.id}&id={$PRG_ID}')" />
            </td>
          </tr>
          {/foreach}    
    </table>
   {/if}
   {if !$AUDIO_FILES and !$OTHER_FILES }
        <p>{#no_files#}</p>
   {/if}
          <input class="action" type="button" name="b1" value="{#add_files#}" onClick="popup('addFiles.php?prgid={$PRG_ID}','AddFiles',500,500,true)" />
 
  </td>
</tr>
</table>
</form>

<p></p>
	<a name="links"></a>

<form>
<table class="tab">
  <tr> 
    <td nowrap class="tab">{#Links#}</td>
  </tr>
</table>
<table class="tabarea"  width="100%">
<tr> 
  <td class="tabarea">
   {if $LINKS } 
    <table>
       <tr class="listhead">
          <th>{#url#}</th>
          <th>{#caption#}</th>
          <th>{#public#}</th>
          <th>{#actions#}</th>
       </tr>
       {cycle name="links" values="list1,list2" print=false advance=false}
       {foreach item=item from=$LINKS}
          <tr class="{cycle name="links"}">
            <td>
              <a target="link" href="{$item.url}">{$item.url}</a>
            </td>
            <td>
              {$item.caption}
            </td>
            <td>
              <input type="checkbox" onclick="javascript:setvalue('links', '{$item.id}', this.checked);return true;"{ if $item.public_access eq 't' } CHECKED="1"{/if} />
            </td>
            <td nowrap>
                <input class="action" type="button" name="i1" value="{#change#}" onClick="popup('editLink.php?linkid={$item.id}&prgid={$PRG_ID}','EditLink',250,500,false)" />
                  <input class="action" type="button" name="i2" value="{#delete#}" onClick="redir(this.form,'editFiles.php?dellink=1&linkid={$item.id}&id={$PRG_ID}')" />

            </td>
          </tr>
          {/foreach}    
     </table>
    {else}
                <p>{#no_links#}</p>
    {/if}
          <input class="action" type="button" name="i3" value="{#add_link#}" onClick="popup('editLink.php?new=1&prgid={$PRG_ID}','EditLink',250,500,false)" />
  </td>
</tr>
</table>

</form>

{if $NEW}
  <div align="right">
    <input class="action" type="button" name="b1" value="{#goto_step2#}" onClick="redir(this.form, 'editMeta.php?new=1&id={$PRG_ID}')" />
  </div>
{/if}
Return current item: StreamOnTheFly