home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / xbmc-9.11.exe / web / default.asp
Encoding:
Text File  |  2009-12-23  |  24.6 KB  |  545 lines

  1. <%
  2.     if (isset("Action")) {
  3.         if (Action == "UnqueMusicplaylist") {
  4.             var ItemCount;
  5.             var z;
  6.             ItemCount = xbmcCommand("catalog","items");
  7.             for (z = 0;  z < ItemCount;  z = z + 1) {
  8.                 // dirty workaround, cause unque, + z won't work
  9.                 xbmcCommand("navigate", Action);
  10.                 xbmcCommand("catalog","unque");
  11.             }
  12.             Action = "musicplaylist";          
  13.         }
  14.         xbmcCommand("navigate", Action);
  15.     }
  16.     
  17.     if (isset("command")) {
  18.         // execute a few commands before listing the contents
  19.         if (command == "select") {
  20.             xbmcCommand("catalog", "select," + item);
  21.         } else if (command == "unque") {
  22.             xbmcCommand("catalog", "unque," + item);
  23.         }
  24.     }
  25.  
  26.     var navigatorstate;
  27.     var BannerClass;
  28.     var InfoClass;
  29.     var BackgroundClass;
  30.     var ItemFileClass;
  31.     navigatorstate = xbmcCommand("navigatorstate");
  32.  
  33.     if (isset("DisplayConfiguration")) {
  34.         BannerClass = "SiteBannerConfiguration";
  35.         InfoClass = "SiteInfoConfiguration";
  36.         BackgroundClass = "SiteBackgroundConfiguration";
  37.     } else if (isset("DisplayInfo")) {
  38.         BannerClass = "SiteBannerConfiguration";
  39.         InfoClass = "SiteInfoConfiguration";
  40.         BackgroundClass = "SiteBackgroundConfiguration";
  41.     } else if (navigatorstate == "pictures") {
  42.         BannerClass = "SiteBannerMyPictures";
  43.         InfoClass = "SiteInfoMyPictures";
  44.         BackgroundClass = "SiteBackgroundMyPictures";
  45.         ItemFileClass = "ItemFileMyPictures";
  46.     } else if (navigatorstate == "music") {
  47.         BannerClass = "SiteBannerMyMusic";
  48.         InfoClass = "SiteInfoMyMusic";
  49.         BackgroundClass = "SiteBackgroundMyMusic";
  50.         ItemFileClass = "ItemFileMyMusic";
  51.     } else if (navigatorstate == "videos") {
  52.         BannerClass = "SiteBannerMyVideos";
  53.         InfoClass = "SiteInfoMyVideos";
  54.         BackgroundClass = "SiteBackgroundMyVideos";
  55.         ItemFileClass = "ItemFileMyVideos";
  56.     } else if (navigatorstate == "musicplaylist") {
  57.         BannerClass = "SiteBannerMusicPlaylist";
  58.         InfoClass = "SiteInfoMusicPlaylist";
  59.         BackgroundClass = "SiteBackgroundMusicPlaylist";
  60.         ItemFileClass = "ItemFileMusicPlaylist";
  61.     } else if (navigatorstate == "videoplaylist") {
  62.         BannerClass = "SiteBannerVideoPlaylist";
  63.         InfoClass = "SiteInfoVideoPlaylist";
  64.         BackgroundClass = "SiteBackgroundVideoPlaylist";
  65.         ItemFileClass = "ItemFileVideoPlaylist";
  66.     } else {
  67.         BannerClass = "SiteBannerNone";
  68.         InfoClass = "SiteInfoLogo";
  69.         BackgroundClass = "SiteBackgroundHome";
  70.     }
  71.  
  72. %><?xml version="1.0" encoding="UTF-8"?>
  73. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  74.      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  75. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  76.     <head>
  77.         <title> XBMC - Remote Control </title>
  78.         <link href="styles/Project_Mayhem/screen.css" rel="stylesheet" type="text/css" />
  79.         <link rel="shortcut icon" href="/styles/Project_Mayhem/images/ShortcutIcon.ico" type="image/x-icon" />        
  80.  
  81.         <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  82.     </head>
  83.   
  84.     <body>
  85.     
  86.         <div id="SiteContainer" class="<% write(BackgroundClass); %>">
  87.  
  88.             <div id="SiteLeftContainer">
  89.                 <div id="SiteInfoContainer">
  90.                     <div id="<% write(InfoClass); %>"></div>
  91.                 </div>
  92.     
  93.                 <div id="SiteMenuContainer">
  94.                     <ul>
  95.                         <li class="MyPictures"><a href="default.asp?Action=pictures"><span>My Pictures</span></a></li>
  96.                         <li class="MyMusic"><a href="default.asp?Action=music"><span>My Music</span></a></li>
  97.                         <li class="MyVideos"><a href="default.asp?Action=videos"><span>My Videos</span></a></li>
  98.                         <li class="MusicPlaylist"><a href="default.asp?Action=musicplaylist"><span>Music Playlist</span></a></li>
  99.                         <li class="VideoPlaylist"><a href="default.asp?Action=videoplaylist"><span>Video Playlist</span></a></li>
  100.                     </ul>
  101.                 </div>
  102.       
  103.                 <div id="SiteControlContainer">
  104.                     <ul>
  105.                         <li class="Stop"><a href="/xbmcCmds/xbmcForm?command=stop" target="CommandFrame"><span>Stop</span></a></li>
  106.                         <li class="Play"><a href="/xbmcCmds/xbmcForm?command=play" target="CommandFrame"><span>Play</span></a></li>
  107.                         <li class="Pause"><a href="/xbmcCmds/xbmcForm?command=pause" target="CommandFrame"><span>Pause</span></a></li>
  108.                         <li class="Previous"><a href="/xbmcCmds/xbmcForm?command=previous" target="CommandFrame"><span>Previous</span></a></li>
  109.                         <li class="Next"><a href="/xbmcCmds/xbmcForm?command=next" target="CommandFrame"><span>Next</span></a></li>
  110.                         <li class="SkipForward"><a href="/xbmcCmds/xbmcHttp?command=SeekPercentageRelative(5)" target="CommandFrame"><span>Skip Forward</span></a></li>
  111.                         <li class="SkipBackward"><a href="/xbmcCmds/xbmcHttp?command=SeekPercentageRelative(-5)" target="CommandFrame"><span>Skip Backward</span></a></li>
  112.                     </ul>
  113.                 </div>
  114.             
  115.                 <div id="SiteSubMenuContainer">
  116.                     <ul>
  117.                         <li class="Subpanel"><a href=""><span>Subpanel</span></a>
  118.                             <ul>
  119.                                 <li><a href="SubRemote"><span>Remote</span></a></li>
  120.                                 <li><a href="SubConfiguration"><span>Configuration</span></a></li>
  121.                                 <li><a href="/xbmcCmds/xbmcForm?command=exit" target="CommandFrame"><span>Dashboard</span></a></li>
  122.                                 <li><a href="/xbmcCmds/xbmcForm?command=reboot" target="CommandFrame"><span>Reboot</span></a></li>
  123.                             </ul>
  124.                         </li>
  125. <!--
  126.                         <li class="Info"><a href="default.asp?DisplayInfo=true"><span>Info</span></a></li>                  
  127. -->
  128.                         <li class="Configuration"><a href="default.asp?DisplayConfiguration=true&page=bookmarks"><span>Sources</span></a></li>
  129.                         <li class="Reboot"><a href="/xbmcCmds/xbmcForm?command=restart" target="CommandFrame"><span>Reboot</span></a></li>
  130.                         <li class="Shutdown"><a href="/xbmcCmds/xbmcForm?command=shutdown" target="CommandFrame"><span>Shutdown</span></a></li>
  131.                     </ul>
  132.                 </div>
  133.  
  134.       <div id="SiteVolumeContainer">
  135.         <ul>
  136.                 <li class="vol0"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=0" target="CommandFrame"></a></li>
  137.                 <li class="vol10"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=10" target="CommandFrame"></a></li>
  138.                 <li class="vol20"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=20" target="CommandFrame"></a></li>
  139.               <li class="vol30"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=30" target="CommandFrame"></a></li>
  140.                 <li class="vol40"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=40" target="CommandFrame"></a></li>
  141.               <li class="vol50"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=50" target="CommandFrame"></a></li>
  142.                 <li class="vol60"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=60" target="CommandFrame"></a></li>
  143.               <li class="vol70"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=70" target="CommandFrame"></a></li>
  144.                 <li class="vol80"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=80" target="CommandFrame"></a></li>
  145.                  <li class="vol90"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=90" target="CommandFrame"></a></li>
  146.                 <li class="vol100"><a href="/xbmcCmds/xbmcHttp?command=setvolume¶meter=100" target="CommandFrame"></a></li>
  147.         </ul>
  148.     </div>    
  149.             </div>
  150.             
  151.     
  152.             <div id="SiteRightContainer">
  153.             
  154.                 <div id="SiteBannerContainer">
  155.                     <div id="<% write(BannerClass); %>"></div>
  156.                 </div>
  157.                 
  158.                 <div id="SiteContentContainer">
  159. <%
  160.  
  161.   if (isset("DisplayInfo") ) 
  162.   {
  163.     write("<a href='/scripts/SystemInfo.spy' target='_blank'>SystemInfo</a> \n");
  164.     write("<a href='/scripts/MediaInfo.spy' target='_blank'>MediaInfo</a> \n");
  165.   }
  166.   else if (isset("DisplayConfiguration") ) {
  167.     /*
  168.      * xbmc configuration options
  169.     
  170.       xbmcCfgBookmarkSize(type)
  171.       xbmcCfgGetBookmark(type, parameter, id)
  172.       xbmcCfgAddBookmark(type, name, path [, position])
  173.       xbmcCfgSaveBookmark(type, name, path, position)
  174.       xbmcCfgRemoveBookmark(type, position)
  175.       xbmcCfgSaveConfiguration(filename)
  176.       xbmcCfgGetOption(name)
  177.       xbmcCfgSetOption(name, value)
  178.     
  179.      */
  180.     
  181.     write("<a href='default.asp?DisplayConfiguration=true&page=bookmarks'>Sources</a> \n");
  182.  
  183.     write("<br />\n");
  184.     write("<br />\n");
  185.     
  186.     
  187.     /* if action isset we want to save / edit or remove something */
  188.     if (isset("action"))
  189.     {
  190.       if (action == "savebookmark")
  191.       {
  192.         if (isset("name") == "1" && isset("path") == "1" && isset("type") == "1" && isset("position") == "1")
  193.         {
  194.           xbmcCfgSaveBookmark(type, name, path, position);
  195.         }
  196.         else
  197.           write("Error");
  198.       }
  199.       if (action == "addbookmark")
  200.       {
  201.         if (isset("name") == "1" && isset("path") == "1" && isset("type") == "1")
  202.         {
  203.           xbmcCfgAddBookmark(type, name, path);
  204.         }
  205.         else
  206.           write("Error");
  207.       }
  208.       if (action == "remove")
  209.       {
  210.         if (isset("page"))
  211.         {
  212.           // return to bookmark page and not to editbookmarks
  213.           page = "bookmarks";
  214.           xbmcCfgRemoveBookmark(type, position);
  215.         }
  216.       }
  217.       if (action == "saveoptions")
  218.       {
  219.         xbmcCfgSetOption("home", home);
  220.         xbmcCfgSetOption("CDDBIpAdres", CDDBIpAdres);
  221.     
  222.         var usef = "no";
  223.         if (isset("useFDrive")) usef = "yes";
  224.         xbmcCfgSetOption("useFDrive", usef);
  225.     
  226.         var useg = "no";
  227.         if (isset("useGDrive")) useg = "yes";
  228.         xbmcCfgSetOption("useGDrive", useg);
  229.     
  230.         xbmcCfgSetOption("dashboard", dashboard);
  231.         xbmcCfgSetOption("dvdplayer", dvdplayer);
  232.         xbmcCfgSetOption("subtitles", subtitles);
  233.         xbmcCfgSetOption("startwindow", startwindow);
  234.         xbmcCfgSetOption("pictureextensions", pictureextensions);
  235.         xbmcCfgSetOption("musicextensions", musicextensions);
  236.         xbmcCfgSetOption("videoextensions", videoextensions);
  237.         xbmcCfgSetOption("thumbnails", thumbnails);
  238.         xbmcCfgSetOption("shortcuts", shortcuts);
  239.         xbmcCfgSetOption("albums", albums);
  240.         xbmcCfgSetOption("recordings", recordings);
  241.         xbmcCfgSetOption("screenshots", screenshots);
  242.     
  243.         var remcodes = "no";
  244.         if (isset("displayremotecodes")) remcodes = "yes";
  245.         xbmcCfgSetOption("displayremotecodes", remcodes);
  246.       }
  247.       if (action == "save")
  248.       {
  249.         xbmcCfgSaveConfiguration("XBoxMediaCenter.xml");
  250.       }
  251.     }
  252.     
  253.     if (isset("page"))
  254.     {
  255.       var i;
  256.       var name;
  257.       var value;
  258.       var options;
  259.     
  260.       if (page == "bookmarks")
  261.       {
  262.         var musicbookmarks = xbmcCfgBookmarkSize("music");
  263.         var picturebookmarks = xbmcCfgBookmarkSize("pictures");
  264.         var videobookmarks = xbmcCfgBookmarkSize("video");
  265.         var filebookmarks = xbmcCfgBookmarkSize("files");
  266.         var programbookmarks = xbmcCfgBookmarkSize("myprograms");
  267.         
  268.     
  269.         /* Add new Bookmark button */
  270.         write("<form name='new_bookmark' method='post' action='default.asp?DisplayConfiguration=true&page=addbookmark'>\n");
  271.         write("  <input type='submit' name='addnewbookmark' value='Add new source'><br>\n");
  272.         write("</form>\n");
  273.     
  274.         /* Display Music Bookmarks */
  275.         write("<form name='music_bookmarks' method='post' action='default.asp?DisplayConfiguration=true&page=editbookmark&type=music'>\n");
  276.         write("<br/>Music Sources:<br>\n");
  277.         write("  <input type='submit' name='action' value='edit'>\n");
  278.         write("  <input type='submit' name='action' value='remove'>\n");
  279.         write("  <select name='position'>\n");
  280.         i = 0;
  281.         for (i=1; i<=musicbookmarks; i=i+1)
  282.         {
  283.           write("    <option value=" + i + ">" + xbmcCfgGetBookmark("music", "name", i) + "</option>\n");
  284.         }
  285.         write("  </select>\n");
  286.         write("</form>\n");
  287.     
  288.         /* Display Picture Bookmarks */
  289.         write("<form name='picture_bookmarks' method='post' action='default.asp?DisplayConfiguration=true&page=editbookmark&type=pictures'>\n");
  290.         write("<br/>Picture Sources:<br>\n");
  291.         write("  <input type='submit' name='action' value='edit'>\n");
  292.         write("  <input type='submit' name='action' value='remove'>\n");
  293.         write("  <select name='position'>\n");
  294.         i = 0;
  295.         for (i=1; i<=picturebookmarks; i=i+1)
  296.         {
  297.           write("    <option value=" + i + ">" + xbmcCfgGetBookmark("pictures", "name", i) + "</option>\n");
  298.         }
  299.         write("  </select>\n");
  300.         write("</form>\n");
  301.     
  302.         /* Display Video Bookmarks */
  303.         write("<form name='video_bookmarks' method='post' action='default.asp?DisplayConfiguration=true&page=editbookmark&type=video'>\n");
  304.         write("<br/>Video Sources:<br>\n");
  305.         write("  <input type='submit' name='action' value='edit'>\n");
  306.         write("  <input type='submit' name='action' value='remove'>\n");
  307.         write("  <select name='position'>\n");
  308.         i = 0;
  309.         for (i=1; i<=videobookmarks; i=i+1)
  310.         {
  311.           write("    <option value=" + i + ">" + xbmcCfgGetBookmark("video", "name", i) + "</option>\n");
  312.         }
  313.         write("  </select>\n");
  314.         write("</form>\n");
  315.     
  316.       }
  317.       else if (page == "options")
  318.       {
  319.         write("    <form action='default.asp?DisplayConfiguration=true' method='post' name='cfgform' id='cfgform'>" + \
  320.               "        <input name='action' type='hidden' value='saveoptions'>" + \
  321.               "        <input name='page' type='hidden' value='options'>" + \
  322.               "        <table width='500'>");
  323.         write("            <tr>" + \
  324.               "                <td width='200'><label>Home</label></td>" + \
  325.               "                <td><input name='home' type='text' value='"); write(xbmcCfgGetOption("home")); write("' size='25'><br></td>" + \
  326.               "            </tr>");
  327.         write("            <tr>" + \
  328.               "                <td><label>CDDB IP Address</label></td><td>" + \
  329.               "                <input name='CDDBIpAdres' type='text' value='"); write(xbmcCfgGetOption("CDDBIpAdres")); write("' size='25'><br></td>" + \
  330.               "            </tr>");
  331.     
  332.         // Use F Drive
  333.         write("            <tr>" + \
  334.               "                    <td><label>Use F Drive</label></td><td>" + \
  335.               "           <input name='useFDrive' type='checkbox' value='true' ");
  336.               if (xbmcCfgGetOption("useFDrive") == "yes")    write("checked>");
  337.               else write(">");
  338.         write("         <br></td>" + \
  339.               "            </tr>");
  340.     
  341.         // Use G Drive
  342.         write("            <tr>" + \
  343.               "                    <td><label>Use G Drive</label></td><td>" + \
  344.               "           <input name='useGDrive' type='checkbox' value='true' ");
  345.               if (xbmcCfgGetOption("useGDrive") == "yes")    write("checked>");
  346.               else write(">");
  347.         write("         <br></td>" + \
  348.               "            </tr>");
  349.         write("            <tr>" + \
  350.               "                <td><label>Dashboard</label></td>" + \
  351.               "                <td><input name='dashboard' type='text' value='"); write(xbmcCfgGetOption("dashboard")); write("' size='25'><br></td>" + \
  352.               "            </tr>");
  353.         write("            <tr>" + \
  354.               "                <td><label>Dvdplayer</label></td>" + \
  355.               "                <td><input name='dvdplayer' type='text' value='"); write(xbmcCfgGetOption("dvdplayer")); write("' size='25'><br></td>" + \
  356.               "            </tr>");
  357.         write("            <tr>" + \
  358.               "                <td><label>Subtitles</label></td>" + \
  359.               "                <td><input name='subtitles' type='text' value='"); write(xbmcCfgGetOption("subtitles")); write("' size='25'><br></td>" + \
  360.               "            </tr>");
  361.         write("            <tr>" + \
  362.               "                <td><label>Startwindow</label></td>" + \
  363.               "                <td><input name='startwindow' type='text' value='"); write(xbmcCfgGetOption("startwindow")); write("' size='25'><br></td>" + \
  364.               "            </tr>");
  365.         write("            <tr>" + \
  366.               "                <td><label>Picture Extensions</label></td>" + \
  367.               "                <td><input name='pictureextensions' type='text' value='"); write(xbmcCfgGetOption("pictureextensions")); write("' size='25'><br></td>" + \
  368.               "            </tr>");
  369.         write("            <tr>" + \
  370.               "                <td><label>Music Extensions</label></td>" + \
  371.               "                <td><input name='musicextensions' type='text' value='"); write(xbmcCfgGetOption("musicextensions")); write("' size='25'><br></td>" + \
  372.               "            </tr>");
  373.         write("            <tr>" + \
  374.               "                <td><label>Video Extensions</label></td>" + \
  375.               "                <td><input name='videoextensions' type='text' value='"); write(xbmcCfgGetOption("videoextensions")); write("' size='25'><br></td>" + \
  376.               "            </tr>");
  377.         write("            <tr>" + \
  378.               "                <td><label>Thumbnails</label></td>" + \
  379.               "                <td><input name='thumbnails' type='text' value='"); write(xbmcCfgGetOption("thumbnails")); write("' size='25'><br></td>" + \
  380.               "            </tr>");
  381.         write("            <tr>" + \
  382.               "                <td><label>Shortcuts</label></td>" + \
  383.               "                <td><input name='shortcuts' type='text' value='"); write(xbmcCfgGetOption("shortcuts")); write("' size='25'><br></td>" + \
  384.               "            </tr>" );
  385.         write("            <tr>" + \
  386.               "                <td><label>Albums</label></td>" + \
  387.               "                <td><input name='albums' type='text' value='"); write(xbmcCfgGetOption("albums")); write("' size='25'><br></td>" + \
  388.               "            </tr>");
  389.         write("            <tr>" + \
  390.               "                <td><label>Recordings</label></td>" + \
  391.               "                <td><input name='recordings' type='text' value='"); write(xbmcCfgGetOption("recordings")); write("' size='25'><br></td>" + \
  392.               "            </tr>");
  393.         write("            <tr>" + \
  394.               "                <td><label>Screenshots</label></td>" + \
  395.               "                <td><input name='screenshots' type='text' value='"); write(xbmcCfgGetOption("screenshots")); write("' size='25'><br></td>" + \
  396.               "            </tr>");
  397.     
  398.         // Display remote codes
  399.         write("            <tr>" + \
  400.               "                    <td><label>Display remote codes</label></td><td>" + \
  401.               "           <input name='displayremotecodes' type='checkbox' value='true' ");
  402.               if (xbmcCfgGetOption("displayremotecodes") == "yes")    write("checked>");
  403.               else write(">");
  404.         write("         <br></td>" + \
  405.               "            </tr>");
  406.     
  407.         write("        </table><br>" + \
  408.               "        <input type='submit' name='save' value='save'>" + \
  409.               "    </form><br>");
  410.       }
  411.       else if (page == "editbookmark")
  412.       {
  413.         if (isset("type") == "1" && isset("position") == "1")
  414.         {
  415.           write("<form name='savebookmark' method='post' action='default.asp?DisplayConfiguration=true&page=bookmarks&action=savebookmark'>\n");
  416.           write("<input name='position' type='hidden' value='" + position + "'>\n");
  417.           write("<input name='type' type='hidden' value='" + type + "'>\n");
  418.           write("  <table width='500' border='0'>\n");
  419.           write("    <tr> \n");
  420.           write("      <td><label>name</label></td>\n");
  421.           write("      <td><input type='text' name='name' value='" + xbmcCfgGetBookmark(type, "name", position) + "'></td>\n");
  422.           write("    </tr>\n");
  423.           write("    <tr> \n");
  424.           write("      <td><label>path</label></td>\n");
  425.           write("      <td><input type='text' name='path' value='" + xbmcCfgGetBookmark(type, "path", position) + "'></td>\n");
  426.           write("    </tr>\n");
  427.           write("  </table><br>\n");
  428.           write("  <input type='submit' name='save' value='save'>\n");
  429.           write("</form>\n");
  430.         }
  431.       }
  432.       else if (page == "addbookmark")
  433.       {
  434.         var data = "<form name='addbookmark' method='post' action='default.asp?DisplayConfiguration=true&page=bookmarks&action=addbookmark'>\n";
  435.         data = data + "  <table width='500' border='0'>\n";
  436.         data = data + "    <tr> \n";
  437.         data = data + "      <td><label>Type</label></td>\n";
  438.         data = data + "      <td>";
  439.         data = data + "        <select name='type'>\n";
  440.         data = data + "          <option value=files>File</option>\n";
  441.         data = data + "          <option value=music>Music</option>\n";
  442.         data = data + "          <option value=myprograms>Program</option>\n";
  443.         data = data + "          <option value=pictures>Picture</option>\n";
  444.         data = data + "          <option value=video>Video</option>\n";
  445.         data = data + "        </select>\n";
  446.         data = data + "      </td>\n";
  447.         data = data + "    </tr>\n";
  448.         data = data + "    <tr> \n";
  449.         data = data + "      <td><label>Name</label></td>\n";
  450.         data = data + "      <td><input type='text' name='name' value=''></td>\n";
  451.         data = data + "    </tr>\n";
  452.         data = data + "    <tr> \n";
  453.         data = data + "      <td><label>Path</label></td>\n";
  454.         data = data + "      <td><input type='text' name='path' value=''></td>\n";
  455.         data = data + "    </tr>\n";
  456.         data = data + "  </table><br>\n";
  457.         data = data + "  <input type='submit' name='save' value='save'>\n";
  458.         data = data + "</form>\n";
  459.     
  460.         write(data);
  461.       }
  462.       if (page == "load_save")
  463.       {
  464.         write("<br><br><a href='default.asp?DisplayConfiguration=true&action=save'>Save</a>\n");
  465.       }
  466.     }
  467.  
  468.  
  469.   } else {
  470.  
  471.   
  472.     var z;
  473.     var n;
  474.     var i;
  475.     var data;
  476.   
  477.   
  478.     n = xbmcCommand("catalog","items"); // number of items to list
  479.     file = xbmcCommand("catalog","first");
  480.     
  481.     if ( n > 0) {
  482.         write("                    <ul id=\"ItemList\">\n");
  483.     }
  484.     
  485.     for (z=0; z<n; z=z+1)
  486.     {
  487.       var type = xbmcCommand("catalog","type," + z);
  488.   
  489.   
  490.       data = "                        <li>";
  491.   
  492.       if (type != "directory") {
  493.         // we have a file to play, send command to server when clicked and do not refresh the current page
  494.         data = data + "<div class=\"" + ItemFileClass + "\"></div>";
  495.       } else { 
  496.         data = data + "<div class=\"ItemFolder\"></div>"; 
  497.       }
  498.   
  499.   
  500.       if (file != ".." && navigatorstate != "musicplaylist" && navigatorstate != "videoplaylist" && navigatorstate != "pictures") {
  501.         data = data + "<div class=\"AddQueue\"><a href=\"/xbmcCmds/xbmcForm?command=catalog&parameter=que," + z + "\" target=\"CommandFrame\" title=\"add to queue\"><span>Q</span></a></div>";
  502.       } else if (navigatorstate == "musicplaylist" || navigatorstate == "videoplaylist")    {
  503.         data = data + "<div class=\"RemoveQueue\"><a href=\"default.asp?command=unque&item=" + z + "\" title=\"remove from queue\"><span>R</span></a></div>";
  504.       }
  505.   
  506.   
  507.       if (type != "directory") {
  508.         // we have a file to play, send command to server when clicked and do not refresh the current page
  509.         data = data + "<div class=\"FileName\"><a href=\"/xbmcCmds/xbmcForm?command=catalog&parameter=select," + z + "\" target=\"CommandFrame\">";
  510.       } else { 
  511.         data = data + "<div class=\"FileName\"><a href=\"default.asp?command=select&item=" + z + "\">"; 
  512.       }
  513.       
  514.       data = data + file + "</a></div>";
  515.       
  516.       data = data + "</li>\n";
  517.       write(data);
  518.       
  519.         
  520.       file = xbmcCommand("catalog","next");
  521.     }
  522.  
  523.     if ( n > 0) {
  524.         write("                    </ul>\n");
  525.     }
  526.     
  527.     if (navigatorstate == "musicplaylist") {
  528.         write ("<a href=\"default.asp?Action=UnqueMusicplaylist\" id=\"UnqueMusciplaylist\"><span>Clear Playlist</span></a>\n");
  529.     }
  530.  
  531.  
  532. }
  533. %>
  534.                 </div>
  535.     
  536.             </div>
  537.             
  538.         </div>
  539.         
  540.         <div id="SiteCommandContainer">
  541.             <iframe src="about:blank" width="1" height="1" name="CommandFrame"></iframe>
  542.         </div>
  543.   
  544.     </body>
  545. </html>
  546.