Globally reduce copyright headers
[project/luci.git] / applications / luci-app-freifunk-widgets / luasrc / controller / freifunk / widgets.lua
1 -- Copyright 2012 Manuel Munz <freifunk at somakoma de>
2 -- Licensed to the public under the Apache License 2.0.
3
4 local require = require
5 module "luci.controller.freifunk.widgets"
6
7
8 function index()
9
10         local page  = node("admin", "freifunk", "widgets")
11         page.target = cbi("freifunk/widgets/widgets_overview")
12         page.title  = _("Widgets")
13         page.i18n   = "widgets"
14         page.order  = 30
15
16         local page  = node("admin", "freifunk", "widgets", "widget")
17         page.target = cbi("freifunk/widgets/widget")
18         page.leaf  = true
19
20         local page  = node("freifunk", "search_redirect")
21         page.target = call("search_redirect")
22         page.leaf  = true
23 end
24
25 function search_redirect()
26         local dsp = require "luci.dispatcher"
27         local http = require "luci.http"
28         local engine = http.formvalue("engine")
29         local searchterms = http.formvalue("searchterms") or ""
30         if engine then
31                 http.redirect(engine .. searchterms)
32         else
33                 http.redirect(dsp.build_url())
34         end
35 end