]> git.sesse.net Git - vlc/blob - share/lua/http/requests/playlist.xml
Correct spelling: s/[sS]yncro/[sS]ynchro/
[vlc] / share / lua / http / requests / playlist.xml
1 <?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print'>'?>
2 <?vlc --[[
3 vim:syntax=lua
4 <!--  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
5 <  playlist.xml: VLC media player web interface
6 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
7 <  Copyright (C) 2005-2006 the VideoLAN team
8 <  $Id$
9 <
10 <  Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
11 <  Authors: Rob Jonson <rob -at- hobbyistsoftware -dot- com>
12 <
13 <  This program is free software; you can redistribute it and/or modify
14 <  it under the terms of the GNU General Public License as published by
15 <  the Free Software Foundation; either version 2 of the License, or
16 <  (at your option) any later version.
17 <
18 <  This program is distributed in the hope that it will be useful,
19 <  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 <  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 <  GNU General Public License for more details.
22 <
23 <  You should have received a copy of the GNU General Public License
24 <  along with this program; if not, write to the Free Software
25 <  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
27 ]] ?>
28
29 <?vlc
30
31 --package.loaded.httprequests = nil --uncomment to debug changes
32 require "httprequests"
33
34 local printleaf = function(item)
35         print ("\n<leaf")
36
37         for k,v in pairs(item) do
38
39                 if (k~="type") then
40                         print(" "..httprequests.xmlString(k).."=\""..httprequests.xmlString(v).."\"")
41                 end
42     end
43
44         print ("/>")
45 end
46
47 local printnode = function(item)
48         local children=NULL
49
50         print ("\n<node")
51
52         for k,v in pairs(item) do
53
54                 if (k=="type") then
55
56                 elseif (k=="children") then
57                         children=v._array
58                 else
59                         print(" "..httprequests.xmlString(k).."=\""..httprequests.xmlString(v).."\"")
60                 end
61     end
62
63         print (">")
64
65         return children
66 end
67
68 printitem = function(item)
69         local children=NULL
70
71         if item.type=="node" then
72                 children=printnode(item)
73                 if (children) then
74                         for i,v in ipairs(children) do
75                                 printitem(v)
76                         end
77                 end
78                 print ("</node>")
79         else
80                 printleaf(item)
81         end
82
83 end
84
85 httprequests.processcommands()
86
87 local pt=httprequests.playlisttable()
88
89 printitem(pt)
90
91
92 ?>