1.1 --- a/htdocs/index.lua Mon Feb 12 12:23:16 2007 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,110 +0,0 @@
1.4 -<%
1.5 -
1.6 -require "loona"
1.7 -
1.8 -function MLINK(section, text, ...)
1.9 - return '<a class="menu" href="' .. loona.href(section, unpack(arg)) ..
1.10 - '">' .. text .. '</a>'
1.11 -end
1.12 -
1.13 -function MALINK(section, text, ...)
1.14 - return '<a class="activemenu" href="' ..
1.15 - loona.href(section, unpack(arg)) .. '">' .. text .. '</a>'
1.16 -end
1.17 -
1.18 -function MENU(menupath, level)
1.19 - if loona.submenus[level] then
1.20 - local entries = loona.submenus[level].entries
1.21 - if entries then
1.22 - local activename = loona.submenus[level].name
1.23 - local numvis = 0
1.24 - for _, val in ipairs(entries) do
1.25 - if not val.notvisible then
1.26 - numvis = numvis + 1
1.27 - end
1.28 - end
1.29 - -- do not enter recursion if no entries are visible
1.30 - if numvis > 0 then%>
1.31 - <ul id="loonaMenu<%=level%>">
1.32 - <%for _, val in ipairs(entries) do
1.33 - if not val.notvisible then
1.34 - local curpath = (menupath and menupath .. "/" .. val.name) or val.name
1.35 - local label = (val.label ~= "" and val.label) or val.name%>
1.36 - <li>
1.37 - <%if activename == val.name then%>
1.38 - <%=MALINK(curpath, label, val.action)%>
1.39 - <%if val.subs or loona.authuser then%>
1.40 - <%MENU(curpath, level + 1)%>
1.41 - <%end%>
1.42 - <%else%>
1.43 - <%=MLINK(curpath, label, val.action)%>
1.44 - <%end%>
1.45 - </li>
1.46 - <%end
1.47 - end%>
1.48 - </ul>
1.49 - <%end
1.50 - end
1.51 - end
1.52 -end
1.53 -
1.54 --------------------------------------------------------------------------------
1.55 -
1.56 -loona.setheader "Content-Type: text/html\n\n"
1.57 -%>
1.58 -<?xml version="1.0"?>
1.59 -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1.60 -
1.61 -<html xmlns="http://www.w3.org/1999/xhtml" lang="<%=loona.lang%>">
1.62 -
1.63 -<head>
1.64 - <link rel="stylesheet" type="text/css" href='/loona.css' />
1.65 - <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
1.66 - <title>
1.67 - Loona CMS
1.68 - <%=loona.section and (": " .. (loona.section.title or loona.section.label or loona.section.name))%>
1.69 - </title>
1.70 -</head>
1.71 -
1.72 -<body>
1.73 -
1.74 - <div id="container">
1.75 -
1.76 - <div id="menu">
1.77 - <div id="loonaMenu">
1.78 - <%MENU(nil, 1)%>
1.79 - </div>
1.80 - </div>
1.81 -
1.82 - <div id="top">
1.83 - <div id="loonaTop">
1.84 - <%loona.body("top")%>
1.85 - </div>
1.86 - </div>
1.87 -
1.88 - <div id="main">
1.89 - <div id="loonaMain">
1.90 - <%loona.body("main")%>
1.91 - </div>
1.92 - </div>
1.93 -
1.94 - <div id="side">
1.95 - <div id="loonaSide">
1.96 - <%loona.body("side")%>
1.97 - </div>
1.98 - </div>
1.99 -
1.100 - <%if loona.config.debug == true then%>
1.101 - <div id="debug">
1.102 - <%=os.clock()%><br />
1.103 - <a href="http://validator.w3.org/check?uri=referer"><img
1.104 - src="http://www.w3.org/Icons/valid-xhtml10"
1.105 - alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
1.106 - </div>
1.107 - <%end%>
1.108 -
1.109 - </div>
1.110 -
1.111 -</body>
1.112 -
1.113 -</html>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/htdocs/loona.lua Mon Feb 12 12:28:13 2007 +0100
2.3 @@ -0,0 +1,110 @@
2.4 +<%
2.5 +
2.6 +require "loona"
2.7 +
2.8 +function MLINK(section, text, ...)
2.9 + return '<a class="menu" href="' .. loona.href(section, unpack(arg)) ..
2.10 + '">' .. text .. '</a>'
2.11 +end
2.12 +
2.13 +function MALINK(section, text, ...)
2.14 + return '<a class="activemenu" href="' ..
2.15 + loona.href(section, unpack(arg)) .. '">' .. text .. '</a>'
2.16 +end
2.17 +
2.18 +function MENU(menupath, level)
2.19 + if loona.submenus[level] then
2.20 + local entries = loona.submenus[level].entries
2.21 + if entries then
2.22 + local activename = loona.submenus[level].name
2.23 + local numvis = 0
2.24 + for _, val in ipairs(entries) do
2.25 + if not val.notvisible then
2.26 + numvis = numvis + 1
2.27 + end
2.28 + end
2.29 + -- do not enter recursion if no entries are visible
2.30 + if numvis > 0 then%>
2.31 + <ul id="loonaMenu<%=level%>">
2.32 + <%for _, val in ipairs(entries) do
2.33 + if not val.notvisible then
2.34 + local curpath = (menupath and menupath .. "/" .. val.name) or val.name
2.35 + local label = (val.label ~= "" and val.label) or val.name%>
2.36 + <li>
2.37 + <%if activename == val.name then%>
2.38 + <%=MALINK(curpath, label, val.action)%>
2.39 + <%if val.subs or loona.authuser then%>
2.40 + <%MENU(curpath, level + 1)%>
2.41 + <%end%>
2.42 + <%else%>
2.43 + <%=MLINK(curpath, label, val.action)%>
2.44 + <%end%>
2.45 + </li>
2.46 + <%end
2.47 + end%>
2.48 + </ul>
2.49 + <%end
2.50 + end
2.51 + end
2.52 +end
2.53 +
2.54 +-------------------------------------------------------------------------------
2.55 +
2.56 +loona.setheader "Content-Type: text/html\n\n"
2.57 +%>
2.58 +<?xml version="1.0"?>
2.59 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2.60 +
2.61 +<html xmlns="http://www.w3.org/1999/xhtml" lang="<%=loona.lang%>">
2.62 +
2.63 +<head>
2.64 + <link rel="stylesheet" type="text/css" href='/loona.css' />
2.65 + <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
2.66 + <title>
2.67 + Loona CMS
2.68 + <%=loona.section and (": " .. (loona.section.title or loona.section.label or loona.section.name))%>
2.69 + </title>
2.70 +</head>
2.71 +
2.72 +<body>
2.73 +
2.74 + <div id="container">
2.75 +
2.76 + <div id="menu">
2.77 + <div id="loonaMenu">
2.78 + <%MENU(nil, 1)%>
2.79 + </div>
2.80 + </div>
2.81 +
2.82 + <div id="top">
2.83 + <div id="loonaTop">
2.84 + <%loona.body("top")%>
2.85 + </div>
2.86 + </div>
2.87 +
2.88 + <div id="main">
2.89 + <div id="loonaMain">
2.90 + <%loona.body("main")%>
2.91 + </div>
2.92 + </div>
2.93 +
2.94 + <div id="side">
2.95 + <div id="loonaSide">
2.96 + <%loona.body("side")%>
2.97 + </div>
2.98 + </div>
2.99 +
2.100 + <%if loona.config.debug == true then%>
2.101 + <div id="debug">
2.102 + <%=os.clock()%><br />
2.103 + <a href="http://validator.w3.org/check?uri=referer"><img
2.104 + src="http://www.w3.org/Icons/valid-xhtml10"
2.105 + alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
2.106 + </div>
2.107 + <%end%>
2.108 +
2.109 + </div>
2.110 +
2.111 +</body>
2.112 +
2.113 +</html>