diff options
Diffstat (limited to 'libs/web/luasrc/view/cbi/tabmenu.htm')
-rw-r--r-- | libs/web/luasrc/view/cbi/tabmenu.htm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libs/web/luasrc/view/cbi/tabmenu.htm b/libs/web/luasrc/view/cbi/tabmenu.htm new file mode 100644 index 0000000000..7648fe011b --- /dev/null +++ b/libs/web/luasrc/view/cbi/tabmenu.htm @@ -0,0 +1,27 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2009 Jo-Philipp Wich <xm@subsignal.org> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> + +<%- if self.tabs then %> + <ul class="cbi-tabmenu"> + <%- self.selected_tab = luci.http.formvalue("tab." .. self.config .. "." .. section) %> + <%- for _, tab in ipairs(self.tab_names) do if #self.tabs[tab].childs > 0 then %> + <script type="text/javascript">cbi_c['container.<%=self.config%>.<%=section%>.<%=tab%>'] = <%=#self.tabs[tab].childs%>;</script> + <%- if not self.selected_tab then self.selected_tab = tab end %> + <li id="tab.<%=self.config%>.<%=section%>.<%=tab%>" class="cbi-tab<%=(tab == self.selected_tab) and '' or '-disabled'%>"> + <a onclick="this.blur(); return cbi_t_switch('<%=self.config%>.<%=section%>', '<%=tab%>')" href="<%=REQUEST_URI%>?tab.<%=self.config%>.<%=section%>=<%=tab%>"><%=self.tabs[tab].title%></a> + <% if tab == self.selected_tab then %><input type="hidden" id="tab.<%=self.config%>.<%=section%>" name="tab.<%=self.config%>.<%=section%>" value="<%=tab%>" /><% end %> + </li> + <% end end -%> + </ul> +<% end -%> |