local util = require('util')
app.on('scan_experience', function(exp)
--print_r(exp)
end)
app.on('scan_experience_file', function(exp)
end)
app.on('set', function(k,v)
end)
-- this registers the plugin UI
local plugin = {
name = "Global settings",
info = '',
opts = {
{
key='app.opts.plugin_global_title',
title='Title',
info='Preferably dot-style domain-notation for easy recollection',
default = "xrforge",
values=''
},
{
key='app.opts.plugin_global_subtitle',
title='Subtitle',
info='Slogan here',
default = "Portable XR experiences for Phone, VRheadset & desktop.",
values=''
},
{
key='app.opts.plugin_global_topmenu_mapname',
title='Overview link',
info='Top-right link
(overview page)',
default = "map",
values=''
},
{
key='app.opts.plugin_global_homepage',
title='Homepage',
info='Display 3D or 2D experiences on homepage',
default = "3D",
values={ ['3D'] = '3D', ['2D'] = '2D' },
},
{
key='app.opts.plugin_global_topmenu_html',
title='Menu html',
info='Add extra menu items here',
default = 'about',
control='textarea',
values=''
},
{
key='app.opts.plugin_global_headertags',
title='Header html',
info='Add extra header tags here',
default = [[
]],
control='textarea',
values=''
},
},
middleware = {
homepage_2D_or_3D = function(req,res,next)
if (app.opts.plugin_global_homepage == '3D') or (req.param.view == '3D') then
res.template = 'page/index.html'
else
res.template = 'page/dir.html'
end
next()
end
}
}
return plugin