Revert "Revert "and added files""
[bcm963xx.git] / userapps / broadcom / cfm / html / usr_menus_build.js
1 /* -------------------------------------------------------------------------- */
2 /*
3    (c) 2004-2005 U.S. Robotics Corporation.
4 */
5 /* -------------------------------------------------------------------------- */
6
7
8 /*
9         Arguments:
10                 User name:              "admin" or "power" or "user"
11                 Standard:               "annex_c" or ... what?
12                 Protocol:               "Bridge" or ... what?
13                 IP extension:   0 | 1
14                 Firewall:               0 | 1
15                 NAT:                            0 | 1
16                 Wireless:               0 | 1
17                 QoS:                            0 | 1
18 */
19 function createMenu(strUsername, strStd, strProtocol, bIPext, bFirewall, bNAT, strWireless, bQoS)
20 {
21         if (strUsername == "user")
22                 return createMenuUser(strWireless);
23         else
24                 return createMenuAdmin(strStd, strProtocol, bIPext, bFirewall, bNAT, strWireless, bQoS);
25 }
26
27
28 /* --------------------------------------------------------------------------
29
30         These represent the various menus. There is a main menu bar and some sub-menus.
31
32         The second and third strings in each item need to be translated.
33         The first string is a filename and does not need to be translated.
34
35         This is the only section that contains text to be translated.
36
37         The tag below must not be modified. It is used by
38         Translation to extract the text to be translated.
39         *** TRANSLATION START -->
40 */
41
42 // N.B.: All filenames must be in lowercase here.
43
44 function createMenuUser(strWireless)
45 {
46         var bar = new MenuBar(7);
47
48         var dropdown = bar.addDropdown("Status", 10);
49         dropdown.addItem("General", "", "info.html");
50         dropdown.addItem("DSL", "", "wancfg.cmd?action=view");
51         dropdown.addItem("System Log", "", "logintro.html");
52         dropdown.addItem("LAN Statistics", "", "statsifc.html");
53         dropdown.addItem("WAN Statistics", "", "statswan.cmd");
54         dropdown.addItem("ATM Statistics", "", "statsatm.cmd");
55         dropdown.addItem("ADSL Statistics", "", "statsadsl.html");
56
57         dropdown = bar.addDropdown("LAN", 10);
58         dropdown.addItem("Routing - Routing Table", "", "rtroutecfg.cmd?action=view");
59         dropdown.addItem("Routing - ARP Table", "", "arpview.cmd");
60
61         dropdown = bar.addDropdown("Device", 10);
62         dropdown.addItem("Back up Settings", "", "backupsettings.html");
63         dropdown.addItem("Diagnostics", "", "diag.html");
64         if      (strWireless == "1")
65                 dropdown.addItem("SNMP", "", "snmpconfig.html");
66
67         return bar;
68 }
69
70
71 function createMenuAdmin(strStd, strProtocol, bIPext, bFirewall, bNAT, strWireless, bQoS)
72 {
73         var bar = new MenuBar(7);
74
75         /*
76                 STATUS
77         */
78         var dropdown = bar.addDropdown("Status", 10);
79         dropdown.addItem("General", "", "info.html");
80         dropdown.addItem("DSL", "", "wancfg.cmd?action=view");
81         dropdown.addItem("System Log", "", "logview.cmd");
82         dropdown.addItem("LAN Statistics", "", "statsifc.html");
83         dropdown.addItem("WAN Statistics", "", "statswan.cmd");
84         dropdown.addItem("ATM Statistics", "", "statsatm.cmd");
85         dropdown.addItem("ADSL Statistics", "", "statsadsl.html");
86
87
88         /*
89                 INTERNET
90         */
91         dropdown = bar.addDropdown("Internet", 17);
92         dropdown.addItem("WAN Setup", "", "wancfg.cmd");
93         if (strStd == "annex_c")
94                 dropdown.addItem("ADSL Settings", "", "adslcfgc.html");
95         else
96                 dropdown.addItem("ADSL Settings", "", "adslcfg.html");
97
98         if (    ((strProtocol == "PPPoE") && !bIPext) ||
99                         ((strProtocol == "PPPoA") && !bIPext) ||
100                         (strProtocol == "MER") ||
101                         (strProtocol == "IPoA"))
102         {
103                 dropdown.addItem("Default Gateway", "", "rtdefaultcfg.html");
104                 dropdown.addItem("DNS Server", "", "dnscfg.html");
105         }
106
107         if (strProtocol != "Bridge")
108         {
109                 dropdown.addItem("Access Control - IP Addresses", "", "scacccntr.cmd?action=view");
110                 dropdown.addItem("Access Control - Services", "", "scsrvcntr.cmd?action=view");
111         }
112         dropdown.addItem("Dynamic DNS", "", "ddnsmngr.cmd");
113
114
115         /*
116                 LAN
117         */
118         if (    ((strProtocol == "PPPoE") && !bIPext) ||
119                         ((strProtocol == "PPPoA") && !bIPext) ||
120                         (strProtocol == "MER") ||
121                         (strProtocol == "IPoA") ||
122                         (strProtocol == "Bridge"))
123         {
124                 dropdown = bar.addDropdown("LAN", 13);
125                 if (    ((strProtocol == "PPPoE") && !bIPext) ||
126                                 ((strProtocol == "PPPoA") && !bIPext) ||
127                                 (strProtocol == "MER") ||
128                                 (strProtocol == "IPoA"))
129                 {
130                         dropdown.addItem("DHCP Server", "", "lancfg2.html");
131                         dropdown.addItem("Mapped Interfaces", "", "portmap.cmd");
132                         dropdown.addItem("Routing - Routing Table", "", "rtroutecfg.cmd?action=view");
133                         dropdown.addItem("Routing - Static Routes", "", "rtroutecfg.cmd?action=viewcfg");
134                         dropdown.addItem("Routing - RIP", "", "ripcfg.cmd?action=view");
135                         dropdown.addItem("Routing - ARP Table", "", "arpview.cmd");
136                         dropdown.addItem("DHCP Clients", "", "dhcpinfo.html");
137                         if (bQoS)
138                                 dropdown.addItem("Quality of Service", "", "qoscls.cmd?action=view");
139                 }
140                 else if (strProtocol == "Bridge")
141                 {
142                         dropdown.addItem("DHCP Server", "", "lancfg2.html");
143                         dropdown.addItem("Mapped Interfaces", "", "portmap.cmd");
144
145                         if (bQoS)
146                                 dropdown.addItem("Quality of Service", "", "qoscls.cmd?action=view");
147                 }
148         }
149
150
151         /*
152                 WIRELESS
153         */
154         if (strWireless == "1")
155         {
156                 dropdown = bar.addDropdown("Wireless", 11);
157                 dropdown.addItem("Setup", "", "wlcfg.html");
158                 dropdown.addItem("Client List", "", "wlstationlist.cmd?");
159                 dropdown.addItem("AP Mode", "", "wlwds.cmd?action=view");
160                 dropdown.addItem("Advanced Settings", "", "wlcfgadv.html");
161                 dropdown.addItem("Quality of Service", "", "wlqos.cmd");
162         }
163
164
165         /*
166                 SECURITY
167         */
168         dropdown = bar.addDropdown("Security", 17);
169         if (strWireless == "1")
170         {
171                 dropdown.addItem("Wireless", "", "wlsecurity.html");
172                 dropdown.addItem("MAC Filter", "", "wlmacflt.cmd?action=view");
173         }
174 //WHY?  if (strProtocol != "Bridge")
175         dropdown.addItem("Device Login", "", "password.html");
176         if ((strProtocol != "Not Applicable") && !bIPext)
177         {
178                 if (strProtocol == "Bridge")
179                 {
180                         dropdown.addItem("Internet Access Control", "", "todmngr.tod?action=view");
181                         dropdown.addItem("LAN MAC Filter", "", "scmacflt.cmd?action=view");
182                 }
183
184                 /*
185                         If it's not a bridge and the firewall is on, display filter commands
186                 */
187                 if ((strProtocol != "Bridge") && bFirewall)
188                 {
189                         dropdown.addItem("Internet Access Control", "", "todmngr.tod?action=view");
190                         dropdown.addItem("IP Filtering - Outbound Filters", "", "scoutflt.cmd?action=view");
191                         dropdown.addItem("IP Filtering - Inbound Filters", "", "scinflt.cmd?action=view");
192                 }
193
194                 /*
195                         If NAT is enabled, display virtual server commands
196                 */
197                 if (bNAT)
198                 {
199                         dropdown.addItem("Virtual Servers", "", "scvrtsrv.cmd?action=view");
200                         dropdown.addItem("Port Triggering", "", "scprttrg.cmd?action=view");
201                         dropdown.addItem("DMZ Host", "", "scdmz.html");
202                 }
203         }
204
205
206         /*
207                 DEVICE
208         */
209         dropdown = bar.addDropdown("Device", 10);
210         dropdown.addItem("Time", "", "sntpcfg.html");
211         dropdown.addItem("Print Server", "", "ippcfg.html");
212         dropdown.addItem("Back Up Settings", "", "backupsettings.html");
213         dropdown.addItem("Restore Settings", "", "updatesettings.html");
214         dropdown.addItem("Restart", "", "resetrouter.html");
215         dropdown.addItem("Upgrade", "", "upload.html");
216         dropdown.addItem("Restore Defaults", "", "defaultsettings.html");
217         dropdown.addItem("Diagnostics", "", "diag.html");
218         if      (strWireless == "1")
219                 dropdown.addItem("SNMP", "", "snmpconfig.html");
220
221         return bar;
222 }
223
224 /*
225         <-- TRANSLATION END ***
226         Nothing after this needs to be translated.
227         The above tag must not be modified. It is used by
228         Translation to extract the text to be translated.
229 */