luci-base, luci-mod-admin-full: store backup vars in luci configuration
[project/luci.git] / modules / luci-base / luasrc / dispatcher.luadoc
1 ---[[
2 LuCI web dispatcher.
3 ]]
4 module "luci.dispatcher"
5
6 ---[[
7 Build the URL relative to the server webroot from given virtual path.
8
9 @class function
10 @name build_url
11 @param ...      Virtual path
12 @return                 Relative URL
13 ]]
14
15 ---[[
16 Check whether a dispatch node shall be visible
17
18 @class function
19 @name node_visible
20 @param node     Dispatch node
21 @return         Boolean indicating whether the node should be visible
22 ]]
23
24 ---[[
25 Return a sorted table of visible childs within a given node
26
27 @class function
28 @name node_childs
29 @param node     Dispatch node
30 @return         Ordered table of child node names
31 ]]
32
33 ---[[
34 Send a 404 error code and render the "error404" template if available.
35
36 @class function
37 @name error404
38 @param message  Custom error message (optional)
39 @return                 false
40 ]]
41
42 ---[[
43 Send a 500 error code and render the "error500" template if available.
44
45 @class function
46 @name error500
47 @param message  Custom error message (optional)#
48 @return                 false
49 ]]
50
51 ---[[
52 Dispatch an HTTP request.
53
54 @class function
55 @name httpdispatch
56 @param request  LuCI HTTP Request object
57 ]]
58
59 ---[[
60 Dispatches a LuCI virtual path.
61
62 @class function
63 @name dispatch
64 @param request  Virtual path
65 ]]
66
67 ---[[
68 Generate the dispatching index using the native file-cache based strategy.
69
70
71 @class function
72 @name createindex
73 ]]
74
75 ---[[
76 Create the dispatching tree from the index.
77
78 Build the index before if it does not exist yet.
79
80 @class function
81 @name createtree
82 ]]
83
84 ---[[
85 Register a tree modifier.
86
87 @class function
88 @name modifier
89 @param  func    Modifier function
90 @param  order   Modifier order value (optional)
91 ]]
92
93 ---[[
94 Clone a node of the dispatching tree to another position.
95
96 @class function
97 @name assign
98 @param  path    Virtual path destination
99 @param  clone   Virtual path source
100 @param  title   Destination node title (optional)
101 @param  order   Destination node order value (optional)
102 @return                 Dispatching tree node
103 ]]
104
105 ---[[
106 Create a new dispatching node and define common parameters.
107
108 @class function
109 @name entry
110 @param  path    Virtual path
111 @param  target  Target function to call when dispatched.
112 @param  title   Destination node title
113 @param  order   Destination node order value (optional)
114 @return                 Dispatching tree node
115 ]]
116
117 ---[[
118 Fetch or create a dispatching node without setting the target module or
119
120 enabling the node.
121 @class function
122 @name get
123 @param  ...             Virtual path
124 @return                 Dispatching tree node
125 ]]
126
127 ---[[
128 Fetch or create a new dispatching node.
129
130 @class function
131 @name node
132 @param  ...             Virtual path
133 @return                 Dispatching tree node
134 ]]
135
136 ---[[
137 Alias the first (lowest order) page automatically
138
139
140 @class function
141 @name firstchild
142 ]]
143
144 ---[[
145 Create a redirect to another dispatching node.
146
147 @class function
148 @name alias
149 @param  ...             Virtual path destination
150 ]]
151
152 ---[[
153 Rewrite the first x path values of the request.
154
155 @class function
156 @name rewrite
157 @param  n               Number of path values to replace
158 @param  ...             Virtual path to replace removed path values with
159 ]]
160
161 ---[[
162 Create a function-call dispatching target.
163
164 @class function
165 @name call
166 @param  name    Target function of local controller
167 @param  ...             Additional parameters passed to the function
168 ]]
169
170 ---[[
171 Create a template render dispatching target.
172
173 @class function
174 @name template
175 @param  name    Template to be rendered
176 ]]
177
178 ---[[
179 Create a CBI model dispatching target.
180
181 @class function
182 @name cbi
183 @param  model   CBI model to be rendered
184 ]]
185
186 ---[[
187 Create a combined dispatching target for non argv and argv requests.
188
189 @class function
190 @name arcombine
191 @param trg1     Overview Target
192 @param trg2     Detail Target
193 ]]
194
195 ---[[
196 Create a CBI form model dispatching target.
197
198 @class function
199 @name form
200 @param  model   CBI form model tpo be rendered
201 ]]
202
203 ---[[
204 Access the luci.i18n translate() api.
205
206 @class  function
207 @name   translate
208 @param  text    Text to translate
209 ]]
210
211 ---[[
212 No-op function used to mark translation entries for menu labels.
213
214 This function does not actually translate the given argument but
215 is used by build/i18n-scan.pl to find translatable entries.
216
217 @class function
218 @name _
219 ]]
220