add added files
[bcm963xx.git] / userapps / broadcom / cfm / html / usr_menus.js
diff --git a/userapps/broadcom/cfm/html/usr_menus.js b/userapps/broadcom/cfm/html/usr_menus.js
new file mode 100755 (executable)
index 0000000..019a569
--- /dev/null
@@ -0,0 +1,280 @@
+/* -------------------------------------------------------------------------- */
+/*
+   (c) 2004-2005 U.S. Robotics Corporation.
+*/
+/* -------------------------------------------------------------------------- */
+
+
+/* --------------------------------------------------------------------------
+
+       Define the information for a single menu item (both main bar and sub-menu).
+       Each menu item has an associated filename, title, and description.
+       The title and description are translated, but not the filename.
+
+*/
+
+function MenuItem(strFilename, strTitle, strDescription, menuSub)
+{
+       this.strFilename = strFilename;
+       this.strTitle = strTitle;
+       this.strDescription = strDescription;
+       this.menuSub = menuSub;
+}
+
+
+/*
+       Arguments:
+               User name:              "admin" or "power" or "user"
+               Standard:               "annex_c" or ... what?
+               Protocol:               "Bridge" or ... what?
+               IP extension:   0 | 1
+               Firewall:               0 | 1
+               NAT:                            0 | 1
+               Wireless:               0 | 1
+               QoS:                            0 | 1
+*/
+function createMenu(strUsername, strStd, strProtocol, bIPext, bFirewall, bNAT, strWireless, bQoS)
+{
+       if (strUsername == "user")
+               return createMenuUser(strWireless);
+       else
+               return createMenuAdmin(strStd, strProtocol, bIPext, bFirewall, bNAT, strWireless, bQoS);
+}
+
+
+/* --------------------------------------------------------------------------
+
+       These represent the various menus. There is a main menu bar and some sub-menus.
+
+       The second and third strings in each item need to be translated.
+       The first string is a filename and does not need to be translated.
+
+       This is the only section that contains text to be translated.
+
+       The tag below must not be modified. It is used by
+       Translation to extract the text to be translated.
+       *** TRANSLATION START -->
+*/
+
+// N.B.: All filenames must be in lowercase here.
+
+function createMenuUser(strWireless)
+{
+// SUBMENUS
+       var menuStatus = new Array(
+                                                                               new MenuItem("info.html",                                       "General",                              ""),
+                                                                               new MenuItem("wancfg.cmd?action=view",  "DSL",                                  ""),
+                                                                               new MenuItem("logintro.html",                           "System Log",                   ""),
+                                                                               new MenuItem("statsifc.html",                           "LAN Statistics",               ""),
+                                                                               new MenuItem("statswan.cmd",                            "WAN Statistics",               ""),
+                                                                               new MenuItem("statsatm.cmd",                            "ATM Statistics",               ""),
+                                                                               new MenuItem("statsadsl.html",                  "ADSL Statistics",      "")
+                                                                       );
+
+
+       var menuLAN = new Array(
+                                                                               new MenuItem("rtroutecfg.cmd?action=view",              "Routing - Routing Table",      ""),
+                                                                               new MenuItem("arpview.cmd",                                                     "Routing - ARP Table",          "")
+                                                                       );
+
+
+       var menuDevice = new Array(
+                                                                               new MenuItem("backupsettings.html",                     "Back up Settings",     ""),
+                                                                               new MenuItem("updatesettings.html",                     "Restore Settings",     ""),
+                                                                               new MenuItem("upload.html",                                     "Upgrade",                              ""),
+                                                                               new MenuItem("diag.html",                                               "Diagnostics",                  ""));
+       if      (strWireless == "1")
+               menuDevice.push(new MenuItem("snmpconfig.html", "SNMP", ""));
+
+// MAIN MENU
+       var menuMain = new Array(
+                                                                               new MenuItem("",        "Status",       "View status",                                          menuStatus),
+                                                                               new MenuItem("",        "LAN",          "Configure local network",              menuLAN),
+                                                                               new MenuItem("",        "Device",       "Configure the modem",                  menuDevice)
+                                       );
+
+       return menuMain;
+}
+
+
+function createMenuAdmin(strStd, strProtocol, bIPext, bFirewall, bNAT, strWireless, bQoS)
+{
+       /*
+               STATUS
+       */
+       var menuStatus = new Array(
+                                                                               new MenuItem("info.html",                                       "General",                              ""),
+                                                                               new MenuItem("wancfg.cmd?action=view",  "DSL",                                  ""),
+                                                                               new MenuItem("logview.cmd",                             "System Log",                   ""),
+                                                                               new MenuItem("statsifc.html",                           "LAN Statistics",               ""),
+                                                                               new MenuItem("statswan.cmd",                            "WAN Statistics",               ""),
+                                                                               new MenuItem("statsatm.cmd",                            "ATM Statistics",               ""),
+                                                                               new MenuItem("statsadsl.html",                  "ADSL Statistics",      "")
+                                                                       );
+
+       /*
+               INTERNET
+       */
+       var menuISP = new Array(
+                                                                       new MenuItem(   "wancfg.cmd",                           "WAN Setup",    "")
+                                                               );
+       if (strStd == "annex_c")
+               menuISP.push(new MenuItem(      "adslcfgc.html",                                                "ADSL Settings",        ""));
+       else
+               menuISP.push(new MenuItem(      "adslcfg.html",                                         "ADSL Settings",        ""));
+
+       if (    ((strProtocol == "PPPoE") && !bIPext) ||
+                       ((strProtocol == "PPPoA") && !bIPext) ||
+                       (strProtocol == "MER") ||
+                       (strProtocol == "IPoA"))
+       {
+               menuISP.push(   new MenuItem("rtdefaultcfg.html",                               "Default Gateway",      ""),
+                                                       new MenuItem("dnscfg.html",                                             "DNS Server",                   ""));
+       }
+
+       if (strProtocol != "Bridge")
+               menuISP.push(   new MenuItem("scacccntr.cmd?action=view",               "Access Control - IP Addresses", ""),
+                                                       new MenuItem("scsrvcntr.cmd?action=view",               "Access Control - Services", "")
+                                               );
+       menuISP.push(new MenuItem(              "ddnsmngr.cmd",                                         "Dynamic DNS",          ""));
+
+       /*
+               LAN
+       */
+       var menuLAN = null;
+       if (    ((strProtocol == "PPPoE") && !bIPext) ||
+                       ((strProtocol == "PPPoA") && !bIPext) ||
+                       (strProtocol == "MER") ||
+                       (strProtocol == "IPoA"))
+       {
+               menuLAN = new Array(
+                                                                               new MenuItem("lancfg2.html",                                                    "DHCP Server",                          ""),
+                                                                               new MenuItem("portmap.cmd",                                                     "Video Interfaces",             ""),
+                                                                               new MenuItem("rtroutecfg.cmd?action=view",              "Routing - Routing Table",      ""),
+                                                                               new MenuItem("rtroutecfg.cmd?action=viewcfg",   "Routing - Static Routes",      ""),
+                                                                               new MenuItem("ripcfg.cmd?action=view",                          "Routing - RIP",                        ""),
+                                                                               new MenuItem("arpview.cmd",                                                     "Routing - ARP Table",          ""),
+                                                                               new MenuItem("dhcpinfo.html",                                                   "DHCP Clients",                 "")
+                                                                       );
+               if (bQoS)
+                       menuLAN.push(new MenuItem("qoscls.cmd?action=view", "Quality of Service", ""));
+       }
+       else if (strProtocol == "Bridge")
+       {
+               menuLAN = new Array(
+                                                                               new MenuItem("lancfg2.html",                                    "DHCP Server",                          ""),
+                                                                               new MenuItem("portmap.cmd",                                     "Video Interfaces",             "")
+                                                                       );
+               if (bQoS)
+                       menuLAN.push(new MenuItem("qoscls.cmd?action=view", "Quality of Service", ""));
+       }
+
+       /*
+               WIRELESS
+       */
+       var menuWireless = new Array(
+                                                                               new MenuItem("wlcfg.html",                                              "Setup",                                        ""),
+                                                                               new MenuItem("wlstationlist.cmd?",                      "Client List",                  ""),
+                                                                               new MenuItem("wlwds.cmd?action=view",           "AP Mode",                              ""),
+                                                                               new MenuItem("wlcfgadv.html",                                   "Advanced Settings",    "")
+                                                                       );
+
+       /*
+               SECURITY
+       */
+       var menuSecurity = new Array();
+       if (strWireless == "1")
+       {
+               menuSecurity.push(
+                                                                       new MenuItem("wlsecurity.html",                         "Wireless",                     ""),
+                                                                       new MenuItem("wlmacflt.cmd?action=view",        "MAC Filter",           "")
+                                                               );
+       }
+//WHY? if (strProtocol != "Bridge")
+       menuSecurity.push(new MenuItem("password.html", "Device Login", ""));
+       if ((strProtocol != "Not Applicable") && !bIPext)
+       {
+               if (strProtocol == "Bridge")
+               {
+                       menuSecurity.push(
+                                                                               new MenuItem("todmngr.tod?action=view", "Internet Access Control",      ""),
+                                                                               new MenuItem("scmacflt.cmd?action=view",        "LAN MAC Filter", "")
+                                                                       );
+               }
+
+               /*
+                       If it's not a bridge and the firewall is on, display filter commands
+               */
+               if ((strProtocol != "Bridge") && bFirewall)
+               {
+                       menuSecurity.push(
+                                                                               new MenuItem("todmngr.tod?action=view", "Internet Access Control",              ""),
+                                                                               new MenuItem("scoutflt.cmd?action=view",        "IP Filtering - Outbound Filters",      ""),
+                                                                               new MenuItem("scinflt.cmd?action=view", "IP Filtering - Inbound Filters",       "")
+                                                                       );
+               }
+
+               /*
+                       If NAT is enabled, display virtual server commands
+               */
+               if (bNAT)
+               {
+                       menuSecurity.push(
+                                                                               new MenuItem("scvrtsrv.cmd?action=view",        "Virtual Servers",      ""),
+                                                                               new MenuItem("scprttrg.cmd?action=view",        "Port Triggering",      ""),
+                                                                               new MenuItem("scdmz.html",                                              "DMZ Host",                             "")
+                                                                       );
+               }
+       }
+
+       /*
+               DEVICE
+       */
+       var menuDevice = new Array(
+                                                                                       new MenuItem("sntpcfg.html",                                    "Time",                                         ""),
+                                                                                       new MenuItem("ippcfg.html",                                     "Print Server",                 ""),
+                                                                                       new MenuItem("backupsettings.html",                     "Back Up Settings",             ""),
+                                                                                       new MenuItem("updatesettings.html",                     "Restore Settings",             ""),
+                                                                                       new MenuItem("resetrouter.html",                                "Restart",                                      ""),
+                                                                                       new MenuItem("upload.html",                                     "Upgrade",                                      ""),
+                                                                                       new MenuItem("defaultsettings.html",            "Restore Defaults",     ""),
+                                                                                       new MenuItem("diag.html",                                               "Diagnostics",                          ""));
+       if      (strWireless == "1")
+               menuDevice.push(new MenuItem("snmpconfig.html", "SNMP", ""));
+
+/*COMMENTED OUT OF HARP:
+       var menuVoice = new Array(
+                                                                               new MenuItem("scinflt.cmd?action=view", "NAT - Inbound Filters",        ""),
+                                                                               new MenuItem("scoutflt.cmd?action=view",        "NAT - Outbound Filters",       ""),
+                                                                               new MenuItem("voicecfg.html",                                   "Voice",                                                        ""),
+                                                                               new MenuItem("voicemgcpview.cmd",                       "MGCP",                                                 ""),
+                                                                               new MenuItem("voicestats45.html",                       "SIP",                                                  "")
+                                                                       );
+*/
+
+       /*
+               MAIN MENU
+       */
+       var menuMain = new Array(
+                                                                               new MenuItem("",        "Status",               "View status",                                                  menuStatus),
+                                                                               new MenuItem("",        "Internet",             "Configure ISP settings",                       menuISP)
+                                                                       );
+       if (menuLAN != null)
+               menuMain.push(                          new MenuItem("",        "LAN",                  "Configure local network",                      menuLAN));
+       if (strWireless == "1")
+               menuMain.push(                          new MenuItem("",        "Wireless",             "Configure wireless settings",  menuWireless));
+       if (menuSecurity != null)
+               menuMain.push(                          new MenuItem("",        "Security",             "Configure security",                           menuSecurity));
+       menuMain.push(                                  new MenuItem("",        "Device",               "Configure the modem",                          menuDevice)
+// NO VOICE                                                    new MenuItem("",        "Voice",                        "View voice statistics",                        menuVoice)
+                                       );
+
+       return menuMain;
+}
+
+/*
+       <-- TRANSLATION END ***
+       Nothing after this needs to be translated.
+       The above tag must not be modified. It is used by
+       Translation to extract the text to be translated.
+*/