summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/local/www')
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/apple-touch-icon.pngbin4068 -> 4068 bytes
-rw-r--r--src/usr/local/www/bootstrap/css/pfSense-BETA.css14
-rw-r--r--src/usr/local/www/bootstrap/css/pfSense-dark-BETA.css3
-rw-r--r--src/usr/local/www/bootstrap/css/pfSense-dark.css10
-rw-r--r--src/usr/local/www/bootstrap/css/pfSense.css38
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/LICENSE.txt0
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-Black.ttfbin163488 -> 163488 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-BlackItalic.ttfbin165444 -> 165444 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-Bold.ttfbin162464 -> 162464 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-BoldItalic.ttfbin163644 -> 163644 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-Italic.ttfbin161484 -> 161484 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-Light.ttfbin162420 -> 162420 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-LightItalic.ttfbin166492 -> 166492 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-Medium.ttfbin162588 -> 162588 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-MediumItalic.ttfbin165636 -> 165636 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-Regular.ttfbin162876 -> 162876 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-Thin.ttfbin163132 -> 163132 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/bootstrap/fonts/Roboto-ThinItalic.ttfbin168276 -> 168276 bytes
-rw-r--r--src/usr/local/www/classes/Form/Button.class.php3
-rw-r--r--src/usr/local/www/classes/Form/Group.class.php8
-rw-r--r--src/usr/local/www/classes/Form/Input.class.php39
-rw-r--r--src/usr/local/www/classes/Form/Section.class.php21
-rw-r--r--src/usr/local/www/classes/Form/Textarea.class.php2
-rw-r--r--src/usr/local/www/crash_reporter.php10
-rw-r--r--src/usr/local/www/csrf/csrf-magic.js11
-rw-r--r--src/usr/local/www/diag_arp.php16
-rw-r--r--src/usr/local/www/diag_backup.php56
-rw-r--r--src/usr/local/www/diag_confbak.php41
-rwxr-xr-xsrc/usr/local/www/diag_defaults.php6
-rwxr-xr-xsrc/usr/local/www/diag_dns.php30
-rwxr-xr-xsrc/usr/local/www/diag_dump_states.php143
-rw-r--r--src/usr/local/www/diag_dump_states_sources.php4
-rw-r--r--src/usr/local/www/diag_gmirror.php6
-rwxr-xr-xsrc/usr/local/www/diag_halt.php10
-rw-r--r--src/usr/local/www/diag_limiter_info.php8
-rw-r--r--src/usr/local/www/diag_nanobsd.php48
-rw-r--r--src/usr/local/www/diag_ndp.php11
-rw-r--r--src/usr/local/www/diag_packet_capture.php35
-rw-r--r--src/usr/local/www/diag_pftop.php41
-rw-r--r--src/usr/local/www/diag_ping.php6
-rwxr-xr-xsrc/usr/local/www/diag_reboot.php24
-rw-r--r--src/usr/local/www/diag_resetstate.php21
-rw-r--r--src/usr/local/www/diag_routes.php4
-rw-r--r--src/usr/local/www/diag_smart.php6
-rw-r--r--src/usr/local/www/diag_sockets.php6
-rw-r--r--src/usr/local/www/diag_states_summary.php18
-rw-r--r--src/usr/local/www/diag_tables.php133
-rw-r--r--src/usr/local/www/diag_testport.php46
-rw-r--r--src/usr/local/www/diag_traceroute.php71
-rw-r--r--src/usr/local/www/easyrule.php31
-rw-r--r--src/usr/local/www/edit.php108
-rw-r--r--src/usr/local/www/exec.php33
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/favicon.icobin1406 -> 1406 bytes
-rw-r--r--src/usr/local/www/filebrowser/browser.js28
-rw-r--r--src/usr/local/www/filebrowser/browser.php20
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_code.gifbin610 -> 610 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_database.gifbin621 -> 621 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_doc.gifbin1061 -> 1061 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_flash.gifbin627 -> 627 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_generic.gifbin1068 -> 1068 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_image.gifbin608 -> 608 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_js.gifbin1077 -> 1077 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_pdf.gifbin603 -> 603 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_php.gifbin603 -> 603 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_ppt.gifbin1071 -> 1071 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_system.gifbin601 -> 601 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_xls.gifbin1060 -> 1060 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/file_zip.gifbin612 -> 612 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/folder_generic.gifbin996 -> 996 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/icon_cancel.gifbin1024 -> 1024 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/icon_contract.gifbin599 -> 599 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/icon_expand.gifbin613 -> 613 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/icon_home.gifbin1027 -> 1027 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/icon_left.gifbin306 -> 306 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/filebrowser/images/icon_magnifier.gifbin568 -> 568 bytes
-rw-r--r--src/usr/local/www/firewall_aliases.php17
-rwxr-xr-xsrc/usr/local/www/firewall_aliases_edit.php99
-rwxr-xr-xsrc/usr/local/www/firewall_aliases_import.php4
-rw-r--r--src/usr/local/www/firewall_nat.php150
-rw-r--r--src/usr/local/www/firewall_nat_1to1.php54
-rw-r--r--src/usr/local/www/firewall_nat_1to1_edit.php56
-rw-r--r--src/usr/local/www/firewall_nat_edit.php85
-rw-r--r--src/usr/local/www/firewall_nat_npt.php222
-rw-r--r--src/usr/local/www/firewall_nat_npt_edit.php43
-rw-r--r--src/usr/local/www/firewall_nat_out.php38
-rw-r--r--src/usr/local/www/firewall_nat_out_edit.php40
-rw-r--r--src/usr/local/www/firewall_rules.php277
-rw-r--r--src/usr/local/www/firewall_rules_edit.php125
-rw-r--r--src/usr/local/www/firewall_schedule.php6
-rw-r--r--src/usr/local/www/firewall_schedule_edit.php27
-rw-r--r--src/usr/local/www/firewall_shaper.php19
-rw-r--r--src/usr/local/www/firewall_shaper_queues.php10
-rw-r--r--src/usr/local/www/firewall_shaper_vinterface.php82
-rw-r--r--src/usr/local/www/firewall_shaper_wizards.php7
-rw-r--r--src/usr/local/www/firewall_virtual_ip.php22
-rw-r--r--src/usr/local/www/firewall_virtual_ip_edit.php27
-rwxr-xr-xsrc/usr/local/www/foot.inc5
-rwxr-xr-xsrc/usr/local/www/graph.php4
-rw-r--r--src/usr/local/www/guiconfig.inc166
-rwxr-xr-xsrc/usr/local/www/head.inc50
-rw-r--r--src/usr/local/www/help.php22
-rw-r--r--src/usr/local/www/includes/functions.inc.php2
-rw-r--r--src/usr/local/www/index.php132
-rw-r--r--src/usr/local/www/interfaces.php123
-rw-r--r--src/usr/local/www/interfaces_assign.php17
-rw-r--r--src/usr/local/www/interfaces_bridge.php75
-rw-r--r--src/usr/local/www/interfaces_bridge_edit.php27
-rw-r--r--src/usr/local/www/interfaces_gif.php62
-rw-r--r--src/usr/local/www/interfaces_gre.php61
-rw-r--r--src/usr/local/www/interfaces_groups.php63
-rw-r--r--src/usr/local/www/interfaces_groups_edit.php28
-rw-r--r--src/usr/local/www/interfaces_lagg.php76
-rw-r--r--src/usr/local/www/interfaces_lagg_edit.php80
-rw-r--r--src/usr/local/www/interfaces_ppps.php76
-rw-r--r--src/usr/local/www/interfaces_ppps_edit.php45
-rw-r--r--src/usr/local/www/interfaces_qinq.php75
-rw-r--r--src/usr/local/www/interfaces_qinq_edit.php2
-rw-r--r--src/usr/local/www/interfaces_vlan.php68
-rw-r--r--src/usr/local/www/interfaces_vlan_edit.php4
-rw-r--r--src/usr/local/www/interfaces_wireless.php74
-rw-r--r--src/usr/local/www/interfaces_wireless_edit.php10
-rw-r--r--src/usr/local/www/jquery/jquery-1.11.2.min.js4
-rw-r--r--src/usr/local/www/jquery/jquery-1.12.0.min.js5
-rw-r--r--src/usr/local/www/jquery/jquery-ui-1.11.2.min.js13
-rw-r--r--src/usr/local/www/jquery/jquery-ui-1.11.4.min.js13
-rw-r--r--src/usr/local/www/jquery/pfSenseHelpers.js205
-rw-r--r--src/usr/local/www/license.php10
-rw-r--r--src/usr/local/www/load_balancer_monitor.php4
-rw-r--r--src/usr/local/www/load_balancer_monitor_edit.php4
-rw-r--r--src/usr/local/www/load_balancer_pool.php6
-rw-r--r--src/usr/local/www/load_balancer_pool_edit.php4
-rw-r--r--src/usr/local/www/load_balancer_setting.php4
-rw-r--r--src/usr/local/www/load_balancer_virtual_server.php6
-rwxr-xr-xsrc/usr/local/www/pkg.php56
-rw-r--r--src/usr/local/www/pkg_edit.php110
-rw-r--r--src/usr/local/www/pkg_mgr.php258
-rw-r--r--src/usr/local/www/pkg_mgr_install.php115
-rw-r--r--src/usr/local/www/pkg_mgr_installed.php74
-rw-r--r--src/usr/local/www/services_captiveportal.php75
-rw-r--r--src/usr/local/www/services_captiveportal_filemanager.php12
-rw-r--r--src/usr/local/www/services_captiveportal_hostname.php8
-rw-r--r--src/usr/local/www/services_captiveportal_hostname_edit.php2
-rw-r--r--src/usr/local/www/services_captiveportal_ip.php8
-rw-r--r--src/usr/local/www/services_captiveportal_mac.php12
-rw-r--r--src/usr/local/www/services_captiveportal_mac_edit.php13
-rw-r--r--src/usr/local/www/services_captiveportal_vouchers.php45
-rw-r--r--src/usr/local/www/services_captiveportal_zones.php4
-rw-r--r--src/usr/local/www/services_captiveportal_zones_edit.php2
-rw-r--r--src/usr/local/www/services_dhcp.php280
-rw-r--r--src/usr/local/www/services_dhcp_edit.php5
-rw-r--r--src/usr/local/www/services_dhcp_relay.php16
-rw-r--r--src/usr/local/www/services_dhcpv6.php138
-rw-r--r--src/usr/local/www/services_dhcpv6_relay.php53
-rw-r--r--src/usr/local/www/services_dnsmasq.php61
-rw-r--r--src/usr/local/www/services_dnsmasq_domainoverride_edit.php2
-rw-r--r--src/usr/local/www/services_dyndns.php91
-rw-r--r--src/usr/local/www/services_dyndns_edit.php64
-rw-r--r--src/usr/local/www/services_igmpproxy.php73
-rw-r--r--src/usr/local/www/services_igmpproxy_edit.php2
-rw-r--r--src/usr/local/www/services_ntpd.php45
-rw-r--r--src/usr/local/www/services_ntpd_gps.php52
-rw-r--r--src/usr/local/www/services_ntpd_pps.php34
-rw-r--r--src/usr/local/www/services_pppoe.php13
-rw-r--r--src/usr/local/www/services_pppoe_edit.php83
-rw-r--r--src/usr/local/www/services_rfc2136.php115
-rw-r--r--src/usr/local/www/services_rfc2136_edit.php52
-rw-r--r--src/usr/local/www/services_router_advertisements.php64
-rw-r--r--src/usr/local/www/services_snmp.php2
-rw-r--r--src/usr/local/www/services_unbound.php67
-rw-r--r--src/usr/local/www/services_unbound_acls.php13
-rw-r--r--src/usr/local/www/services_unbound_advanced.php79
-rw-r--r--src/usr/local/www/services_wol.php29
-rw-r--r--src/usr/local/www/shortcuts/pkg_upnp.inc (renamed from src/usr/local/www/shortcuts/pkg_upnp.php)2
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/sortable/LICENSE0
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/sortable/sortable-theme-bootstrap.css0
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/sortable/sortable.js0
-rwxr-xr-xsrc/usr/local/www/status.php18
-rw-r--r--src/usr/local/www/status_captiveportal.php2
-rw-r--r--src/usr/local/www/status_carp.php16
-rw-r--r--src/usr/local/www/status_dhcp_leases.php80
-rw-r--r--src/usr/local/www/status_dhcpv6_leases.php101
-rw-r--r--src/usr/local/www/status_filter_reload.php24
-rwxr-xr-xsrc/usr/local/www/status_gateway_groups.php82
-rw-r--r--src/usr/local/www/status_gateways.php34
-rw-r--r--src/usr/local/www/status_graph.php33
-rw-r--r--src/usr/local/www/status_graph_cpu.php13
-rw-r--r--src/usr/local/www/status_ipsec.php22
-rw-r--r--src/usr/local/www/status_ipsec_leases.php15
-rw-r--r--src/usr/local/www/status_ipsec_sad.php17
-rw-r--r--src/usr/local/www/status_ipsec_spd.php19
-rw-r--r--src/usr/local/www/status_lb_pool.php12
-rw-r--r--src/usr/local/www/status_lb_vs.php20
-rwxr-xr-xsrc/usr/local/www/status_logs.php516
-rw-r--r--src/usr/local/www/status_logs_common.inc993
-rw-r--r--src/usr/local/www/status_logs_filter.php709
-rwxr-xr-xsrc/usr/local/www/status_logs_filter_dynamic.php215
-rw-r--r--src/usr/local/www/status_logs_filter_summary.php182
-rw-r--r--src/usr/local/www/status_logs_settings.php27
-rw-r--r--src/usr/local/www/status_logs_vpn.php518
-rw-r--r--src/usr/local/www/status_ntpd.php199
-rw-r--r--src/usr/local/www/status_openvpn.php26
-rwxr-xr-xsrc/usr/local/www/status_pkglogs.php2
-rw-r--r--src/usr/local/www/status_queues.php80
-rw-r--r--src/usr/local/www/status_rrd_graph.php23
-rw-r--r--src/usr/local/www/status_rrd_graph_img.php300
-rw-r--r--src/usr/local/www/status_rrd_graph_settings.php5
-rwxr-xr-xsrc/usr/local/www/status_services.php10
-rw-r--r--src/usr/local/www/status_upnp.php70
-rw-r--r--src/usr/local/www/status_wireless.php10
-rw-r--r--src/usr/local/www/system.php66
-rw-r--r--src/usr/local/www/system_advanced_admin.php30
-rw-r--r--src/usr/local/www/system_advanced_firewall.php42
-rw-r--r--src/usr/local/www/system_advanced_misc.php40
-rw-r--r--src/usr/local/www/system_advanced_network.php6
-rw-r--r--src/usr/local/www/system_advanced_notifications.php33
-rw-r--r--src/usr/local/www/system_advanced_sysctl.php2
-rw-r--r--src/usr/local/www/system_authservers.php84
-rw-r--r--src/usr/local/www/system_camanager.php91
-rw-r--r--src/usr/local/www/system_certmanager.php203
-rw-r--r--src/usr/local/www/system_crlmanager.php12
-rw-r--r--src/usr/local/www/system_gateway_groups.php76
-rw-r--r--src/usr/local/www/system_gateway_groups_edit.php21
-rw-r--r--src/usr/local/www/system_gateways.php110
-rw-r--r--src/usr/local/www/system_gateways_edit.php79
-rw-r--r--src/usr/local/www/system_groupmanager.php81
-rw-r--r--src/usr/local/www/system_groupmanager_addprivs.php121
-rwxr-xr-xsrc/usr/local/www/system_hasync.php36
-rw-r--r--src/usr/local/www/system_routes.php114
-rw-r--r--src/usr/local/www/system_routes_edit.php2
-rw-r--r--src/usr/local/www/system_update_settings.php82
-rw-r--r--src/usr/local/www/system_usermanager.php73
-rw-r--r--src/usr/local/www/system_usermanager_addprivs.php123
-rw-r--r--src/usr/local/www/system_usermanager_passwordmg.php2
-rw-r--r--src/usr/local/www/system_usermanager_settings.php2
-rw-r--r--src/usr/local/www/system_usermanager_settings_ldapacpicker.php2
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/i-bottom.gifbin125 -> 125 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/i-repeater.gifbin91 -> 91 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/l.gifbin131 -> 131 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/minus.gifbin146 -> 146 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/page-file.pngbin211 -> 211 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/page-file_play.gifbin1021 -> 1021 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/page-file_x.gifbin630 -> 630 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/page-foldericon.pngbin210 -> 210 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/page-openfoldericon.pngbin219 -> 219 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/plus.gifbin149 -> 149 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/t.gifbin141 -> 141 bytes
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/tree/tree.js0
-rw-r--r--src/usr/local/www/vpn_ipsec.php19
-rw-r--r--src/usr/local/www/vpn_ipsec_keys.php128
-rw-r--r--src/usr/local/www/vpn_ipsec_keys_edit.php2
-rw-r--r--src/usr/local/www/vpn_ipsec_mobile.php11
-rw-r--r--src/usr/local/www/vpn_ipsec_phase1.php11
-rw-r--r--src/usr/local/www/vpn_ipsec_phase2.php24
-rw-r--r--src/usr/local/www/vpn_ipsec_settings.php20
-rw-r--r--src/usr/local/www/vpn_l2tp.php48
-rw-r--r--src/usr/local/www/vpn_l2tp_users.php60
-rw-r--r--src/usr/local/www/vpn_l2tp_users_edit.php98
-rw-r--r--src/usr/local/www/vpn_openvpn_client.php44
-rw-r--r--src/usr/local/www/vpn_openvpn_csc.php4
-rw-r--r--src/usr/local/www/vpn_openvpn_server.php33
-rw-r--r--src/usr/local/www/widgets/include/captiveportal.inc2
-rw-r--r--src/usr/local/www/widgets/include/carp_status.inc2
-rw-r--r--src/usr/local/www/widgets/include/dyn_dns_status.inc2
-rw-r--r--src/usr/local/www/widgets/include/gateways.inc2
-rw-r--r--src/usr/local/www/widgets/include/gmirror_status.inc2
-rw-r--r--src/usr/local/www/widgets/include/installed_packages.inc2
-rw-r--r--src/usr/local/www/widgets/include/interface_statistics.inc2
-rw-r--r--src/usr/local/www/widgets/include/interfaces.inc2
-rw-r--r--src/usr/local/www/widgets/include/ipsec.inc2
-rw-r--r--src/usr/local/www/widgets/include/load_balancer.inc2
-rw-r--r--src/usr/local/www/widgets/include/log.inc2
-rw-r--r--src/usr/local/www/widgets/include/ntp_status.inc2
-rw-r--r--src/usr/local/www/widgets/include/openvpn.inc2
-rw-r--r--src/usr/local/www/widgets/include/services_status.inc2
-rw-r--r--src/usr/local/www/widgets/include/smart_status.inc2
-rw-r--r--src/usr/local/www/widgets/include/thermal_sensors.inc2
-rw-r--r--src/usr/local/www/widgets/include/traffic_graph.inc2
-rw-r--r--src/usr/local/www/widgets/include/wake_on_lan.inc2
-rw-r--r--src/usr/local/www/widgets/javascript/cpu_graphs.js8
-rw-r--r--src/usr/local/www/widgets/javascript/thermal_sensors.js6
-rw-r--r--src/usr/local/www/widgets/javascript/traffic_graph.js8
-rw-r--r--src/usr/local/www/widgets/widgets/captive_portal_status.widget.php6
-rw-r--r--src/usr/local/www/widgets/widgets/carp_status.widget.php2
-rw-r--r--src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php58
-rw-r--r--src/usr/local/www/widgets/widgets/gateways.widget.php252
-rw-r--r--src/usr/local/www/widgets/widgets/installed_packages.widget.php18
-rw-r--r--src/usr/local/www/widgets/widgets/interface_statistics.widget.php14
-rw-r--r--src/usr/local/www/widgets/widgets/interfaces.widget.php7
-rw-r--r--src/usr/local/www/widgets/widgets/ipsec.widget.php32
-rw-r--r--src/usr/local/www/widgets/widgets/load_balancer_status.widget.php12
-rw-r--r--src/usr/local/www/widgets/widgets/log.widget.php94
-rw-r--r--src/usr/local/www/widgets/widgets/ntp_status.widget.php31
-rw-r--r--src/usr/local/www/widgets/widgets/openvpn.widget.php24
-rw-r--r--src/usr/local/www/widgets/widgets/picture.widget.php4
-rw-r--r--src/usr/local/www/widgets/widgets/rss.widget.php12
-rw-r--r--src/usr/local/www/widgets/widgets/services_status.widget.php26
-rw-r--r--src/usr/local/www/widgets/widgets/smart_status.widget.php2
-rw-r--r--src/usr/local/www/widgets/widgets/system_information.widget.php124
-rw-r--r--src/usr/local/www/widgets/widgets/thermal_sensors.widget.php24
-rw-r--r--src/usr/local/www/widgets/widgets/traffic_graphs.widget.php24
-rw-r--r--src/usr/local/www/widgets/widgets/wake_on_lan.widget.php2
-rw-r--r--src/usr/local/www/wizard.php31
-rw-r--r--src/usr/local/www/wizards/openvpn_wizard.xml52
-rw-r--r--src/usr/local/www/wizards/setup_wizard.xml6
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml20
-rw-r--r--src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc14
-rw-r--r--[-rwxr-xr-x]src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml20
-rwxr-xr-xsrc/usr/local/www/xmlrpc.php13
308 files changed, 8143 insertions, 5700 deletions
diff --git a/src/usr/local/www/apple-touch-icon.png b/src/usr/local/www/apple-touch-icon.png
index 7a4b975..7a4b975 100755..100644
--- a/src/usr/local/www/apple-touch-icon.png
+++ b/src/usr/local/www/apple-touch-icon.png
Binary files differ
diff --git a/src/usr/local/www/bootstrap/css/pfSense-BETA.css b/src/usr/local/www/bootstrap/css/pfSense-BETA.css
index 33ee5ac..7047033 100644
--- a/src/usr/local/www/bootstrap/css/pfSense-BETA.css
+++ b/src/usr/local/www/bootstrap/css/pfSense-BETA.css
@@ -1,3 +1,15 @@
@import url("/bootstrap/css/pfSense.css");
-/*** Experimental Changes Go Here ***/ \ No newline at end of file
+/*** Experimental Changes Go Here ***/
+
+.panel-heading a:link, .panel-heading a:visited {
+ color: #404040;
+ text-decoration: underline;
+}
+
+.panel-default>.panel-heading {
+ color: #404040;
+ background-color: #cccccc;
+ letter-spacing: 1px;
+}
+
diff --git a/src/usr/local/www/bootstrap/css/pfSense-dark-BETA.css b/src/usr/local/www/bootstrap/css/pfSense-dark-BETA.css
new file mode 100644
index 0000000..46f9283
--- /dev/null
+++ b/src/usr/local/www/bootstrap/css/pfSense-dark-BETA.css
@@ -0,0 +1,3 @@
+@import url("/bootstrap/css/pfSense-dark.css");
+
+/*** Experimental Changes Go Here ***/
diff --git a/src/usr/local/www/bootstrap/css/pfSense-dark.css b/src/usr/local/www/bootstrap/css/pfSense-dark.css
index 57ce484..6b6cbfd 100644
--- a/src/usr/local/www/bootstrap/css/pfSense-dark.css
+++ b/src/usr/local/www/bootstrap/css/pfSense-dark.css
@@ -347,4 +347,14 @@ input, select, textarea {
/* tree css */
ul.tree li A:link, ul.tree li A:hover, ul.tree li A:visited {
color : #ffffff;
+}
+
+textarea {
+ background-color: #bfbfbf;
+}
+
+/** Styling for jQuery autocomplete widget */
+.ui-autocomplete {
+ color: #212121;
+ background-color: #e0e0e0;
} \ No newline at end of file
diff --git a/src/usr/local/www/bootstrap/css/pfSense.css b/src/usr/local/www/bootstrap/css/pfSense.css
index fde1e66..a89930b 100644
--- a/src/usr/local/www/bootstrap/css/pfSense.css
+++ b/src/usr/local/www/bootstrap/css/pfSense.css
@@ -1,5 +1,4 @@
@import url("/bootstrap/css/bootstrap.min.css");
-@import url("/bootstrap/glyphicons/glyphicons-halflings.css");
@import url("/bootstrap/fonts/roboto.css");
html {
@@ -97,10 +96,6 @@ tr.disabled th {
margin-bottom: 10px;
}
-ul.context-links li a {
-
-}
-
/* navigation */
.navbar {
margin-bottom: 10px;
@@ -194,7 +189,7 @@ ul.context-links li a {
}
.panel-title {
- font-size: 20px;
+ font-size: 16px;
}
.panel-body {
@@ -550,8 +545,9 @@ footer a {
color: white;
padding-right: 15px;
padding-bottom: 17px;
- margin-top: -0.125em
-
+ margin-top: -0.125em;
+ width: 14px;
+ height: 14px
}
/* Used when you need an icon to act as a submit button **/
@@ -781,3 +777,29 @@ ul.tree li .over{
max-height: none !important;
}
}
+
+/** Override text-warning with something less red. */
+.text-warning {
+ color: #ffcc00;
+}
+
+/**Suppress href links when printing */
+a[href]:after {
+ content:normal
+}
+
+/** Text color for diff display when comapring configs */
+.diff-text {
+ color: #000000;
+}
+
+/** Eliminate overflow in available widgets, log filter, and manage log panels. (cause of scroll bar) */
+#widget-available_panel-body>.content>.row,
+#filter-panel_panel-body>.form-group,
+#manage-log-panel_panel-body>.form-group,
+/** optionally prevent more globally by using the class hierarchy */
+.panel-body.collapse.in>.content>.row,
+.panel-body.collapse.in>.form-group
+{
+ margin-right:0px;
+} \ No newline at end of file
diff --git a/src/usr/local/www/bootstrap/fonts/LICENSE.txt b/src/usr/local/www/bootstrap/fonts/LICENSE.txt
index d645695..d645695 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/LICENSE.txt
+++ b/src/usr/local/www/bootstrap/fonts/LICENSE.txt
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-Black.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-Black.ttf
index fbde625..fbde625 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-Black.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-Black.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-BlackItalic.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-BlackItalic.ttf
index 60f7782..60f7782 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-BlackItalic.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-BlackItalic.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-Bold.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-Bold.ttf
index a355c27..a355c27 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-Bold.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-Bold.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-BoldItalic.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-BoldItalic.ttf
index 3c9a7a3..3c9a7a3 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-BoldItalic.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-BoldItalic.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-Italic.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-Italic.ttf
index ff6046d..ff6046d 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-Italic.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-Italic.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-Light.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-Light.ttf
index 94c6bcc..94c6bcc 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-Light.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-Light.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-LightItalic.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-LightItalic.ttf
index 04cc002..04cc002 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-LightItalic.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-LightItalic.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-Medium.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-Medium.ttf
index 39c63d7..39c63d7 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-Medium.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-Medium.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-MediumItalic.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-MediumItalic.ttf
index dc743f0..dc743f0 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-MediumItalic.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-MediumItalic.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-Regular.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-Regular.ttf
index 8c082c8..8c082c8 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-Regular.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-Regular.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-Thin.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-Thin.ttf
index d695550..d695550 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-Thin.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-Thin.ttf
Binary files differ
diff --git a/src/usr/local/www/bootstrap/fonts/Roboto-ThinItalic.ttf b/src/usr/local/www/bootstrap/fonts/Roboto-ThinItalic.ttf
index 07172ff..07172ff 100755..100644
--- a/src/usr/local/www/bootstrap/fonts/Roboto-ThinItalic.ttf
+++ b/src/usr/local/www/bootstrap/fonts/Roboto-ThinItalic.ttf
Binary files differ
diff --git a/src/usr/local/www/classes/Form/Button.class.php b/src/usr/local/www/classes/Form/Button.class.php
index 0b2a9de..a6f2ef3 100644
--- a/src/usr/local/www/classes/Form/Button.class.php
+++ b/src/usr/local/www/classes/Form/Button.class.php
@@ -64,6 +64,9 @@ class Form_Button extends Form_Input
}
parent::__construct($name, $title, null);
+
+ if (isset($link))
+ unset($this->_attributes['name']);
}
protected function _getInput()
diff --git a/src/usr/local/www/classes/Form/Group.class.php b/src/usr/local/www/classes/Form/Group.class.php
index 64d1db3..ce11969 100644
--- a/src/usr/local/www/classes/Form/Group.class.php
+++ b/src/usr/local/www/classes/Form/Group.class.php
@@ -132,11 +132,11 @@ EOT;
foreach ($missingWidth as $input)
$input->setWidth($spaceLeft / count($missingWidth));
- if (strtolower($this->_labelTarget->get_Type()) == 'hidden')
+ if (strtolower($this->_labelTarget->getType()) == 'hidden')
$hidden = true;
$form_controls = array('input', 'select', 'button', 'textarea', 'option', 'optgroup', 'fieldset', 'label');
- if (in_array(strtolower($this->_labelTarget->gettagName()), $form_controls) && !$hidden)
+ if (in_array(strtolower($this->_labelTarget->getTagName()), $form_controls) && !$hidden)
$target = $this->_labelTarget->getId();
$inputs = implode('', $this->_inputs);
@@ -148,7 +148,9 @@ EOT;
$label = new Form_Element('label', false, ['for' => $target]);
$label->addClass('col-sm-'.Form::LABEL_WIDTH, 'control-label');
- $title = htmlspecialchars(gettext($this->_title));
+ if (!empty(trim($this->_title)) || is_numeric($this->_title)) {
+ $title = htmlspecialchars(gettext($this->_title));
+ }
return <<<EOT
{$element}
diff --git a/src/usr/local/www/classes/Form/Input.class.php b/src/usr/local/www/classes/Form/Input.class.php
index 9482c2b..4cdfb28 100644
--- a/src/usr/local/www/classes/Form/Input.class.php
+++ b/src/usr/local/www/classes/Form/Input.class.php
@@ -75,22 +75,43 @@ class Form_Input extends Form_Element
return $this->_title;
}
+ public function getValue()
+ {
+ return $this->_attributes['value'];
+ }
+
public function getName()
{
return $this->_attributes['name'];
}
+ public function setName($nm)
+ {
+ $this->_attributes['name'] = $nm;
+ $this->_attributes['id'] = $nm;
+ }
+
+ public function setValue($val)
+ {
+ $this->_attributes['value'] = $val;
+ }
+
+ public function setType($tp)
+ {
+ $this->_attributes['type'] = $tp;
+ }
+
public function getId()
{
return $this->_attributes['id'];
}
- public function get_Type()
+ public function getType()
{
return $this->_attributes['type'];
}
- public function gettagName()
+ public function getTagName()
{
return $this->_tagName;
}
@@ -143,6 +164,13 @@ class Form_Input extends Form_Element
return $this;
}
+ public function setIsRequired()
+ {
+ $this->_attributes['required'] = true;
+
+ return $this;
+ }
+
public function toggles($selector = null, $type = 'collapse')
{
if (isset($selector))
@@ -217,7 +245,12 @@ class Form_Input extends Form_Element
if (isset($this->_help))
{
- $help = gettext($this->_help);
+ /* Strings longer than this will break gettext. */
+ if (strlen($this->_help) < 7620) {
+ $help = gettext($this->_help);
+ } else {
+ $help = $this->_help;
+ }
if (!empty($this->_helpParams))
$help = call_user_func_array('sprintf', array_merge([$help], $this->_helpParams));
diff --git a/src/usr/local/www/classes/Form/Section.class.php b/src/usr/local/www/classes/Form/Section.class.php
index 1d4c67f..631562c 100644
--- a/src/usr/local/www/classes/Form/Section.class.php
+++ b/src/usr/local/www/classes/Form/Section.class.php
@@ -68,6 +68,27 @@ class Form_Section extends Form_Element
return $input;
}
+ // Shortcut, adds a group with a password and a confirm password field.
+ // The confirm password element is created by apprnding "_confirm" to the name supplied
+ // The value is overwritten with a default pattern (So the user cannot see it)
+ public function addPassword(Form_Input $input)
+ {
+ $group = new Form_Group($input->getTitle());
+ if($input->getValue() != "") {
+ $input->setValue(DMYPWD);
+ }
+
+ $input->setType("password");
+ $group->add($input);
+ $confirm = clone $input;
+ $confirm->setName($confirm->getName() . "_confirm");
+ $confirm->setHelp("Confirm");
+ $group->add($confirm);
+ $this->add($group);
+
+ return $input;
+ }
+
public function __toString()
{
$element = parent::__toString();
diff --git a/src/usr/local/www/classes/Form/Textarea.class.php b/src/usr/local/www/classes/Form/Textarea.class.php
index 1ca879e..f38fd85 100644
--- a/src/usr/local/www/classes/Form/Textarea.class.php
+++ b/src/usr/local/www/classes/Form/Textarea.class.php
@@ -51,7 +51,7 @@ class Form_Textarea extends Form_Input
public function setNoWrap()
{
- $this->_attributes['wrap'] = 'none';
+ $this->_attributes['style'] = 'white-space: pre;';
return $this;
}
diff --git a/src/usr/local/www/crash_reporter.php b/src/usr/local/www/crash_reporter.php
index 2c9ffc1..6cd5adc 100644
--- a/src/usr/local/www/crash_reporter.php
+++ b/src/usr/local/www/crash_reporter.php
@@ -99,7 +99,7 @@ $crash_report_header .= "\nCrash report details:\n";
exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
?>
<?php
- if (gettext($_POST['Submit']) == "Yes") {
+ if ($_POST['Submit'] == "Yes") {
echo gettext("Processing...");
if (!is_dir("/var/crash")) {
mkdir("/var/crash", 0750, true);
@@ -124,9 +124,9 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
print_r($resp);
echo "<p><a href=\"/\">" . gettext("Continue") . "</a>" . gettext(" and delete crash report files from local disk.") . "</p>";
} else {
- echo "Could not find any crash files.";
+ echo gettext("Could not find any crash files.");
}
- } else if (gettext($_POST['Submit']) == "No") {
+ } else if ($_POST['Submit'] == "No") {
array_map('unlink', glob("/var/crash/*"));
// Erase the contents of the PHP error log
fclose(fopen("/tmp/PHP_errors.log", 'w'));
@@ -147,11 +147,11 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
}
}
} else {
- echo "Could not locate any crash data.";
+ echo gettext("Could not locate any crash data.");
}
?>
<div class="panel panel-default">
- <div class="panel-heading"><?=gettext("Unfortunately we have detected a programming bug.")?></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Unfortunately we have detected a programming bug.")?></h2></div>
<div class="panel-body">
<div class="content">
<p>
diff --git a/src/usr/local/www/csrf/csrf-magic.js b/src/usr/local/www/csrf/csrf-magic.js
index d358b0f..a889773 100644
--- a/src/usr/local/www/csrf/csrf-magic.js
+++ b/src/usr/local/www/csrf/csrf-magic.js
@@ -40,10 +40,13 @@ CsrfMagic.prototype = {
send: function(data) {
if (!this.csrf_isPost) return this.csrf_send(data);
prepend = csrfMagicName + '=' + csrfMagicToken + '&';
- if (this.csrf_purportedLength === undefined) {
- this.csrf_setRequestHeader("Content-length", this.csrf_purportedLength + prepend.length);
- delete this.csrf_purportedLength;
- }
+
+ // Removed to eliminate 'Refused to set unsafe header "Content-length" ' errors in modern browsers
+ // if (this.csrf_purportedLength === undefined) {
+ // this.csrf_setRequestHeader("Content-length", this.csrf_purportedLength + prepend.length);
+ // delete this.csrf_purportedLength;
+ // }
+
delete this.csrf_isPost;
return this.csrf_send(prepend + data);
},
diff --git a/src/usr/local/www/diag_arp.php b/src/usr/local/www/diag_arp.php
index d456be9..ec93c7f 100644
--- a/src/usr/local/www/diag_arp.php
+++ b/src/usr/local/www/diag_arp.php
@@ -333,6 +333,10 @@ $data = msort($data, "dnsresolve");
// Load MAC-Manufacturer table
$mac_man = load_mac_manufacturer_table();
?>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('ARP Table')?></h2></div>
+ <div class="panel-body">
+
<div class="table-responsive">
<table class="sortable-theme-bootstrap table table-striped table-hover" data-sortable>
<thead>
@@ -368,6 +372,9 @@ $mac_man = load_mac_manufacturer_table();
</table>
</div>
+ </div>
+</div>
+
<script type="text/javascript">
//<![CDATA[
// Clear the "loading" div once the page has loaded"
@@ -377,7 +384,12 @@ events.push(function() {
//]]>
</script>
+<div class="infoblock blockopen">
<?php
-print_info_box(gettext("Local IPv6 peers use ") . '<a href="diag_ndp.php">' . gettext("NDP") . '</a>' . gettext(" instead of ARP"), 'info');
+print_info_box(gettext("Local IPv6 peers use ") . '<a href="diag_ndp.php">' . gettext("NDP") . '</a>' . gettext(" instead of ARP"), 'info', false);
+?>
+</div>
-include("foot.inc")?>
+<?php
+include("foot.inc");
+?>
diff --git a/src/usr/local/www/diag_backup.php b/src/usr/local/www/diag_backup.php
index e961a81..242551c 100644
--- a/src/usr/local/www/diag_backup.php
+++ b/src/usr/local/www/diag_backup.php
@@ -57,7 +57,7 @@
*/
##|+PRIV
-##|*IDENT=page-diagnostics-backup/restore
+##|*IDENT=page-diagnostics-backup-restore
##|*NAME=Diagnostics: Backup/restore
##|*DESCR=Allow access to the 'Diagnostics: Backup/restore' page.
##|*MATCH=diag_backup.php*
@@ -69,9 +69,6 @@ ini_set('max_input_time', '0');
/* omit no-cache headers because it confuses IE with file downloads */
$omit_nocacheheaders = true;
-if (stristr($_POST['Submit'], gettext("Download"))) {
- $nocsrf = true;
-}
require("guiconfig.inc");
require_once("functions.inc");
require_once("filter.inc");
@@ -111,7 +108,7 @@ function restore_rrddata() {
$rrd_file = "{$g['vardb_path']}/rrd/{$rrd['filename']}";
$xml_file = preg_replace('/\.rrd$/', ".xml", $rrd_file);
if (file_put_contents($xml_file, gzinflate(base64_decode($rrd['xmldata']))) === false) {
- log_error("Cannot write $xml_file");
+ log_error(sprintf(gettext("Cannot write %s"), $xml_file));
continue;
}
$output = array();
@@ -126,7 +123,7 @@ function restore_rrddata() {
$rrd_file = "{$g['vardb_path']}/rrd/{$rrd['filename']}";
$rrd_fd = fopen($rrd_file, "w");
if (!$rrd_fd) {
- log_error("Cannot write $rrd_file");
+ log_error(sprintf(gettext("Cannot write %s"), $rrd_file));
continue;
}
$data = base64_decode($rrd['data']);
@@ -135,18 +132,18 @@ function restore_rrddata() {
if ($dcomp) {
/* If the decompression worked, write the decompressed data */
if (fwrite($rrd_fd, $dcomp) === false) {
- log_error("fwrite $rrd_file failed");
+ log_error(sprintf(gettext("fwrite %s failed"), $rrd_file));
continue;
}
} else {
/* If the decompression failed, it wasn't compressed, so write raw data */
if (fwrite($rrd_fd, $data) === false) {
- log_error("fwrite $rrd_file failed");
+ log_error(sprintf(gettext("fwrite %s failed"), $rrd_file));
continue;
}
}
if (fclose($rrd_fd) === false) {
- log_error("fclose $rrd_file failed");
+ log_error(sprintf(gettext("fclose %s failed"), $rrd_file));
continue;
}
}
@@ -228,12 +225,9 @@ if ($_POST) {
if ($mode) {
if ($mode == "download") {
if ($_POST['encrypt']) {
- if (!$_POST['encrypt_password'] || !$_POST['encrypt_passconf']) {
+ if (!$_POST['encrypt_password']) {
$input_errors[] = gettext("You must supply and confirm the password for encryption.");
}
- if ($_POST['encrypt_password'] != $_POST['encrypt_passconf']) {
- $input_errors[] = gettext("The supplied 'Password' and 'Confirm' field values must match.");
- }
}
if (!$input_errors) {
@@ -306,12 +300,9 @@ if ($_POST) {
if ($mode == "restore") {
if ($_POST['decrypt']) {
- if (!$_POST['decrypt_password'] || !$_POST['decrypt_passconf']) {
+ if (!$_POST['decrypt_password']) {
$input_errors[] = gettext("You must supply and confirm the password for decryption.");
}
- if ($_POST['decrypt_password'] != $_POST['decrypt_passconf']) {
- $input_errors[] = gettext("The supplied 'Password' and 'Confirm' field values must match.");
- }
}
if (!$input_errors) {
@@ -379,7 +370,7 @@ if ($_POST) {
$loaderconf = file_get_contents("/boot/loader.conf");
if (strpos($loaderconf, "console=\"comconsole")) {
$config['system']['enableserial'] = true;
- write_config("Restore serial console enabling in configuration.");
+ write_config(gettext("Restore serial console enabling in configuration."));
}
unset($loaderconf);
}
@@ -664,18 +655,9 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_Input(
'encrypt_password',
- null,
- 'password',
- null,
- ['placeholder' => 'Password']
-));
-
-$section->addInput(new Form_Input(
- 'encrypt_passconf',
- null,
+ 'Password',
'password',
- null,
- ['placeholder' => 'Confirm password']
+ null
));
$group = new Form_Group('');
@@ -691,7 +673,7 @@ $section = new Form_Section('Restore backup');
$section->addInput(new Form_StaticText(
null,
- gettext("Open a ") . $g['[product_name'] . gettext(" configuration XML file and click the button below to restore the configuration.")
+ sprintf(gettext("Open a %s configuration XML file and click the button below to restore the configuration."), $g['product_name'])
));
$section->addInput(new Form_Select(
@@ -717,20 +699,12 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_Input(
'decrypt_password',
- null,
+ 'Password',
'password',
null,
['placeholder' => 'Password']
));
-$section->addInput(new Form_Input(
- 'decrypt_passconf',
- null,
- 'password',
- null,
- ['placeholder' => 'Confirm password']
-));
-
$group = new Form_Group('');
$group->add(new Form_Button(
'Submit',
@@ -785,9 +759,9 @@ events.push(function() {
decryptHide = !($('input[name="decrypt"]').is(':checked'));
hideInput('encrypt_password', encryptHide);
- hideInput('encrypt_passconf', encryptHide);
+ hideInput('encrypt_password_confirm', encryptHide);
hideInput('decrypt_password', decryptHide);
- hideInput('decrypt_passconf', decryptHide);
+ hideInput('decrypt_password_confirm', decryptHide);
}
// ---------- Click handlers ------------------------------------------------------------------
diff --git a/src/usr/local/www/diag_confbak.php b/src/usr/local/www/diag_confbak.php
index 5b817bc..7d412df 100644
--- a/src/usr/local/www/diag_confbak.php
+++ b/src/usr/local/www/diag_confbak.php
@@ -69,9 +69,9 @@ if (isset($_POST['backupcount'])) {
$changedescr = $config['system']['backupcount'];
} else {
unset($config['system']['backupcount']);
- $changedescr = "(platform default)";
+ $changedescr = gettext("(platform default)");
}
- write_config("Changed backup revision count to {$changedescr}");
+ write_config(sprintf(gettext("Changed backup revision count to %s"), $changedescr));
} elseif ($_GET) {
if (!isset($_GET['newver']) && !isset($_GET['rmver']) && !isset($_GET['getcfg']) && !isset($_GET['diff'])) {
header("Location: diag_confbak.php");
@@ -139,10 +139,19 @@ if ($savemsg) {
print_info_box($savemsg, 'success');
}
+$tab_array = array();
+$tab_array[] = array(gettext("Config History"), true, "diag_confbak.php");
+$tab_array[] = array(gettext("Backup/Restore"), false, "diag_backup.php");
+display_top_tabs($tab_array);
+
if ($diff) {
?>
<div class="panel panel-default">
- <div class="panel-heading"><?=gettext("Configuration diff from ")?><?=date(gettext("n/j/y H:i:s"), $oldtime); ?><?=gettext(" to ")?><?=date(gettext("n/j/y H:i:s"), $newtime); ?></div>
+ <div class="panel-heading">
+ <h2 class="panel-title">
+ <?=sprintf(gettext('Configuration diff from %1$s to %2$s'), date(gettext("n/j/y H:i:s"), $oldtime), date(gettext("n/j/y H:i:s"), $newtime))?>
+ </h2>
+ </div>
<div class="panel-body table-responsive">
<!-- This table is left un-bootstrapped to maintain the original diff format output -->
<table style="padding-top: 4px; padding-bottom: 4px; vertical-align:middle;">
@@ -164,7 +173,7 @@ if ($diff) {
}
?>
<tr>
- <td valign="middle" bgcolor="<?=$color; ?>" style="white-space: pre-wrap;"><?=htmlentities($line)?></td>
+ <td class="diff-text" valign="middle" bgcolor="<?=$color; ?>" style="white-space: pre-wrap;"><?=htmlentities($line)?></td>
</tr>
<?php
}
@@ -175,17 +184,12 @@ if ($diff) {
<?php
}
-$tab_array = array();
-$tab_array[] = array(gettext("Config History"), true, "diag_confbak.php");
-$tab_array[] = array(gettext("Backup/Restore"), false, "diag_backup.php");
-display_top_tabs($tab_array);
-
$form = new Form(new Form_Button(
'Submit',
gettext("Save")
));
-$section = new Form_Section('Saved Configurations');
+$section = new Form_Section('Saved Configurations', 'savedconfig', COLLAPSIBLE|SEC_CLOSED);
$section->addInput(new Form_Input(
'backupcount',
@@ -206,14 +210,23 @@ $form->add($section);
print($form);
if (is_array($confvers)) {
- print_info_box(gettext('To view the differences between an older configuration and a newer configuration, ' .
- 'select the older configuration using the left column of radio options and select the newer configuration in the right column, ' .
- 'then press the "Diff" button.'));
+?>
+<div>
+ <div class="infoblock blockopen">
+ <?=print_info_box(
+ gettext(
+ 'To view the differences between an older configuration and a newer configuration, ' .
+ 'select the older configuration using the left column of radio options and select the newer configuration in the right column, ' .
+ 'then press the "Diff" button.'),
+ 'info', false)?>
+ </div>
+</div>
+<?php
}
?>
<form action="diag_confbak.php" method="get">
- <div class="table-resposive">
+ <div class="table-responsive">
<table class="table table-striped table-hover table-condensed">
<?php
if (is_array($confvers)):
diff --git a/src/usr/local/www/diag_defaults.php b/src/usr/local/www/diag_defaults.php
index e13c17a..62a31af 100755
--- a/src/usr/local/www/diag_defaults.php
+++ b/src/usr/local/www/diag_defaults.php
@@ -85,12 +85,12 @@ include("head.inc");
<?php else:?>
<div class="panel panel-default">
<div class="panel-heading">
- <h2 class="panel-title">Are you sure you want to reset the system to the factory defaults?</h2>
+ <h2 class="panel-title"><?=gettext("Are you sure you want to reset the system to the factory defaults?")?></h2>
</div>
<div class="panel-body">
<div class="content">
<form action="diag_defaults.php" method="post">
- <p><strong><?=gettext("If you click") . " &quot;" . gettext("Yes") . "&quot;, " . gettext("the firewall will:")?></strong></p>
+ <p><strong><?=sprintf(gettext('If you click %1$sYes%1$s the firewall will:'), "&quot;")?></strong></p>
<ul>
<li><?=gettext("Reset to factory defaults")?></li>
<li><?=gettext("LAN IP address will be reset to 192.168.1.1")?></li>
@@ -98,7 +98,7 @@ include("head.inc");
<li><?=gettext("Reboot after changes are installed")?></li>
<li><?=gettext("WAN interface will be set to obtain an address automatically from a DHCP server")?></li>
<li><?=gettext("webConfigurator admin username will be reset to 'admin'")?></li>
- <li><?=gettext("webConfigurator admin password will be reset to")?> '<?=$g['factory_shipped_password']?>'</li>
+ <li><?=sprintf(gettext("webConfigurator admin password will be reset to '%s'"), $g['factory_shipped_password'])?></li>
</ul>
<p><strong><?=gettext("Are you sure you want to proceed?")?></strong></p>
<p>
diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php
index d413def..c9d5ba6 100755
--- a/src/usr/local/www/diag_dns.php
+++ b/src/usr/local/www/diag_dns.php
@@ -111,7 +111,7 @@ if (isset($_POST['create_alias']) && (is_hostname($host) || is_ipaddr($host))) {
$newalias['name'] = $aliasname;
$newalias['type'] = "network";
$newalias['address'] = $addresses;
- $newalias['descr'] = "Created from Diagnostics-> DNS Lookup";
+ $newalias['descr'] = gettext("Created from Diagnostics-> DNS Lookup");
if ($override) {
$a_aliases[$id] = $newalias;
} else {
@@ -212,11 +212,11 @@ include("head.inc");
if ($input_errors) {
print_input_errors($input_errors);
} else if (!$resolved && $type) {
- print('<div class="alert alert-warning" role="alert">' . gettext("Host") .' "'. $host .'" '. gettext("could not be resolved") . '</div>');
+ print('<div class="alert alert-warning" role="alert">' . sprintf(gettext('Host "%s" could not be resolved'), $host) . '</div>');
}
if ($createdalias) {
- print('<div class="alert alert-success" role="alert">'.gettext("Alias was created/updated successfully").'</div>');
+ print('<div class="alert alert-success" role="alert">' . gettext("Alias was created/updated successfully") . '</div>');
}
$form = new Form('Lookup');
@@ -244,14 +244,14 @@ if (!$input_errors && $type) {
if ($resolved):
?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Results</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Results')?></h2></div>
<div class="panel-body">
<ul class="list-group">
-<?
+<?php
foreach ((array)$resolved as $hostitem) {
?>
<li class="list-group-item"><?=$hostitem?></li>
-<?
+<?php
if ($hostitem != "") {
$found++;
}
@@ -260,26 +260,26 @@ if (!$input_errors && $type) {
</ul>
</div>
</div>
-<? endif?>
+<?php endif; ?>
<!-- Second table displays the server resolution times -->
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Timings</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Timings')?></h2></div>
<div class="panel-body">
<table class="table">
<thead>
<tr>
- <th>Name server</th>
- <th>Query time</th>
+ <th><?=gettext('Name server')?></th>
+ <th><?=gettext('Query time')?></th>
</tr>
</thead>
<tbody>
-<? foreach ((array)$dns_speeds as $qt):?>
+<?php foreach ((array)$dns_speeds as $qt):?>
<tr>
<td><?=$qt['dns_server']?></td><td><?=$qt['query_time']?></td>
</tr>
-<? endforeach?>
+<?php endforeach; ?>
</tbody>
</table>
</div>
@@ -287,7 +287,7 @@ if (!$input_errors && $type) {
<!-- Third table displays "More information" -->
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">More information</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('More information')?></h2></div>
<div class="panel-body">
<ul class="list-group">
<li class="list-group-item"><a href="/diag_ping.php?host=<?=htmlspecialchars($host)?>&amp;count=3"><?=gettext("Ping")?></a></li>
@@ -295,8 +295,8 @@ if (!$input_errors && $type) {
</ul>
<h5><?=gettext("NOTE: The following links are to external services, so their reliability cannot be guaranteed.");?></h5>
<ul class="list-group">
- <li class="list-group-item"><a target="_blank" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP WHOIS @ DNS Stuff");?></a></li>
- <li class="list-group-item"><a target="_blank" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP Info @ DNS Stuff");?></a></li>
+ <li class="list-group-item"><a target="_blank" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?=$ipaddr;?>"><?=gettext("IP WHOIS @ DNS Stuff");?></a></li>
+ <li class="list-group-item"><a target="_blank" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?=$ipaddr;?>"><?=gettext("IP Info @ DNS Stuff");?></a></li>
</ul>
</div>
</div>
diff --git a/src/usr/local/www/diag_dump_states.php b/src/usr/local/www/diag_dump_states.php
index 13777d4..b0d978a 100755
--- a/src/usr/local/www/diag_dump_states.php
+++ b/src/usr/local/www/diag_dump_states.php
@@ -64,6 +64,21 @@
require_once("guiconfig.inc");
require_once("interfaces.inc");
+function get_ip($addr) {
+
+ $parts = explode(":", $addr);
+ if (count($parts) == 2)
+ return (trim($parts[0]));
+ else {
+ /* IPv6 */
+ $parts = explode("[", $addr);
+ if (count($parts) == 2)
+ return (trim($parts[0]));
+ }
+
+ return ("");
+}
+
/* handle AJAX operations */
if (isset($_POST['action']) && $_POST['action'] == "remove") {
if (isset($_POST['srcip']) && isset($_POST['dstip']) && is_ipaddr($_POST['srcip']) && is_ipaddr($_POST['dstip'])) {
@@ -133,7 +148,7 @@ $current_statecount=`pfctl -si | grep "current entries" | awk '{ print $3 }'`;
$form = new Form(false);
-$section = new Form_Section('State filter');
+$section = new Form_Section('State filter', 'secfilter', COLLAPSIBLE|SEC_CLOSED);
$section->addInput(new Form_Input(
'filter',
@@ -162,62 +177,94 @@ if (isset($_POST['filter']) && (is_ipaddr($_POST['filter']) || is_subnet($_POST[
$form->add($section);
print $form;
?>
-<table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
- <thead>
- <tr>
- <th><?=gettext("Int")?></th>
- <th><?=gettext("Proto")?></th>
- <th><?=gettext("Source -> Router -> Destination")?></th>
- <th><?=gettext("State")?></th>
- <th></th> <!-- For the optional "Remove" button -->
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("States")?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
+ <thead>
+ <tr>
+ <th><?=gettext("Interface")?></th>
+ <th><?=gettext("Protocol")?></th>
+ <th><?=gettext("Source -> Router -> Destination")?></th>
+ <th><?=gettext("State")?></th>
+ <th><?=gettext("Packets")?></th>
+ <th><?=gettext("Bytes")?></th>
+ <th></th> <!-- For the optional "Remove" button -->
+ </tr>
+ </thead>
+ <tbody>
<?php
- $row = 0;
- /* get our states */
- $grepline = (isset($_POST['filter'])) ? "| /usr/bin/egrep " . escapeshellarg(htmlspecialchars($_POST['filter'])) : "";
- $fd = popen("/sbin/pfctl -s state {$grepline}", "r");
- while ($line = chop(fgets($fd))) {
- if ($row >= 10000) {
- break;
- }
+ if (isset($_REQUEST['ruleid'])) {
+ $ids = explode(",", $_REQUEST['ruleid']);
+ $arr = array();
+ for ($i = 0; $i < count($ids); $i++)
+ $arr[] = array("ruleid" => intval($ids[$i]));
+ }
+
+ if (isset($arr) && is_array($arr) && count($arr) > 0)
+ $res = pfSense_get_pf_states($arr);
+ else
+ $res = pfSense_get_pf_states();
- $line_split = preg_split("/\s+/", $line);
+ $states = 0;
+ if ($res != NULL && is_array($res))
+ $states = count($res);
- $iface = array_shift($line_split);
- $proto = array_shift($line_split);
- $state = array_pop($line_split);
- $info = implode(" ", $line_split);
+ /* XXX - limit to 10.000 states. */
+ if ($states > 10000)
+ $states = 10000;
- // We may want to make this optional, with a large state table, this could get to be expensive.
- $iface = convert_real_interface_to_friendly_descr($iface);
+ for ($i = 0; $i < $states; $i++) {
+ if ($res[$i]['direction'] === "out") {
+ $info = $res[$i]['src'];
+ if ($res[$i]['src-orig'])
+ $info .= " (" . $res[$i]['src-orig'] . ")";
+ $info .= " -> ";
+ $info .= $res[$i]['dst'];
+ if ($res[$i]['dst-orig'])
+ $info .= " (" . $res[$i]['dst-orig'] . ")";
+ $srcip = get_ip($res[$i]['src']);
+ $dstip = get_ip($res[$i]['dst']);
+ } else {
+ $info = $res[$i]['dst'];
+ if ($res[$i]['dst-orig'])
+ $info .= " (" . $res[$i]['dst-orig'] . ")";
+ $info .= " -> ";
+ $info .= $res[$i]['src'];
+ if ($res[$i]['src-orig'])
+ $info .= " (" . $res[$i]['src-orig'] . ")";
+ $srcip = get_ip($res[$i]['dst']);
+ $dstip = get_ip($res[$i]['src']);
+ }
- /* break up info and extract $srcip and $dstip */
- $ends = preg_split("/\<?-\>?/", $info);
- $parts = explode(":", $ends[0]);
- $srcip = trim($parts[0]);
- $parts = explode(":", $ends[count($ends) - 1]);
- $dstip = trim($parts[0]);
?>
- <tr>
- <td><?= $iface ?></td>
- <td><?= $proto ?></td>
- <td><?= $info ?></td>
- <td><?= $state ?></td>
-
- <td>
- <a class="btn fa fa-times" data-entry="<?=$srcip?>|<?=$dstip?>"
- title="<?=sprintf(gettext('Remove all state entries from %s to %s'), $srcip, $dstip);?>"></a>
- </td>
- </tr>
-<?php $row++; }
+ <tr>
+ <td><?= convert_real_interface_to_friendly_descr($res[$i]['if']) ?></td>
+ <td><?= $res[$i]['proto'] ?></td>
+ <td><?= $info ?></td>
+ <td><?= $res[$i]['state'] ?></td>
+ <td><?= format_number($res[$i]['packets in']) ?> /
+ <?= format_number($res[$i]['packets out']) ?></td>
+ <td><?= format_bytes($res[$i]['bytes in']) ?> /
+ <?= format_bytes($res[$i]['bytes out']) ?></td>
+
+ <td>
+ <a class="btn fa fa-trash" data-entry="<?=$srcip?>|<?=$dstip?>"
+ title="<?=sprintf(gettext('Remove all state entries from %1$s to %2$s'), $srcip, $dstip);?>"></a>
+ </td>
+ </tr>
+<?
+ }
?>
- </tbody>
-</table>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
<?php
-if ($row == 0) {
+if ($states == 0) {
if (isset($_POST['filter']) && !empty($_POST['filter'])) {
$errmsg = gettext('No states were found that match the current filter');
} else {
diff --git a/src/usr/local/www/diag_dump_states_sources.php b/src/usr/local/www/diag_dump_states_sources.php
index 5621f9a..6f8f5d7 100644
--- a/src/usr/local/www/diag_dump_states_sources.php
+++ b/src/usr/local/www/diag_dump_states_sources.php
@@ -137,7 +137,7 @@ print $form;
?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Current source tracking entries</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Current source tracking entries")?></h2></div>
<div class="panel-body">
<table class="table table-striped">
<thead>
@@ -176,7 +176,7 @@ if (count($sources) > 0) {
<td>
<a class="btn btn-xs btn-danger" data-entry="<?=$srcip?>|<?=$dstip?>"
- title="<?=sprintf(gettext('Remove all source tracking entries from %s to %s'), $srcip, $dstip);?>">Remove</a>
+ title="<?=sprintf(gettext('Remove all source tracking entries from %1$s to %2$s'), $srcip, $dstip);?>"><?=gettext("Remove")?></a>
</td>
</tr>
<?php
diff --git a/src/usr/local/www/diag_gmirror.php b/src/usr/local/www/diag_gmirror.php
index 3dffd29..41ddff0 100644
--- a/src/usr/local/www/diag_gmirror.php
+++ b/src/usr/local/www/diag_gmirror.php
@@ -207,7 +207,7 @@ if ($_GET["error"] && ($_GET["error"] != 0)) {
<?php
if ($_GET["action"]): ?>
<div class="panel panel-default">
- <div class="panel-heading">Confirm Action</div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Confirm Action')?></h2></div>
<div class="panel-body">
<strong><?=gettext('Please confirm the selected action: '); ?></strong>
<span style="color:green"><?=$action_list[$_GET["action"]]; ?></span>
@@ -239,7 +239,7 @@ else:
<!-- GEOM mirror table -->
<div class="panel panel-default">
- <div class="panel-heading">GEOM Mirror information - Mirror Status</div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('GEOM Mirror information - Mirror Status')?></h2></div>
<div class="panel-body table-responsive">
<?php
@@ -321,7 +321,7 @@ else:
<!-- Consumer information table -->
<div class="panel panel-default">
- <div class="panel-heading">Consumer information - Available consumers</div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Consumer information - Available consumers')?></h2></div>
<div class="panel-body table-responsive">
<?php
if (count($unused_consumers) > 0): ?>
diff --git a/src/usr/local/www/diag_halt.php b/src/usr/local/www/diag_halt.php
index ba8a601..7e45554 100755
--- a/src/usr/local/www/diag_halt.php
+++ b/src/usr/local/www/diag_halt.php
@@ -87,7 +87,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
<?php
if (DEBUG) {
- print("Not actually halting (DEBUG is set true)<br>");
+ print(sprintf(gettext("Not actually halting (DEBUG is set true)%s"), "<br />"));
} else {
print('<pre>');
system_halt();
@@ -98,14 +98,14 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
<div class="panel panel-default">
<div class="panel-heading">
- <h2 class="panel-title">Are you sure you want to halt the system?</h2>
+ <h2 class="panel-title"><?=gettext('Are you sure you want to halt the system?')?></h2>
</div>
<div class="panel-body">
<div class="content">
- <p>Click "Halt" to halt the system immediately, or "No" to go to the system dashboard. (There will be a brief delay before the dashboard appears.)</p>
+ <p><?=gettext('Click "Halt" to halt the system immediately, or "No" to go to the system dashboard. (There will be a brief delay before the dashboard appears.)')?></p>
<form action="diag_halt.php" method="post">
- <input type="submit" class="btn btn-danger pull-center" name="save" value="Halt">
- <a href="/" class="btn btn-default">No</a>
+ <input type="submit" class="btn btn-danger pull-center" name="save" value="<?=gettext("Halt")?>">
+ <a href="/" class="btn btn-default"><?=gettext("No")?></a>
</form>
</div>
</div>
diff --git a/src/usr/local/www/diag_limiter_info.php b/src/usr/local/www/diag_limiter_info.php
index 4eebab3..93258fe 100644
--- a/src/usr/local/www/diag_limiter_info.php
+++ b/src/usr/local/www/diag_limiter_info.php
@@ -68,13 +68,13 @@ $shortcut_section = "trafficshaper-limiters";
if ($_REQUEST['getactivity']) {
$text = `/sbin/ipfw pipe show`;
if ($text == "") {
- $text = "We could not find any limiters on this system.";
+ $text = gettext("We could not find any limiters on this system.");
}
- echo "Limiters:\n";
+ echo gettext("Limiters:") . "\n";
echo $text;
$text = `/sbin/ipfw queue show`;
if ($text != "") {
- echo "\n\nQueues:\n";
+ echo "\n\n" . gettext("Queues") . ":\n";
echo $text;
}
exit;
@@ -111,7 +111,7 @@ if ($input_errors) {
</script>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Limiter Information</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Limiter Information")?></h2></div>
<div class="panel-body">
<pre id="xhrOutput"><?=gettext("Gathering Limiter information, please wait...")?></pre>
</div>
diff --git a/src/usr/local/www/diag_nanobsd.php b/src/usr/local/www/diag_nanobsd.php
index f2847d0..26ab828 100644
--- a/src/usr/local/www/diag_nanobsd.php
+++ b/src/usr/local/www/diag_nanobsd.php
@@ -81,7 +81,7 @@ global $BOOT_DEVICE, $REAL_BOOT_DEVICE, $BOOT_DRIVE, $ACTIVE_SLICE;
nanobsd_detect_slice_info();
$NANOBSD_SIZE = nanobsd_get_size();
-$class='alert-warning';
+$class = 'alert-warning';
if ($_POST['bootslice']) {
if (!DEBUG) {
@@ -90,8 +90,8 @@ if ($_POST['bootslice']) {
sleep(4);
}
- $savemsg = gettext("The boot slice has been set to") . " " . nanobsd_get_active_slice();
- $class='alert-success';
+ $savemsg = sprintf(gettext("The boot slice has been set to %s"), nanobsd_get_active_slice());
+ $class = 'alert-success';
// Survey slice info
nanobsd_detect_slice_info();
}
@@ -101,10 +101,10 @@ if ($_POST['destslice'] && $_POST['duplicateslice']) {
if (!DEBUG && nanobsd_clone_slice($_POST['destslice'])) {
$savemsg = gettext("The slice has been duplicated.") . "<p/>" . gettext("If you would like to boot from this newly duplicated slice please set it using the bootup information area.");
- $class='alert-success';
+ $class = 'alert-success';
} else {
$savemsg = gettext("There was an error while duplicating the slice. Operation aborted.");
- $class='alert-danger';
+ $class = 'alert-danger';
}
// Re-Survey slice info
nanobsd_detect_slice_info();
@@ -122,20 +122,24 @@ if ($_POST['setrw']) {
if (!DEBUG) {
conf_mount_rw();
if (isset($_POST['nanobsd_force_rw'])) {
+ $savemsg = gettext("Permanent read/write has been set successfully.");
+ $class = 'alert-success';
$config['system']['nanobsd_force_rw'] = true;
} else {
+ $savemsg = gettext('Permanent read/write has been cleared successfully.');
+ $class = 'alert-success';
unset($config['system']['nanobsd_force_rw']);
}
- write_config("Changed Permanent Read/Write Setting");
+ write_config(gettext("Changed Permanent Read/Write Setting"));
conf_mount_ro();
} else {
- $savemsg = 'Saved r/w permanently';
+ $savemsg = gettext('Saved r/w permanently');
$class = 'alert-success';
}
}
-print_info_box("The options on this page are intended for use by advanced users only.");
+print_info_box(gettext("The options on this page are intended for use by advanced users only."));
if ($savemsg) {
print_info_box($savemsg, $class);
@@ -158,41 +162,43 @@ $section->addInput(new Form_StaticText(
$ACTIVE_SLICE . ' ' . $slicebtn
));
+$refcount = refcount_read(1000);
+
if (is_writable("/")) {
- $refcount = refcount_read(1000);
/* refcount_read returns -1 when shared memory section does not exist */
/* refcount can be zero here when the user has set nanobsd_force_rw */
/* refcount 1 is normal, so only display the count for abnormal values */
if ($refcount == 1 || $refcount == 0 || $refcount == -1) {
$refdisplay = "";
} else {
- $refdisplay = " (Reference count " . $refcount . ")";
+ $refdisplay = " ". sprintf(gettext("(Reference count %s)"), $refcount);
}
$lbl = gettext("Read/Write") . $refdisplay;
- if (!isset($config['system']['nanobsd_force_rw'])) {
- $btnlbl = gettext("Switch to Read-Only");
- }
+ $btnlbl = gettext("Switch to Read-Only");
} else {
$lbl = gettext("Read-Only");
- if (!isset($config['system']['nanobsd_force_rw'])) {
- $btnlbl = gettext("Switch to Read/Write");
- }
+ $btnlbl = gettext("Switch to Read/Write");
}
-$robtn = new Form_Button('changero', $btnlbl);
-$robtn->removeClass('btn-primary')->addClass('btn-default btn-sm');
+// Only show the changero button if force read/write is off, or the file system is not in writable state, or there is an unusual refcount.
+// If force read/write is on, and the file system is in writable state, and refcount is normal then the user has no reason to mess about.
+if (!isset($config['system']['nanobsd_force_rw']) || !is_writable("/") || ($refcount > 1)) {
+ $robtn = new Form_Button('changero', $btnlbl);
+ $robtn->removeClass('btn-primary')->addClass('btn-default btn-sm');
+ $lbl .= ' ' . $robtn;
+}
$section->addInput(new Form_StaticText(
'Read/Write status',
- $lbl . ' ' . $robtn
-));
+ $lbl
+))->setHelp('This setting is only temporary, and can be switched dynamically in the background.');
$section->addInput(new Form_Checkbox(
'nanobsd_force_rw',
'Permanent Read/Write',
'Keep media mounted read/write at all times. ',
isset($config['system']['nanobsd_force_rw'])
-))->setHelp('This setting is only temporary, and can be switched dynamically in the background.');
+));
$permbtn = new Form_Button('setrw', 'Save');
$permbtn->removeClass('btn-primary')->addClass('btn-default btn-sm');
diff --git a/src/usr/local/www/diag_ndp.php b/src/usr/local/www/diag_ndp.php
index b542552..fb5a487 100644
--- a/src/usr/local/www/diag_ndp.php
+++ b/src/usr/local/www/diag_ndp.php
@@ -129,6 +129,10 @@ $pgtitle = array(gettext("Diagnostics"), gettext("NDP Table"));
include("head.inc");
?>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('NDP Table')?></h2></div>
+ <div class="panel-body">
+
<div class="table-responsive">
<table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
<thead>
@@ -150,9 +154,9 @@ include("head.inc");
?>
<?=$mac?>
- <? if (isset($mac_man[$mac_hi])):?>
+ <?php if (isset($mac_man[$mac_hi])):?>
(<?=$mac_man[$mac_hi]?>)
- <?endif?>
+ <?php endif; ?>
</td>
<td>
@@ -173,4 +177,7 @@ include("head.inc");
</table>
</div>
+ </div>
+</div>
+
<?php include("foot.inc");
diff --git a/src/usr/local/www/diag_packet_capture.php b/src/usr/local/www/diag_packet_capture.php
index 5258f9b..f488f75 100644
--- a/src/usr/local/www/diag_packet_capture.php
+++ b/src/usr/local/www/diag_packet_capture.php
@@ -263,20 +263,22 @@ if ($_POST) {
$do_tcpdump = false;
}
+$excl = gettext("Exclude");
+
$protocollist = array(
'' => 'Any',
'icmp' => 'ICMP',
- '!icmp' => 'Exclude ICMP',
+ '!icmp' => $excl . ' ICMP',
'icmp6' => 'ICMPv6',
- '!icmp6' => 'Exclude ICMPv6',
+ '!icmp6' => $excl . ' ICMPv6',
'tcp' => 'TCP',
- '!tcp' => 'Exclude TCP',
+ '!tcp' => $excl . ' TCP',
'udp' => 'UDP',
- '!udp' => 'Exclude UDP',
+ '!udp' => $excl . ' UDP',
'arp' => 'ARP',
- '!arp' => 'Exclude ARP',
- 'carp' => 'CARP (VRRP)',
- '!carp' => 'Exclude CARP (VRRP)',
+ '!arp' => $excl . ' ARP',
+ 'carp' => 'CARP',
+ '!carp' => $excl . ' CARP',
'esp' => 'ESP'
);
@@ -311,8 +313,8 @@ $section->addInput(new Form_Select(
'Address Family',
$fam,
array('' => 'Any',
- 'ip' => 'IPv4 Only',
- 'ip6' => 'IPv6 Only'
+ 'ip' => gettext('IPv4 Only'),
+ 'ip6' => gettext('IPv6 Only')
)
))->setHelp('Select the type of traffic to be captured');
@@ -361,10 +363,10 @@ $section->addInput(new Form_Select(
'detail',
'Level of detail',
$detail,
- array('normal' => 'Normal',
- 'medium' => 'Medium',
- 'high' => 'High',
- 'full' => 'Full',
+ array('normal' => gettext('Normal'),
+ 'medium' => gettext('Medium'),
+ 'high' => gettext('High'),
+ 'full' => gettext('Full'),
)
))->setHelp('This is the level of detail that will be displayed after hitting "Stop" when the packets have been captured.' . '<br />' .
'This option does not affect the level of detail when downloading the packet capture. ');
@@ -472,6 +474,11 @@ if ($do_tcpdump) :
<div class="panel-body">
<div class="form-group">
<?php
+ if ($proto == "carp") {
+ $iscarp = "-T carp";
+ } else {
+ $iscarp = "";
+ }
$detail_args = "";
switch ($detail) {
case "full":
@@ -490,7 +497,7 @@ if ($do_tcpdump) :
}
print('<textarea class="form-control" rows="20" style="font-size: 13px; font-family: consolas,monaco,roboto mono,liberation mono,courier;">');
- system("/usr/sbin/tcpdump {$disabledns} {$detail_args} -r {$fp}{$fn}");
+ system("/usr/sbin/tcpdump {$disabledns} {$detail_args} {$iscarp} -r {$fp}{$fn}");
print('</textarea>');
conf_mount_ro();
diff --git a/src/usr/local/www/diag_pftop.php b/src/usr/local/www/diag_pftop.php
index 2225a16..b7604d6 100644
--- a/src/usr/local/www/diag_pftop.php
+++ b/src/usr/local/www/diag_pftop.php
@@ -125,15 +125,21 @@ $form->addGlobal(new Form_Input(
$section = new Form_Section('pfTop Configuration');
$validViews = array(
- 'default', 'label', 'long',
- 'queue', 'rules', 'size',
- 'speed', 'state', 'time',
+ 'default' => gettext('default'),
+ 'label' => gettext('label'),
+ 'long' => gettext('long'),
+ 'queue' => gettext('queue'),
+ 'rules' => gettext('rules'),
+ 'size' => gettext('size'),
+ 'speed' => gettext('speed'),
+ 'state' => gettext('state'),
+ 'time' => gettext('time'),
);
$section->addInput(new Form_Select(
'viewtype',
'View',
$viewtype,
- array_combine($validViews, $validViews)
+ $validViews
));
$section->addInput(new Form_Select(
@@ -141,18 +147,18 @@ $section->addInput(new Form_Select(
'Sort by',
$sorttype,
array(
- 'none' => 'None',
- 'age' => 'Age',
- 'bytes' => 'Bytes',
- 'dest' => 'Destination Address',
- 'dport' => 'Destination Port',
- 'exp' => 'Expiry',
- 'peak' => 'Peak',
- 'pkt' => 'Packet',
- 'rate' => 'Rate',
- 'size' => 'Size',
- 'sport' => 'Source Port',
- 'src' => 'Source Address',
+ 'none' => gettext('None'),
+ 'age' => gettext('Age'),
+ 'bytes' => gettext('Bytes'),
+ 'dest' => gettext('Destination Address'),
+ 'dport' => gettext('Destination Port'),
+ 'exp' => gettext('Expiry'),
+ 'peak' => gettext('Peak'),
+ 'pkt' => gettext('Packet'),
+ 'rate' => gettext('Rate'),
+ 'size' => gettext('Size'),
+ 'sport' => gettext('Source Port'),
+ 'src' => gettext('Source Address'),
)
));
@@ -190,8 +196,7 @@ print $form;
});
//]]>
</script>
-<?php
-?>
+
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?=gettext('Output')?></h2></div>
<div class="panel panel-body">
diff --git a/src/usr/local/www/diag_ping.php b/src/usr/local/www/diag_ping.php
index d95fc54..c35ee7e 100644
--- a/src/usr/local/www/diag_ping.php
+++ b/src/usr/local/www/diag_ping.php
@@ -77,7 +77,7 @@ $count = DEFAULT_COUNT;
function create_sourceaddresslist() {
$sourceips = get_possible_traffic_source_addresses(true);
- $list = array("" => 'Default');
+ $list = array("" => gettext('Default'));
foreach ($sourceips as $sipvalue => $sipname) {
$list[$sipvalue] = $sipname;
@@ -156,7 +156,7 @@ if ($do_ping) {
$result = shell_exec($cmd);
if (empty($result)) {
- $input_errors[] = "Host \"" . $host . "\" did not respond or could not be resolved.";
+ $input_errors[] = sprintf(gettext('Host "%s" did not respond or could not be resolved.'), $host);
}
}
@@ -207,7 +207,7 @@ if ($do_ping && !empty($result) && !$input_errors) {
?>
<div class="panel panel-default">
<div class="panel-heading">
- <h2 class="panel-title">Results</h2>
+ <h2 class="panel-title"><?=gettext('Results')?></h2>
</div>
<div class="panel-body">
diff --git a/src/usr/local/www/diag_reboot.php b/src/usr/local/www/diag_reboot.php
index b53fc9b..d00ee82 100755
--- a/src/usr/local/www/diag_reboot.php
+++ b/src/usr/local/www/diag_reboot.php
@@ -79,7 +79,7 @@ include("head.inc");
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (DEBUG) {
- print_info_box("Not actually rebooting (DEBUG is set true)", success);
+ print_info_box(gettext("Not actually rebooting (DEBUG is set true)"), 'success');
} else {
print('<div><pre>');
system_reboot();
@@ -94,7 +94,6 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
//<![CDATA[
events.push(function() {
- var timeoutmsg = '<h4>Rebooting<br />Page will automatically reload in ';
var time = 0;
function checkonline() {
@@ -109,12 +108,17 @@ events.push(function() {
function startCountdown() {
setInterval(function() {
+ if (time == "<?=$guitimeout?>") {
+ $('#countdown').html('<h4><?=sprintf(gettext("Rebooting%sPage will automatically reload in %s seconds"), "<br />", "<span id=\"secs\"></span>");?></h4>');
+ }
+
if (time > 0) {
- $('#countdown').html(timeoutmsg + time + ' seconds.</h4>');
+ $('#secs').html(time);
time--;
} else {
time = "<?=$guiretry?>";
- timeoutmsg = '<h4>Not yet ready<br />Retrying in another ';
+ $('#countdown').html('<h4><?=sprintf(gettext("Not yet ready%s Retrying in another %s seconds"), "<br />", "<span id=\"secs\"></span>");?></h4>');
+ $('#secs').html(time);
checkonline();
}
}, 1000);
@@ -132,13 +136,15 @@ events.push(function() {
?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Are you sure you want to reboot the system?</h2></div>
+ <div class="panel-heading">
+ <h2 class="panel-title"><?=gettext('Are you sure you want to reboot the system?')?></h2>
+ </div>
<div class="panel-body">
<div class="content">
- <p>Click "Reboot" to reboot the system immediately, or "No" to go to the system dashboard without rebooting. (There will be a brief delay before the dashboard appears.)</p>
+ <p><?=gettext('Click "Reboot" to reboot the system immediately, or "No" to go to the system dashboard without rebooting. (There will be a brief delay before the dashboard appears.)')?></p>
<form action="diag_reboot.php" method="post">
- <input type="submit" class="btn btn-danger pull-center" name="Submit" value="Reboot">
- <a href="/" class="btn btn-default">No</a>
+ <input type="submit" class="btn btn-danger pull-center" name="Submit" value="<?=gettext("Reboot")?>">
+ <a href="/" class="btn btn-default"><?=gettext("No")?></a>
</form>
</div>
</div>
@@ -149,5 +155,3 @@ events.push(function() {
}
include("foot.inc");
-
-
diff --git a/src/usr/local/www/diag_resetstate.php b/src/usr/local/www/diag_resetstate.php
index e492550..45589eb 100644
--- a/src/usr/local/www/diag_resetstate.php
+++ b/src/usr/local/www/diag_resetstate.php
@@ -97,20 +97,17 @@ if ($savemsg) {
print_info_box($savemsg, 'alert-success');
}
-$statetablehelp = 'Resetting the state tables will remove all entries from the corresponding tables. This means that all open connections ' .
+$statetablehelp = sprintf(gettext('Resetting the state tables will remove all entries from the corresponding tables. This means that all open connections ' .
'will be broken and will have to be re-established. This may be necessary after making substantial changes to the ' .
- 'firewall and/or NAT rules, especially if there are IP protocol mappings (e.g. for PPTP or IPv6) with open connections.' .
- '<br /><br />' .
- 'The firewall will normally leave the state tables intact when changing rules.' .
- '<br /><br />' .
- '<strong>NOTE:</strong> If you reset the firewall state table, the browser session may appear to be hung after clicking &quot;Reset&quot;. ' .
- 'Simply refresh the page to continue.';
-
-$sourcetablehelp = 'Resetting the source tracking table will remove all source/destination associations. ' .
+ 'firewall and/or NAT rules, especially if there are IP protocol mappings (e.g. for PPTP or IPv6) with open connections.%s' .
+ 'The firewall will normally leave the state tables intact when changing rules.%s' .
+ '%sNOTE:%s If you reset the firewall state table, the browser session may appear to be hung after clicking &quot;Reset&quot;. ' .
+ 'Simply refresh the page to continue.'), "<br /><br />", "<br /><br />", "<strong>", "</strong>");
+
+$sourcetablehelp = sprintf(gettext('Resetting the source tracking table will remove all source/destination associations. ' .
'This means that the \"sticky\" source/destination association ' .
- 'will be cleared for all clients.' .
- ' <br /><br />' .
- 'This does not clear active connection states, only source tracking.';
+ 'will be cleared for all clients.%s' .
+ 'This does not clear active connection states, only source tracking.'), "<br /><br />");
$tab_array = array();
$tab_array[] = array(gettext("States"), false, "diag_dump_states.php");
diff --git a/src/usr/local/www/diag_routes.php b/src/usr/local/www/diag_routes.php
index 36048e1..cc68313 100644
--- a/src/usr/local/www/diag_routes.php
+++ b/src/usr/local/www/diag_routes.php
@@ -212,7 +212,7 @@ events.push(function() {
</script>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">IPv4 Routes</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("IPv4 Routes")?></h2></div>
<div class="panel panel-body">
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" id="IPv4">
<thead>
@@ -230,7 +230,7 @@ events.push(function() {
</div>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">IPv6 Routes</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("IPv6 Routes")?></h2></div>
<div class="panel panel-body">
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" id="IPv6">
<thead>
diff --git a/src/usr/local/www/diag_smart.php b/src/usr/local/www/diag_smart.php
index ad878dc..10c12ec 100644
--- a/src/usr/local/www/diag_smart.php
+++ b/src/usr/local/www/diag_smart.php
@@ -111,7 +111,7 @@ $action = (isset($_POST['action']) ? $_POST['action'] : $_GET['action']);
$targetdev = basename($_POST['device']);
if (!file_exists('/dev/' . $targetdev)) {
- echo "Device does not exist, bailing.";
+ echo gettext("Device does not exist, bailing.");
return;
}
@@ -126,7 +126,7 @@ switch ($action) {
{
$test = $_POST['testType'];
if (!in_array($test, $valid_test_types)) {
- echo "Invalid test type, bailing.";
+ echo gettext("Invalid test type, bailing.");
return;
}
@@ -462,7 +462,7 @@ switch ($action) {
))->displayAsRadio();
$group->add(new Form_Checkbox(
- 'test',
+ 'type',
null,
'Self-test',
false,
diff --git a/src/usr/local/www/diag_sockets.php b/src/usr/local/www/diag_sockets.php
index 578934f..55c1b17 100644
--- a/src/usr/local/www/diag_sockets.php
+++ b/src/usr/local/www/diag_sockets.php
@@ -67,7 +67,7 @@ $pgtitle = array(gettext("Diagnostics"), gettext("Sockets"));
include('head.inc');
$showAll = isset($_GET['showAll']);
-$showAllText = $showAll ? "Show only listening sockets" : "Show all socket connections";
+$showAllText = $showAll ? gettext("Show only listening sockets") : gettext("Show all socket connections");
$showAllOption = $showAll ? "" : "?showAll";
?>
@@ -133,7 +133,7 @@ $showAllOption = $showAll ? "" : "?showAll";
?>
<div>
-<div id="infoblock">
+<div class="infoblock">
<?php
print_info_box(gettext('Socket information - explanation.') . '<br /><br />' .
gettext('This page shows the output for the commands: "sockstat -4lL" and "sockstat -6lL".' . '<br />' .
@@ -148,7 +148,7 @@ gettext('This page shows the output for the commands: "sockstat -4lL" and "socks
'<dt>ADDRESS</dt> <dd>(UNIX sockets only) For bound sockets, this is the file-name of the socket. For other sockets, it is the name, PID and file descriptor number of the peer, or "(none)" if the socket is neither bound nor connected.</dd>' .
'<dt>LOCAL ADDRESS</dt> <dd>(Internet sockets only) The address the local end of the socket is bound to (see getsockname(2)).</dd>' .
'<dt>FOREIGN ADDRESS</dt><dd>(Internet sockets only) The address the foreign end of the socket is bound to (see getpeername(2)).</dd>' .
- '</dl>'), info);
+ '</dl>'), 'info', false);
?>
</div>
</div>
diff --git a/src/usr/local/www/diag_states_summary.php b/src/usr/local/www/diag_states_summary.php
index 06745a0..a8a9cfd 100644
--- a/src/usr/local/www/diag_states_summary.php
+++ b/src/usr/local/www/diag_states_summary.php
@@ -179,10 +179,10 @@ function print_summary_table($label, $iparr, $sort = TRUE) {
<tr>
<th ><?=gettext("IP");?></th>
<th class="text-center"># <?=gettext("States");?></th>
- <th ><?=gettext("Proto");?></th>
+ <th ><?=gettext("Protocol");?></th>
<th class="text-center"># <?=gettext("States");?></th>
- <th class="text-center"><?=gettext("Src Ports");?></th>
- <th class="text-center"><?=gettext("Dst Ports");?></th>
+ <th class="text-center"><?=gettext("Source Ports");?></th>
+ <th class="text-center"><?=gettext("Dest. Ports");?></th>
</tr>
</thead>
<tbody>
@@ -196,17 +196,17 @@ function print_summary_table($label, $iparr, $sort = TRUE) {
}
?>
<tr>
- <td<?= $rowSpan ?>><?php echo $ip; ?></td>
- <td<?= $rowSpan ?> class="text-center"><?php echo $ipinfo['seen']; ?></td>
+ <td<?= $rowSpan ?>><?=$ip;?></td>
+ <td<?= $rowSpan ?> class="text-center"><?=$ipinfo['seen'];?></td>
<?php foreach ($ipinfo['protos'] as $proto => $protoinfo): ?>
<?php if ($protocolCount > 1 && $i > 0): ?>
</tr><tr>
<?php endif; ?>
- <td><?php echo $proto; ?></td>
- <td class="text-center" ><?php echo $protoinfo['seen']; ?></td>
- <td class="text-center" ><span title="<?php echo build_port_info($protoinfo['srcports'], $proto); ?>"><?php echo count($protoinfo['srcports']); ?></span></td>
- <td class="text-center" ><span title="<?php echo build_port_info($protoinfo['dstports'], $proto); ?>"><?php echo count($protoinfo['dstports']); ?></span></td>
+ <td><?=$proto;?></td>
+ <td class="text-center" ><?=$protoinfo['seen'];?></td>
+ <td class="text-center" ><span title="<?=build_port_info($protoinfo['srcports'], $proto);?>"><?=count($protoinfo['srcports']);?></span></td>
+ <td class="text-center" ><span title="<?=build_port_info($protoinfo['dstports'], $proto);?>"><?=count($protoinfo['dstports']);?></span></td>
<?php $i++; endforeach; ?>
</tr>
<?php endforeach; ?>
diff --git a/src/usr/local/www/diag_tables.php b/src/usr/local/www/diag_tables.php
index 36b41f7..b2f100d 100644
--- a/src/usr/local/www/diag_tables.php
+++ b/src/usr/local/www/diag_tables.php
@@ -82,7 +82,7 @@ if ($_REQUEST['delete']) {
exit;
}
-if ($_POST['deleteall']) {
+if ($_POST['clearall']) {
exec("/sbin/pfctl -t " . escapeshellarg($tablename) . " -T show", $entries);
if (is_array($entries)) {
foreach ($entries as $entryA) {
@@ -90,6 +90,7 @@ if ($_POST['deleteall']) {
exec("/sbin/pfctl -t " . escapeshellarg($tablename) . " -T delete " . escapeshellarg($entry), $delete);
}
}
+ unset($entries);
}
if (($tablename == "bogons") || ($tablename == "bogonsv6")) {
@@ -122,22 +123,61 @@ exec("/sbin/pfctl -sT", $tables);
include("head.inc");
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
-$form = new Form('Show');
+if ($tablename == "webConfiguratorlockout") {
+ $displayname = gettext("Web configurator lockout table");
+} else {
+ $displayname = sprintf(gettext("%s table"), ucfirst($tablename));
+}
+
+$form = new Form(false);
$section = new Form_Section('Table to display');
+$group = new Form_Group("Table");
-$section->addInput(new Form_Select(
+$group->add(new Form_Select(
'type',
- 'Table',
+ null,
$tablename,
array_combine($tables, $tables)
));
+if ($bogons || !empty($entries)) {
+ if ($bogons) {
+ $group->add(new Form_Button(
+ 'Download',
+ 'Update'
+ ))->removeClass('btn-primary')->addClass('btn-success btn-sm');
+ } elseif (!empty($entries)) {
+ $group->add(new Form_Button(
+ 'clearall',
+ 'Clear Table'
+ ))->removeClass('btn-primary')->addClass('btn-danger btn-sm');
+ }
+}
+
+$section->add($group);
$form->add($section);
print $form;
+
+if ($bogons || !empty($entries)) {
+?>
+<div>
+ <div class="infoblock blockopen">
+<?php
+ $last_updated = exec('/usr/bin/grep -i -m 1 -E "^# last updated" /etc/' . escapeshellarg($tablename) . '|cut -d"(" -f2|tr -d ")" ');
+ if ($last_updated != "") {
+ print_info_box(gettext("Table last updated on ") . $last_updated, 'info', false);
+ } else {
+ print_info_box(gettext("Date of last update of table is unknown"), 'info', false);
+ }
+?>
+ </div>
+</div>
+<?php
+}
?>
<script type="text/javascript">
@@ -159,69 +199,52 @@ events.push(function() {
},
});
});
+
+ // Auto-submit the form on table selector change
+ $('#type').on('change', function() {
+ $('form').submit();
+ });
});
//]]>
</script>
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("IP Address")?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=$displayname?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("IP Address")?></th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
foreach ($entries as $entry):
$entry = trim($entry);
?>
- <tr>
- <td>
- <?=$entry?>
- </td>
- <td>
- <?php if (!$bogons): ?>
- <a class="btn btn-xs btn-default" data-entry="<?=htmlspecialchars($entry)?>">Remove</a>
- <?php endif ?>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?=$entry?>
+ </td>
+ <td>
+ <?php if (!$bogons): ?>
+ <a class="btn btn-xs btn-default" data-entry="<?=htmlspecialchars($entry)?>"><?=gettext("Remove")?></a>
+ <?php endif ?>
+ </td>
+ </tr>
<?php endforeach ?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
+
<?php if (empty($entries)): ?>
- <div class="alert alert-warning" role="alert">No entries exist in this table</div>
+ <div class="alert alert-warning" role="alert"><?=gettext("No entries exist in this table")?></div>
<?php endif ?>
<?php
-if ($bogons || !empty($entries)) {
- $form = new Form;
-
- $section = new Form_Section('Table Data');
-
- if ($bogons) {
- $last_updated = exec('/usr/bin/grep -i -m 1 -E "^# last updated" /etc/' . escapeshellarg($tablename) . '|cut -d"(" -f2|tr -d ")" ');
-
- $section->addInput(new Form_StaticText(
- 'Last update',
- $last_updated
- ));
-
- $section->addInput(new Form_Button(
- 'Download',
- 'Download'
- ))->setHelp('Download the latest bogon data')->addClass('btn-warning');
- } elseif (!empty($entries)) {
- $section->addInput(new Form_Button(
- 'deleteall',
- 'Clear Table'
- ))->setHelp('Clear all of the entries in this table')->addClass('btn-danger');
- }
-
- $form->add($section);
- print $form;
-}
-
include("foot.inc");
diff --git a/src/usr/local/www/diag_testport.php b/src/usr/local/www/diag_testport.php
index 63e55c9..ccdb41e 100644
--- a/src/usr/local/www/diag_testport.php
+++ b/src/usr/local/www/diag_testport.php
@@ -221,30 +221,29 @@ include("head.inc");
// Handle the display of all messages here where the user can readily see them
if ($input_errors) {
print_input_errors($input_errors);
-} else {
- // New page
- if (empty($result) && $retval != 0 && !$showtext) {
- print('<div class="alert alert-warning" role="alert">This page allows you to perform a simple TCP connection test to determine if a host is up and accepting connections on a given port.' .
- ' This test does not function for UDP since there is no way to reliably determine if a UDP port accepts connections in this manner.</div>');
- }
-
- // Good host & port
- if ($retval == 0 && $do_testport == 1) {
- if (!$showtext) {
- print('<div class="alert alert-success" role="alert">'.gettext("Port test to host: " . $host . " Port: " . $port . " successful").'</div>');
- } else {
- print('<div class="alert alert-success" role="alert">'.gettext("Port test to host: " . $host . " Port: " . $port . " successful") . '. Any text received from the host will be shown below the form.</div>');
+} elseif ($do_testport) {
+ // User asked for a port test
+ if ($retval == 0) {
+ // Good host & port
+ $alert_text = '<div class="alert alert-success" role="alert">' . sprintf(gettext('Port test to host: %1$s Port: %2$s successful'), $host, $port);
+ if ($showtext) {
+ $alert_text .= ' ' . gettext('Any text received from the host will be shown below the form.');
}
- }
-
- // netcat exit value != 0
- if ($retval != 0 && !empty($result)) {
+ } else {
+ // netcat exit value != 0
+ $alert_text = '<div class="alert alert-danger" role="alert">';
if ($showtext) {
- print('<div class="alert alert-danger" role="alert">'.gettext('No output received, or connection failed. Try with "Show Remote Text" unchecked first.').'</div>');
+ $alert_text .= gettext('No output received, or connection failed. Try with "Show Remote Text" unchecked first.');
} else {
- print('<div class="alert alert-danger" role="alert">'.gettext('Connection failed.').'</div>');
+ $alert_text .= gettext('Connection failed.');
}
}
+ print ($alert_text . '</div>');
+} else {
+ // First time, new page
+ print('<div class="alert alert-warning" role="alert">' .
+ gettext('This page allows you to perform a simple TCP connection test to determine if a host is up and accepting connections on a given port.') . " " .
+ gettext('This test does not function for UDP since there is no way to reliably determine if a UDP port accepts connections in this manner.') . '</div>');
}
$form = new Form('Test');
@@ -300,15 +299,18 @@ $section->addInput(new Form_Select(
$form->add($section);
print $form;
-if ($ncoutput && !empty($result) && $showtext && $retval == 0): ?>
+// If the command succeeded, the user asked to see the output and there is output, then show it.
+if ($retval == 0 && $showtext && !empty($ncoutput)):
+?>
<div class="panel panel-default">
<div class="panel-heading">
- <h2 class="panel-title">Received Remote Text</h2>
+ <h2 class="panel-title"><?=gettext('Received Remote Text')?></h2>
</div>
<div class="panel-body">
<pre><?= $ncoutput ?></pre>
</div>
</div>
-<?php endif;
+<?php
+endif;
include("foot.inc");
diff --git a/src/usr/local/www/diag_traceroute.php b/src/usr/local/www/diag_traceroute.php
index ee76c0c..f0b22b0 100644
--- a/src/usr/local/www/diag_traceroute.php
+++ b/src/usr/local/www/diag_traceroute.php
@@ -73,15 +73,15 @@ include("head.inc");
define('MAX_TTL', 64);
define('DEFAULT_TTL', 18);
+// Set defaults in case they are not supplied.
$do_traceroute = false;
$host = '';
$ttl = DEFAULT_TTL;
-$pconfig['ttl'] = DEFAULT_TTL;
-$pconfig['ipproto'] = 'IPv4';
-$pconfig['sourceip'] = 'Any';
+$ipproto = 'ipv4';
+$sourceip = 'any';
function create_sourceaddresslist() {
- $list = array('any' => 'Any');
+ $list = array('any' => gettext('Any'));
$sourceips = get_possible_traffic_source_addresses(true);
@@ -94,7 +94,6 @@ function create_sourceaddresslist() {
if ($_POST || $_REQUEST['host']) {
unset($input_errors);
- unset($do_traceroute);
/* input validation */
$reqdfields = explode(" ", "host ttl");
@@ -113,16 +112,12 @@ if ($_POST || $_REQUEST['host']) {
$input_errors[] = gettext("When using IPv6, the target host must be an IPv6 address or hostname.");
}
- if (!$input_errors) {
- $host = $_REQUEST['host'];
- }
-
$sourceip = $_REQUEST['sourceip'];
$ttl = $_REQUEST['ttl'];
$resolve = $_REQUEST['resolve'];
$useicmp = $_REQUEST['useicmp'];
- if ($_POST) {
+ if ($_POST && !$input_errors) {
$do_traceroute = true;
}
@@ -135,6 +130,31 @@ if ($input_errors) {
print_input_errors($input_errors);
}
+/* Do the traceroute and show any error */
+if ($do_traceroute) {
+ $useicmpparam = isset($useicmp) ? "-I" : "";
+ $n = isset($resolve) ? "" : "-n";
+
+ $command = "/usr/sbin/traceroute";
+ if ($ipproto == "ipv6") {
+ $command .= "6";
+ $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ipv6($sourceip);
+ } else {
+ $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ip($sourceip);
+ }
+
+ if ($ifaddr && (is_ipaddr($host) || is_hostname($host))) {
+ $srcip = "-s " . escapeshellarg($ifaddr);
+ }
+
+ $cmd = "{$command} {$n} {$srcip} -w 2 {$useicmpparam} -m " . escapeshellarg($ttl) . " " . escapeshellarg($host);
+ $result = shell_exec($cmd);
+
+ if (!$result) {
+ print_info_box(sprintf(gettext('Error: %s could not be traced/resolved'), $host));
+ }
+}
+
$form = new Form('Traceroute');
$section = new Form_Section('Traceroute');
@@ -150,14 +170,14 @@ $section->addInput(new Form_Input(
$section->addInput(new Form_Select(
'ipproto',
'IP Protocol',
- $pconfig['ipproto'],
+ $ipproto,
array('ipv4' => 'IPv4', 'ipv6' => 'IPv6')
))->setHelp('Select the protocol to use');
$section->addInput(new Form_Select(
'sourceip',
'Source Address',
- $pconfig['sourceip'],
+ $sourceip,
create_sourceaddresslist()
))->setHelp('Select source address for the trace');
@@ -186,34 +206,13 @@ $form->add($section);
print $form;
/* Show the traceroute results */
-if (!$input_errors && $do_traceroute) {
-
- $useicmp = isset($_REQUEST['useicmp']) ? "-I" : "";
- $n = isset($resolve) ? "" : "-n";
-
- $command = "/usr/sbin/traceroute";
- if ($ipproto == "ipv6") {
- $command .= "6";
- $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ipv6($sourceip);
- } else {
- $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ip($sourceip);
- }
-
- if ($ifaddr && (is_ipaddr($host) || is_hostname($host))) {
- $srcip = "-s " . escapeshellarg($ifaddr);
- }
-
- $cmd = "{$command} {$n} {$srcip} -w 2 {$useicmp} -m " . escapeshellarg($ttl) . " " . escapeshellarg($host);
+if ($do_traceroute && $result) {
?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Results</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Results')?></h2></div>
<div class="panel-body">
<?php
- if ($result = shell_exec($cmd)) {
- print(nl2br($result));
- } else {
- print('Error: ' . $host . ' ' . gettext("could not be traced/resolved"));
- }
+ print('<pre>' . $result . '</pre>');
?>
</div>
</div>
diff --git a/src/usr/local/www/easyrule.php b/src/usr/local/www/easyrule.php
index 0c28335..ceca6f7 100644
--- a/src/usr/local/www/easyrule.php
+++ b/src/usr/local/www/easyrule.php
@@ -87,9 +87,7 @@ if (stristr($retval, "error") == true) {
$message = $retval;
}
-include("head.inc"); ?>
-
-include("fbegin.inc");
+include("head.inc");
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
@@ -99,17 +97,22 @@ if ($input_errors) {
print_input_errors($input_errors);
}
-if ($message) { ?>
-<br />
-<?=gettext("Message"); ?>: <?php echo $message; ?>
+if ($message) {
+?>
<br />
-<?php } else { ?>
-<?=gettext("This is the Easy Rule status page, mainly used to display errors when adding rules. " .
-"If you are seeing this, there apparently was not an error, and you navigated to the " .
-"page directly without telling it what to do"); ?>.<br /><br />
-<?=gettext("This page is meant to be called from the block/pass buttons on the Firewall Logs page"); ?>, <a href="status_logs_filter.php"><?=gettext("Status"); ?> &gt; <?=gettext("System Logs, " .
-"Firewall Tab"); ?></a>.
+<?=gettext("Message"); ?>: <?=$message;?>
<br />
-<?php } ?>
-</td></tr></table>
+<?php
+} else {
+ print_info_box(
+ gettext('This is the Easy Rule status page, mainly used to display errors when adding rules.') . ' ' .
+ gettext('If you are seeing this, there apparently was not an error, and you navigated to the page directly without telling it what to do.') .
+ '<br /><br />' .
+ gettext('This page is meant to be called from the block/pass buttons on the Firewall Logs page') .
+ ', <a href="status_logs_filter.php">' . gettext("Status") . ' &gt; ' . gettext('System Logs') . ', ' . gettext('Firewall Tab') . '</a>.<br />');
+}
+?>
+ </td>
+ </tr>
+</table>
<?php include("foot.inc"); ?>
diff --git a/src/usr/local/www/edit.php b/src/usr/local/www/edit.php
index ada73d1..1b6a43d 100644
--- a/src/usr/local/www/edit.php
+++ b/src/usr/local/www/edit.php
@@ -66,18 +66,21 @@ $pgtitle = array(gettext("Diagnostics"), gettext("Edit file"));
require("guiconfig.inc");
if ($_POST['action']) {
+ $button_html = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>';
+ $alert_danger_html = '<div class="alert alert-danger" role="alert">' . $button_html;
+ $alert_success_html = '<div class="alert alert-success" role="alert">' . $button_html;
switch ($_POST['action']) {
case 'load':
if (strlen($_POST['file']) < 1) {
- print('|5|' . '<div class="alert alert-danger" role="alert">'.gettext("No file name specified").'</div>' . '|');
+ print('|5|' . $alert_danger_html . gettext("No file name specified") . '</div>' . '|');
} elseif (is_dir($_POST['file'])) {
- print('|4|' . '<div class="alert alert-danger" role="alert">' . gettext("Loading a directory is not supported") .'</div>' . '|');
+ print('|4|' . $alert_danger_html . gettext("Loading a directory is not supported") . '</div>' . '|');
} elseif (!is_file($_POST['file'])) {
- print('|3|' . '<div class="alert alert-danger" role="alert">' . gettext("File does not exist or is not a regular file") . '</div>' . '|');
+ print('|3|' . $alert_danger_html . gettext("File does not exist or is not a regular file") . '</div>' . '|');
} else {
$data = file_get_contents(urldecode($_POST['file']));
if ($data === false) {
- print('|1|' . '<div class="alert alert-danger" role="alert">' . gettext("Failed to read file") . '</div>' . '|');
+ print('|1|' . $alert_danger_html . gettext("Failed to read file") . '</div>' . '|');
} else {
$data = base64_encode($data);
print("|0|{$_POST['file']}|{$data}|");
@@ -87,7 +90,7 @@ if ($_POST['action']) {
case 'save':
if (strlen($_POST['file']) < 1) {
- print('|' . '<div class="alert alert-danger" role="alert">'.gettext("No file name specified").'</div>' . '|');
+ print('|' . $alert_danger_html . gettext("No file name specified") . '</div>' . '|');
} else {
conf_mount_rw();
$_POST['data'] = str_replace("\r", "", base64_decode($_POST['data']));
@@ -100,11 +103,11 @@ if ($_POST['action']) {
disable_security_checks();
}
if ($ret === false) {
- print('|' . '<div class="alert alert-danger" role="alert">' . gettext("Failed to write file") . '</div>' . '|');
+ print('|' . $alert_danger_html . gettext("Failed to write file") . '</div>' . '|');
} elseif ($ret != strlen($_POST['data'])) {
- print('|' . '<div class="alert alert-danger" role="alert">' . gettext("Error while writing file") . '</div>' . '|');
+ print('|' . $alert_danger_html . gettext("Error while writing file") . '</div>' . '|');
} else {
- print('|' . '<div class="alert alert-success" role="alert">' . gettext("File saved successfully") . '</div>' . '|');
+ print('|' . $alert_success_html . gettext("File saved successfully") . '</div>' . '|');
}
}
exit;
@@ -116,7 +119,7 @@ require("head.inc");
?>
<!-- file status box -->
<div style="display:none; background:#eeeeee;" id="fileStatusBox">
- <strong id="fileStatus"></strong>
+ <strong id="fileStatus"></strong>
</div>
<div class="panel panel-default">
@@ -128,6 +131,9 @@ require("head.inc");
<input type="button" class="btn btn-default btn-sm" onclick="loadFile();" value="<?=gettext('Load')?>" />
<input type="button" class="btn btn-default btn-sm" id="fbOpen" value="<?=gettext('Browse')?>" />
<input type="button" class="btn btn-default btn-sm" onclick="saveFile();" value="<?=gettext('Save')?>" />
+ <span class="pull-right">
+ <button id="btngoto" class="btn btn-default btn-sm"><?=gettext("GoTo Line #")?></button> <input type="number" id="gotoline" width="6"></input>
+ </span>
</form>
<div id="fbBrowser" style="display:none; border:1px dashed gray; width:98%;"></div>
@@ -148,20 +154,72 @@ require("head.inc");
<script type="text/javascript">
//<![CDATA[
+ events.push(function(){
+
+ function showLine(tarea, lineNum) {
+
+ lineNum--; // array starts at 0
+ var lines = tarea.value.split("\n");
+
+ // calculate start/end
+ var startPos = 0, endPos = tarea.value.length;
+ for(var x = 0; x < lines.length; x++) {
+ if(x == lineNum) {
+ break;
+ }
+ startPos += (lines[x].length+1);
+
+ }
+
+ var endPos = lines[lineNum].length+startPos;
+
+ // do selection
+ // Chrome / Firefox
+
+ if(typeof(tarea.selectionStart) != "undefined") {
+ tarea.focus();
+ tarea.selectionStart = startPos;
+ tarea.selectionEnd = endPos;
+ return true;
+ }
+
+ // IE
+ if (document.selection && document.selection.createRange) {
+ tarea.focus();
+ tarea.select();
+ var range = document.selection.createRange();
+ range.collapse(true);
+ range.moveEnd("character", endPos);
+ range.moveStart("character", startPos);
+ range.select();
+ return true;
+ }
+
+ return false;
+ }
+
+ $("#btngoto").prop('type','button');
+
+ $('#btngoto').click(function() {
+ var tarea = document.getElementById("fileContent");
+ showLine(tarea, $('#gotoline').val());
+ });
+ });
+
function loadFile() {
- jQuery("#fileStatus").html("");
- jQuery("#fileStatusBox").show(500);
- jQuery.ajax(
+ $("#fileStatus").html("");
+ $("#fileStatusBox").show(500);
+ $.ajax(
"<?=$_SERVER['SCRIPT_NAME']?>", {
type: "post",
- data: "action=load&file=" + jQuery("#fbTarget").val(),
+ data: "action=load&file=" + $("#fbTarget").val(),
complete: loadComplete
}
);
}
function loadComplete(req) {
- jQuery("#fileContent").show(1000);
+ $("#fileContent").show(1000);
var values = req.responseText.split("|");
values.shift(); values.pop();
@@ -169,30 +227,30 @@ require("head.inc");
var file = values.shift();
var fileContent = window.atob(values.join("|"));
- jQuery("#fileContent").val(fileContent);
+ $("#fileContent").val(fileContent);
} else {
- jQuery("#fileStatus").html(values[0]);
- jQuery("#fileContent").val("");
+ $("#fileStatus").html(values[0]);
+ $("#fileContent").val("");
}
- jQuery("#fileContent").show(1000);
+ $("#fileContent").show(1000);
}
function saveFile(file) {
- jQuery("#fileStatus").html("");
- jQuery("#fileStatusBox").show(500);
+ $("#fileStatus").html("");
+ $("#fileStatusBox").show(500);
- var fileContent = Base64.encode(jQuery("#fileContent").val());
+ var fileContent = Base64.encode($("#fileContent").val());
fileContent = fileContent.replace(/\+/g, "%2B");
- jQuery.ajax(
+ $.ajax(
"<?=$_SERVER['SCRIPT_NAME']?>", {
type: "post",
- data: "action=save&file=" + jQuery("#fbTarget").val() +
+ data: "action=save&file=" + $("#fbTarget").val() +
"&data=" + fileContent,
complete: function(req) {
var values = req.responseText.split("|");
- jQuery("#fileStatus").html(values[1]);
+ $("#fileStatus").html(values[1]);
}
}
);
@@ -339,7 +397,7 @@ var Base64 = {
<?php if ($_GET['action'] == "load"): ?>
events.push(function() {
- jQuery("#fbTarget").val("<?=htmlspecialchars($_GET['path'])?>");
+ $("#fbTarget").val("<?=htmlspecialchars($_GET['path'])?>");
loadFile();
});
<?php endif; ?>
diff --git a/src/usr/local/www/exec.php b/src/usr/local/www/exec.php
index 44a2136..618eb23 100644
--- a/src/usr/local/www/exec.php
+++ b/src/usr/local/www/exec.php
@@ -90,7 +90,7 @@ if (($_POST['submit'] == "DOWNLOAD") && file_exists($_POST['dlPath'])) {
exit;
} else if (($_POST['submit'] == "UPLOAD") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
move_uploaded_file($_FILES['ulfile']['tmp_name'], "/tmp/" . $_FILES['ulfile']['name']);
- $ulmsg = "Uploaded file to /tmp/" . htmlentities($_FILES['ulfile']['name']);
+ $ulmsg = sprintf(gettext('Uploaded file to /tmp/%s'), htmlentities($_FILES['ulfile']['name']));
unset($_POST['txtCommand']);
}
@@ -218,29 +218,27 @@ if (isBlank($_POST['txtRecallBuffer'])) {
<?php
if (isBlank($_POST['txtCommand']) && isBlank($_POST['txtPHPCommand']) && isBlank($ulmsg)) {
- print('<div class="alert alert-warning" role="alert">'.gettext("The capabilities offered here can be dangerous. No support is available. Use them at your own risk!").'</div>');
+ print('<div class="alert alert-warning" role="alert">' . gettext("The capabilities offered here can be dangerous. No support is available. Use them at your own risk!") . '</div>');
}
if (!isBlank($_POST['txtCommand'])):?>
<div class="panel panel-success responsive">
- <div class="panel-heading"><h2 class="panel-title">Shell Output - <?=htmlspecialchars($_POST['txtCommand'])?></h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=sprintf(gettext('Shell Output - %s'), htmlspecialchars($_POST['txtCommand']))?></h2></div>
<div class="panel-body">
<div class="content">
- <pre>
<?php
putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
putenv("SCRIPT_FILENAME=" . strtok($_POST['txtCommand'], " "));
$output = array();
exec($_POST['txtCommand'] . ' 2>&1', $output);
- foreach ($output as $line) {
- print(htmlspecialchars($line) . "\r\n");
- }
+
+ $output = implode("\n", $output);
+ print("<pre>" . htmlspecialchars($output) . "</pre>");
?>
- </pre>
</div>
</div>
</div>
-<? endif ?>
+<?php endif; ?>
<form action="exec.php" method="post" enctype="multipart/form-data" name="frmExecPlus" onsubmit="return frmExecPlus_onSubmit( this );">
<div class="panel panel-default">
@@ -262,7 +260,7 @@ if (!isBlank($_POST['txtCommand'])):?>
<div class="panel-heading"><h2 class="panel-title"><?=gettext('Download file')?></h2></div>
<div class="panel-body">
<div class="content">
- <input name="dlPath" type="text" id="dlPath" placeholder="File to download" class="col-sm-4" value="<?php echo htmlspecialchars($_GET['dlPath']) ?>"/>
+ <input name="dlPath" type="text" id="dlPath" placeholder="File to download" class="col-sm-4" value="<?=htmlspecialchars($_GET['dlPath']);?>"/>
<br /><br />
<button name="submit" type="submit" class="btn btn-default btn-sm" id="download" value="DOWNLOAD"><?=gettext("Download")?></button>
</div>
@@ -271,7 +269,7 @@ if (!isBlank($_POST['txtCommand'])):?>
<?php
if ($ulmsg) {
- print('<div class="alert alert-success" role="alert">' . $ulmsg .'</div>');
+ print('<div class="alert alert-success" role="alert">' . $ulmsg . '</div>');
}
?>
<div class="panel panel-default">
@@ -288,8 +286,8 @@ if (!isBlank($_POST['txtCommand'])):?>
// Experimental version. Writes the user's php code to a file and executes it via a new instance of PHP
// This is intended to prevent bad code from breaking the GUI
if (!isBlank($_POST['txtPHPCommand'])) {
- puts("<div class=\"panel panel-success responsive\"><div class=\"panel-heading\">PHP response</div>");
- puts("<pre>");
+ puts("<div class=\"panel panel-success responsive\"><div class=\"panel-heading\"><h2 class=\"panel-title\">PHP response</h2></div>");
+
$tmpname = tempnam("/tmp", "");
$phpfile = fopen($tmpname, "w");
fwrite($phpfile, "<?php\n");
@@ -299,16 +297,15 @@ if (!isBlank($_POST['txtCommand'])):?>
fwrite($phpfile, "?>\n");
fclose($phpfile);
+ $output = array();
exec("/usr/local/bin/php " . $tmpname, $output);
- for ($i=0; $i < count($output); $i++) {
- print($output[$i] . "\n");
- }
-
unlink($tmpname);
+ $output = implode("\n", $output);
+ print("<pre>" . htmlspecialchars($output) . "</pre>");
+
// echo eval($_POST['txtPHPCommand']);
- puts("&nbsp;</pre>");
puts("</div>");
?>
<script type="text/javascript">
diff --git a/src/usr/local/www/favicon.ico b/src/usr/local/www/favicon.ico
index 3440bf2..3440bf2 100755..100644
--- a/src/usr/local/www/favicon.ico
+++ b/src/usr/local/www/favicon.ico
Binary files differ
diff --git a/src/usr/local/www/filebrowser/browser.js b/src/usr/local/www/filebrowser/browser.js
index 54e07ee..6e75272 100644
--- a/src/usr/local/www/filebrowser/browser.js
+++ b/src/usr/local/www/filebrowser/browser.js
@@ -1,22 +1,22 @@
-jQuery(document).ready(
+$(document).ready(
function() {
- jQuery("#fbOpen").click(
+ $("#fbOpen").click(
function() {
- jQuery("#fbBrowser").fadeIn(750);
- fbBrowse(jQuery("#fbTarget").val());
+ $("#fbBrowser").fadeIn(750);
+ fbBrowse($("#fbTarget").val());
}
);
}
);
function fbBrowse(path) {
- jQuery("#fileContent").fadeOut();
+ $("#fileContent").fadeOut();
- if (jQuery("#fbCurrentDir")) {
- jQuery("#fbCurrentDir").html("Loading ...");
+ if ($("#fbCurrentDir")) {
+ $("#fbCurrentDir").html("Loading ...");
}
- jQuery.ajax(
+ $.ajax(
"/filebrowser/browser.php?path=" + encodeURI(path ? path : "/"),
{ type: "get", complete: fbComplete }
);
@@ -24,20 +24,20 @@ function fbBrowse(path) {
}
function fbComplete(req) {
- jQuery("#fbBrowser").html(req.responseText);
+ $("#fbBrowser").html(req.responseText);
var actions = {
fbHome: function() { fbBrowse("/"); },
- fbClose: function() { jQuery("#fbBrowser").fadeOut(750); },
+ fbClose: function() { $("#fbBrowser").fadeOut(750); },
fbDir: function() { fbBrowse(this.id); },
- fbFile: function() { jQuery("#fbTarget").val(this.id); }
+ fbFile: function() { $("#fbTarget").val(this.id); }
}
for (var type in actions) {
- jQuery("#fbBrowser ." + type).each(
+ $("#fbBrowser ." + type).each(
function() {
- jQuery(this).click(actions[type]);
- jQuery(this).css("cursor","pointer");
+ $(this).click(actions[type]);
+ $(this).css("cursor","pointer");
}
);
}
diff --git a/src/usr/local/www/filebrowser/browser.php b/src/usr/local/www/filebrowser/browser.php
index fcbed78..c048187 100644
--- a/src/usr/local/www/filebrowser/browser.php
+++ b/src/usr/local/www/filebrowser/browser.php
@@ -45,16 +45,16 @@ if (is_file($path)) {
?>
<table width="100%">
<tr>
- <td class="fbHome" width="25px" align="left">
- <img onClick="jQuery('#fbTarget').val('<?=$realDir?>'); fbBrowse('/');" src="/filebrowser/images/icon_home.gif" alt="Home" title="Home" />
+ <td class="fbHome text-left" width="25px">
+ <img onClick="$('#fbTarget').val('<?=$realDir?>'); fbBrowse('/');" src="/filebrowser/images/icon_home.gif" alt="Home" title="Home" />
</td>
<td><b><?=$path;?></b></td>
- <td class="fbClose" align="right">
- <img onClick="jQuery('#fbBrowser').fadeOut();" border="0" src="/filebrowser/images/icon_cancel.gif" alt="Close" title="Close" />
+ <td class="fbClose text-right">
+ <img onClick="$('#fbBrowser').fadeOut();" border="0" src="/filebrowser/images/icon_cancel.gif" alt="Close" title="Close" />
</td>
</tr>
<tr>
- <td id="fbCurrentDir" colspan="3" class="vexpl" align="left">
+ <td id="fbCurrentDir" colspan="3" class="vexpl text-left">
<?php
// ----- read contents -----
@@ -81,8 +81,8 @@ foreach ($dirs as $dir):
?>
<tr>
<td></td>
- <td class="fbDir vexpl" id="<?=$realDir;?>" align="left">
- <div onClick="jQuery('#fbTarget').val('<?=$realDir?>'); fbBrowse('<?=$realDir?>');">
+ <td class="fbDir vexpl text-left" id="<?=$realDir;?>">
+ <div onClick="$('#fbTarget').val('<?=$realDir?>'); fbBrowse('<?=$realDir?>');">
<img src="/filebrowser/images/folder_generic.gif" />
&nbsp;<?=$dir;?>
</div>
@@ -147,14 +147,14 @@ foreach ($files as $file):
?>
<tr>
<td></td>
- <td class="fbFile vexpl" id="<?=$fqpn;?>" align="left">
+ <td class="fbFile vexpl text-left" id="<?=$fqpn;?>">
<?php $filename = str_replace("//","/", "{$path}/{$file}"); ?>
- <div onClick="jQuery('#fbTarget').val('<?=$filename?>'); loadFile(); jQuery('#fbBrowser').fadeOut();">
+ <div onClick="$('#fbTarget').val('<?=$filename?>'); loadFile(); $('#fbBrowser').fadeOut();">
<img src="/filebrowser/images/file_<?=$type;?>.gif" alt="" title="">
&nbsp;<?=$file;?>
</div>
</td>
- <td align="right" class="vexpl">
+ <td class="vexpl text-right">
<?=$size;?>
</td>
</tr>
diff --git a/src/usr/local/www/filebrowser/images/file_code.gif b/src/usr/local/www/filebrowser/images/file_code.gif
index f06a205..f06a205 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_code.gif
+++ b/src/usr/local/www/filebrowser/images/file_code.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_database.gif b/src/usr/local/www/filebrowser/images/file_database.gif
index d479c91..d479c91 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_database.gif
+++ b/src/usr/local/www/filebrowser/images/file_database.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_doc.gif b/src/usr/local/www/filebrowser/images/file_doc.gif
index 222c31b..222c31b 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_doc.gif
+++ b/src/usr/local/www/filebrowser/images/file_doc.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_flash.gif b/src/usr/local/www/filebrowser/images/file_flash.gif
index e565c37..e565c37 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_flash.gif
+++ b/src/usr/local/www/filebrowser/images/file_flash.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_generic.gif b/src/usr/local/www/filebrowser/images/file_generic.gif
index 5f39482..5f39482 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_generic.gif
+++ b/src/usr/local/www/filebrowser/images/file_generic.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_image.gif b/src/usr/local/www/filebrowser/images/file_image.gif
index 4960683..4960683 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_image.gif
+++ b/src/usr/local/www/filebrowser/images/file_image.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_js.gif b/src/usr/local/www/filebrowser/images/file_js.gif
index 9b6601f..9b6601f 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_js.gif
+++ b/src/usr/local/www/filebrowser/images/file_js.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_pdf.gif b/src/usr/local/www/filebrowser/images/file_pdf.gif
index b01bb23..b01bb23 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_pdf.gif
+++ b/src/usr/local/www/filebrowser/images/file_pdf.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_php.gif b/src/usr/local/www/filebrowser/images/file_php.gif
index ab7f459..ab7f459 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_php.gif
+++ b/src/usr/local/www/filebrowser/images/file_php.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_ppt.gif b/src/usr/local/www/filebrowser/images/file_ppt.gif
index 0383c98..0383c98 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_ppt.gif
+++ b/src/usr/local/www/filebrowser/images/file_ppt.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_system.gif b/src/usr/local/www/filebrowser/images/file_system.gif
index f1997c7..f1997c7 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_system.gif
+++ b/src/usr/local/www/filebrowser/images/file_system.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_xls.gif b/src/usr/local/www/filebrowser/images/file_xls.gif
index d004013..d004013 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_xls.gif
+++ b/src/usr/local/www/filebrowser/images/file_xls.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/file_zip.gif b/src/usr/local/www/filebrowser/images/file_zip.gif
index ec98255..ec98255 100755..100644
--- a/src/usr/local/www/filebrowser/images/file_zip.gif
+++ b/src/usr/local/www/filebrowser/images/file_zip.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/folder_generic.gif b/src/usr/local/www/filebrowser/images/folder_generic.gif
index 45b191d..45b191d 100755..100644
--- a/src/usr/local/www/filebrowser/images/folder_generic.gif
+++ b/src/usr/local/www/filebrowser/images/folder_generic.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/icon_cancel.gif b/src/usr/local/www/filebrowser/images/icon_cancel.gif
index 246a819..246a819 100755..100644
--- a/src/usr/local/www/filebrowser/images/icon_cancel.gif
+++ b/src/usr/local/www/filebrowser/images/icon_cancel.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/icon_contract.gif b/src/usr/local/www/filebrowser/images/icon_contract.gif
index cf82159..cf82159 100755..100644
--- a/src/usr/local/www/filebrowser/images/icon_contract.gif
+++ b/src/usr/local/www/filebrowser/images/icon_contract.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/icon_expand.gif b/src/usr/local/www/filebrowser/images/icon_expand.gif
index 06c0c68..06c0c68 100755..100644
--- a/src/usr/local/www/filebrowser/images/icon_expand.gif
+++ b/src/usr/local/www/filebrowser/images/icon_expand.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/icon_home.gif b/src/usr/local/www/filebrowser/images/icon_home.gif
index f888434..f888434 100755..100644
--- a/src/usr/local/www/filebrowser/images/icon_home.gif
+++ b/src/usr/local/www/filebrowser/images/icon_home.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/icon_left.gif b/src/usr/local/www/filebrowser/images/icon_left.gif
index 0d1137c..0d1137c 100755..100644
--- a/src/usr/local/www/filebrowser/images/icon_left.gif
+++ b/src/usr/local/www/filebrowser/images/icon_left.gif
Binary files differ
diff --git a/src/usr/local/www/filebrowser/images/icon_magnifier.gif b/src/usr/local/www/filebrowser/images/icon_magnifier.gif
index e96e548..e96e548 100755..100644
--- a/src/usr/local/www/filebrowser/images/icon_magnifier.gif
+++ b/src/usr/local/www/filebrowser/images/icon_magnifier.gif
Binary files differ
diff --git a/src/usr/local/www/firewall_aliases.php b/src/usr/local/www/firewall_aliases.php
index bf0bccc..4f422dd 100644
--- a/src/usr/local/www/firewall_aliases.php
+++ b/src/usr/local/www/firewall_aliases.php
@@ -204,15 +204,19 @@ if ($savemsg) {
}
if (is_subsystem_dirty('aliases')) {
- print_info_box_np(gettext("The alias list has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The alias list has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
-
display_top_tabs($tab_array);
?>
+
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=sprintf(gettext('Firewall Aliases %s'), $bctab)?></h2></div>
+ <div class="panel-body">
+
<div class="table-responsive">
-<table class="table table-striped table-hover">
+<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
<tr>
<th><?=gettext("Name")?></th>
@@ -290,6 +294,9 @@ display_top_tabs($tab_array);
</table>
</div>
+ </div>
+</div>
+
<nav class="action-buttons">
<a href="firewall_aliases_edit.php?tab=<?=$tab?>" role="button" class="btn btn-success btn-sm">
<i class="fa fa-plus icon-embed-btn"></i>
@@ -304,11 +311,11 @@ display_top_tabs($tab_array);
<!-- Information section. Icon ID must be "showinfo" and the information <div> ID must be "infoblock".
That way jQuery (in pfenseHelpers.js) will automatically take care of the display. -->
<div>
- <div id="infoblock">
+ <div class="infoblock">
<?=print_info_box(gettext('Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number ' .
'of changes that have to be made if a host, network or port changes. <br />' .
'You can enter the name of an alias instead of the host, network or port where indicated. The alias will be resolved according to the list above.' . '<br />' .
- 'If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped.'), info)?>
+ 'If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped.'), 'info', false)?>
</div>
</div>
diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php
index 6a23610..128335d 100755
--- a/src/usr/local/www/firewall_aliases_edit.php
+++ b/src/usr/local/www/firewall_aliases_edit.php
@@ -106,6 +106,16 @@ if ($debug) {
unlink_if_exists("{$g['tmp_path']}/alias_rename_log.txt");
}
+$singular_types = array(
+ 'host' => gettext("host"),
+ 'network' => gettext("network"),
+ 'port' => gettext("port"),
+ 'url' => gettext("URL (IP)"),
+ 'url_ports' => gettext("URL (Port)"),
+ 'urltable' => gettext("URL Table (IP)"),
+ 'urltable_ports' => gettext("URL Table (Port)"),
+);
+
function alias_same_type($name, $type) {
global $config;
@@ -172,7 +182,7 @@ if ($_POST) {
$input_errors[] = gettext("Reserved word used for alias name.");
} else {
if (is_validaliasname($_POST['name']) == false) {
- $input_errors[] = gettext("The alias name must be less than 32 characters long, may not consist of only numbers, and may only contain the following characters") . " a-z, A-Z, 0-9, _.";
+ $input_errors[] = sprintf(gettext("The alias name must be less than 32 characters long, may not consist of only numbers, may not consist of only underscores, and may only contain the following characters: %s"), 'a-z, A-Z, 0-9, _');
}
}
/* check for name conflicts */
@@ -186,7 +196,7 @@ if ($_POST) {
/* Check for reserved keyword names */
foreach ($reserved_keywords as $rk) {
if ($rk == $_POST['name']) {
- $input_errors[] = sprintf(gettext("Cannot use a reserved keyword as alias name %s"), $rk);
+ $input_errors[] = sprintf(gettext("Cannot use a reserved keyword as an alias name: %s"), $rk);
}
}
@@ -428,18 +438,18 @@ if ($_POST) {
}
} else if ($_POST['type'] == "port") {
if (!is_port($input_address) && !is_portrange($input_address)) {
- $input_errors[] = $input_address . " " . gettext("is not a valid port or alias.");
+ $input_errors[] = sprintf(gettext("%s is not a valid port or alias."), $input_address);
}
} else if ($_POST['type'] == "host" || $_POST['type'] == "network") {
if (is_subnet($input_address) ||
(!is_ipaddr($input_address) && !is_hostname($input_address))) {
- $input_errors[] = sprintf(gettext('%1$s is not a valid %2$s address, FQDN or alias.'), $input_address, $_POST['type']);
+ $input_errors[] = sprintf(gettext('%1$s is not a valid %2$s address, FQDN or alias.'), $input_address, $singular_types[$_POST['type']]);
}
}
$tmpaddress = $input_address;
if ($_POST['type'] != "host" && is_ipaddr($input_address) && $input_address_subnet[$idx] <> "") {
if (!is_subnet($input_address . "/" . $input_address_subnet[$idx])) {
- $input_errors[] = sprintf(gettext('%s/%s is not a valid subnet.'), $input_address, $input_address_subnet[$idx]);
+ $input_errors[] = sprintf(gettext('%1$s/%2$s is not a valid subnet.'), $input_address, $input_address_subnet[$idx]);
} else {
$tmpaddress .= "/" . $input_address_subnet[$idx];
}
@@ -557,7 +567,7 @@ $section_str = array(
'url_ports' => gettext("URL (Ports)"),
'urltable' => gettext("URL Table (IPs)"),
'urltable_ports' => gettext("URL Table (Ports)")
- );
+);
$btn_str = array(
'network' => gettext("Add Network"),
@@ -567,7 +577,7 @@ $btn_str = array(
'url_ports' => gettext("Add URL"),
'urltable' => gettext("Add URL Table"),
'urltable_ports' => gettext("Add URL Table")
- );
+);
$label_str = array(
'network' => gettext("Network or FQDN"),
@@ -577,28 +587,43 @@ $label_str = array(
'url_ports' => gettext("URL (Ports)"),
'urltable' => gettext("URL Table (IPs)"),
'urltable_ports' => gettext("URL Table (Ports)")
- );
+);
+
+$special_cidr_usage_text = gettext("The value after the \"/\" is the update frequency in days.");
$help = array(
- 'network' => "Networks are specified in CIDR format. Select the CIDR mask that pertains to each entry. /32 specifies a single IPv4 host, /128 specifies a single IPv6 host, /24 specifies 255.255.255.0, /64 specifies a normal IPv6 network, etc. Hostnames (FQDNs) may also be specified, using a /32 mask for IPv4 or /128 for IPv6. You may also enter an IP range such as 192.168.1.1-192.168.1.254 and a list of CIDR networks will be derived to fill the range.",
- 'host' => "Enter as many hosts as you would like. Hosts must be specified by their IP address or fully qualified domain name (FQDN). FQDN hostnames are periodically re-resolved and updated. If multiple IPs are returned by a DNS query, all are used. You may also enter an IP range such as 192.168.1.1-192.168.1.10 or a small subnet such as 192.168.1.16/28 and a list of individual IP addresses will be generated.",
- 'port' => "Enter as many ports as you wish. Port ranges can be expressed by separating with a colon.",
- 'url' => "Enter as many URLs as you wish. After saving we will download the URL and import the items into the alias. Use only with small sets of IP addresses (less than 3000).",
- 'url_ports' => "Enter as many URLs as you wish. After saving we will download the URL and import the items into the alias. Use only with small sets of Ports (less than 3000).",
- 'urltable' => "Enter a single URL containing a large number of IPs and/or Subnets. After saving we will download the URL and create a table file containing these addresses. This will work with large numbers of addresses (30,000+) or small numbers." . "<br /><b>The value after the \"/\" is the " .
- "update frequency in days.</b>",
- 'urltable_ports' => "Enter a single URL containing a list of Port numbers and/or Port ranges. After saving we will download the URL." . "<br /><b>The value after the \"/\" is the " .
- "update frequency in days.</b>"
+ 'network' => gettext("Networks are specified in CIDR format. Select the CIDR mask that pertains to each entry. /32 specifies a single IPv4 host, /128 specifies a single IPv6 host, /24 specifies 255.255.255.0, /64 specifies a normal IPv6 network, etc. Hostnames (FQDNs) may also be specified, using a /32 mask for IPv4 or /128 for IPv6. You may also enter an IP range such as 192.168.1.1-192.168.1.254 and a list of CIDR networks will be derived to fill the range."),
+ 'host' => gettext("Enter as many hosts as you would like. Hosts must be specified by their IP address or fully qualified domain name (FQDN). FQDN hostnames are periodically re-resolved and updated. If multiple IPs are returned by a DNS query, all are used. You may also enter an IP range such as 192.168.1.1-192.168.1.10 or a small subnet such as 192.168.1.16/28 and a list of individual IP addresses will be generated."),
+ 'port' => gettext("Enter as many ports as you wish. Port ranges can be expressed by separating with a colon."),
+ 'url' => gettext("Enter as many URLs as you wish. After saving we will download the URL and import the items into the alias. Use only with small sets of IP addresses (less than 3000)."),
+ 'url_ports' => gettext("Enter as many URLs as you wish. After saving we will download the URL and import the items into the alias. Use only with small sets of Ports (less than 3000)."),
+ 'urltable' => gettext("Enter a single URL containing a large number of IPs and/or Subnets. After saving we will download the URL and create a table file containing these addresses. This will work with large numbers of addresses (30,000+) or small numbers.") .
+ "<br /><b>" . $special_cidr_usage_text . "</b>",
+ 'urltable_ports' => gettext("Enter a single URL containing a list of Port numbers and/or Port ranges. After saving we will download the URL.") .
+ "<br /><b>" . $special_cidr_usage_text . "</b>",
+);
+
+// Tab type specific patterns.
+// Intentionally loose (valid character check only, no pattern recognition).
+// Can be tightend up with pattern recognition as desired for each tab type.
+$pattern_str = array(
+ 'network' => '[a-zA-Z0-9_:.-]+', // Alias Name, Host Name, IP Address, FQDN, Network or IP Address Range
+ 'host' => '[a-zA-Z0-9_:.-]+', // Alias Name, Host Name, IP Address, FQDN
+ 'port' => '[a-zA-Z0-9_:]+', // Alias Name, Port Number, or Port Number Range
+ 'url' => '.*', // Alias Name or URL
+ 'url_ports' => '.*', // Alias Name or URL
+ 'urltable' => '.*', // Alias Name or URL
+ 'urltable_ports' => '.*' // Alias Name or URL
);
$types = array(
- 'host' => 'Host(s)',
- 'network' => 'Network(s)',
- 'port' => 'Port(s)',
- 'url' => 'URL (IPs)',
- 'url_ports' => 'URL (Ports)',
- 'urltable' => 'URL Table (IPs)',
- 'urltable_ports' => 'URL Table (Ports)',
+ 'host' => gettext("Host(s)"),
+ 'network' => gettext("Network(s)"),
+ 'port' => gettext("Port(s)"),
+ 'url' => gettext("URL (IPs)"),
+ 'url_ports' => gettext("URL (Ports)"),
+ 'urltable' => gettext("URL Table (IPs)"),
+ 'urltable_ports' => gettext("URL Table (Ports)"),
);
if (empty($tab)) {
@@ -689,7 +714,13 @@ while ($counter < count($addresses)) {
list($address, $address_subnet) = explode("/", $addresses[$counter]);
} else {
$address = $addresses[$counter];
- $address_subnet = "";
+ if (isset($pconfig['updatefreq'])) {
+ // Note: There is only 1 updatefreq possible.
+ // The alias types that use updatefreq only allow a single entry.
+ $address_subnet = $pconfig['updatefreq'];
+ } else {
+ $address_subnet = "";
+ }
}
$group = new Form_Group($counter == 0 ? $label_str[$tab]:'');
@@ -699,7 +730,7 @@ while ($counter < count($addresses)) {
'address' . $counter,
'Address',
$address
- ))->addMask('address_subnet' . $counter, $address_subnet)->setWidth(4)->setPattern('[0-9, a-z, A-Z and .');
+ ))->addMask('address_subnet' . $counter, $address_subnet)->setWidth(4)->setPattern($pattern_str[$tab]);
$group->add(new Form_Input(
'detail' . $counter,
@@ -743,24 +774,30 @@ events.push(function() {
$("[id^='address_subnet']").prop("disabled", disable_subnets);
// Set the help text to match the tab
- var helparray = <?php echo json_encode($help); ?>;
+ var helparray = <?=json_encode($help);?>;
$('.helptext').html(helparray[tab]);
// Set the section heading by tab type
- var sectionstr = <?php echo json_encode($section_str); ?>;
+ var sectionstr = <?=json_encode($section_str);?>;
$('.panel-title:last').text(sectionstr[tab]);
- var buttonstr = <?php echo json_encode($btn_str); ?>;
+ var buttonstr = <?=json_encode($btn_str);?>;
$('.btn-success').prop('value', buttonstr[tab]);
// Set the input field label by tab
- var labelstr = <?php echo json_encode($label_str); ?>;
+ var labelstr = <?=json_encode($label_str);?>;
$('.repeatable:first').find('label').text(labelstr[tab]);
+ // Set the input field pattern by tab type
+ var patternstr = <?=json_encode($pattern_str);?>;
+ for (i = 0; i < <?=$counter;?>; i++) {
+ $('#address' + i).prop('pattern', patternstr[tab]);
+ }
+
// Hide and disable rows other than the first
hideRowsAfter(1, (tab == 'urltable') || (tab == 'urltable_ports'));
- // The add button and delete buttons must not show on URL Table IP or URL table ports
+ // The add button and delete buttons must not show on URL Table IP or URL table ports
if ((tab == 'urltable') || (tab == 'urltable_ports')) {
hideClass('addbtn', true);
$('[id^=deleterow]').hide();
diff --git a/src/usr/local/www/firewall_aliases_import.php b/src/usr/local/www/firewall_aliases_import.php
index 7260412..094211a 100755
--- a/src/usr/local/www/firewall_aliases_import.php
+++ b/src/usr/local/www/firewall_aliases_import.php
@@ -95,7 +95,7 @@ if ($_POST['aliasimport'] != "") {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (is_validaliasname($_POST['name']) == false) {
- $input_errors[] = gettext("The alias name may only consist of the characters") . " a-z, A-Z, 0-9, _.";
+ $input_errors[] = sprintf(gettext("The alias name may only consist of the characters %s"), "a-z, A-Z, 0-9, _.");
}
/* check for name duplicates */
@@ -107,7 +107,7 @@ if ($_POST['aliasimport'] != "") {
/* Check for reserved keyword names */
foreach ($reserved_keywords as $rk) {
if ($rk == $_POST['name']) {
- $input_errors[] = sprintf(gettext("Cannot use a reserved keyword as alias name %s"), $rk);
+ $input_errors[] = sprintf(gettext("Cannot use a reserved keyword as an alias name: %s"), $rk);
}
}
diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php
index b867ee2..ee0315c 100644
--- a/src/usr/local/www/firewall_nat.php
+++ b/src/usr/local/www/firewall_nat.php
@@ -87,6 +87,16 @@ if (array_key_exists('order-store', $_POST)) {
$a_nat = $a_nat_new;
+
+ $config['nat']['separator'] = "";
+
+ if ($_POST['separator']) {
+ $idx = 0;
+ foreach ($_POST['separator'] as $separator) {
+ $config['nat']['separator']['sep' . $idx++] = $separator;
+ }
+ }
+
if (write_config()) {
mark_subsystem_dirty('filter');
}
@@ -130,6 +140,16 @@ if ($_GET['act'] == "del") {
}
unset($a_nat[$_GET['id']]);
+ // Update the separators
+ $a_separators = &$config['nat']['separator'];
+
+ for ($idx=0; isset($a_separators['sep' . $idx]); $idx++ ) {
+ $seprow = substr($a_separators['sep' . $idx]['row']['0'], 2);
+ if ($seprow >= $_GET['id']) {
+ $a_separators['sep' . $idx]['row']['0'] = 'fr' . ($seprow - 1);
+ }
+ }
+
if (write_config()) {
mark_subsystem_dirty('natconf');
if ($want_dirty_filter) {
@@ -145,8 +165,11 @@ if ($_GET['act'] == "del") {
if (isset($_POST['del_x'])) {
/* delete selected rules */
if (is_array($_POST['rule']) && count($_POST['rule'])) {
+ $a_separators = &$config['nat']['separator'];
+
foreach ($_POST['rule'] as $rulei) {
- $target = $rule['target'];
+ $target = $rule['target'];
+
// Check for filter rule associations
if (isset($a_nat[$rulei]['associated-rule-id'])) {
delete_id($a_nat[$rulei]['associated-rule-id'], $config['filter']['rule']);
@@ -155,6 +178,14 @@ if (isset($_POST['del_x'])) {
}
unset($a_nat[$rulei]);
+
+ // Update the separators
+ for ($idx=0; isset($a_separators['sep' . $idx]); $idx++ ) {
+ $seprow = substr($a_separators['sep' . $idx]['row']['0'], 2);
+ if ($seprow >= $rulei) {
+ $a_separators['sep' . $idx]['row']['0'] = 'fr' . ($seprow - 1);
+ }
+ }
}
if (write_config()) {
@@ -164,6 +195,19 @@ if (isset($_POST['del_x'])) {
header("Location: firewall_nat.php");
exit;
}
+} else if ($_GET['act'] == "toggle") {
+ if ($a_nat[$_GET['id']]) {
+ if (isset($a_nat[$_GET['id']]['disabled'])) {
+ unset($a_nat[$_GET['id']]['disabled']);
+ } else {
+ $a_nat[$_GET['id']]['disabled'] = true;
+ }
+ if (write_config(gettext("Firewall: NAT: Port forward, enable/disable NAT rule"))) {
+ mark_subsystem_dirty('natconf');
+ }
+ header("Location: firewall_nat.php");
+ exit;
+ }
}
$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("Port Forward"));
@@ -174,8 +218,8 @@ if ($savemsg) {
}
if (is_subsystem_dirty('natconf')) {
- print_info_box_np(gettext('The NAT configuration has been changed.') . '<br />' .
- gettext('You must apply the changes in order for them to take effect.') . '<br />');
+ print_apply_box(gettext('The NAT configuration has been changed.') . '<br />' .
+ gettext('You must apply the changes in order for them to take effect.'));
}
$tab_array = array();
@@ -184,23 +228,26 @@ $tab_array[] = array(gettext("1:1"), false, "firewall_nat_1to1.php");
$tab_array[] = array(gettext("Outbound"), false, "firewall_nat_out.php");
$tab_array[] = array(gettext("NPt"), false, "firewall_nat_npt.php");
display_top_tabs($tab_array);
+
+$columns_in_table = 13;
?>
<form action="firewall_nat.php" method="post" name="iform">
<div class="panel panel-default">
- <div class="panel-heading"><?=gettext('Rules')?></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Rules')?></h2></div>
<div class="panel-body table-responsive">
- <table class="table table-striped table-hover table-condensed">
+ <table id="ruletable" class="table table-striped table-hover table-condensed">
<thead>
<tr>
<th><!-- Checkbox --></th>
+ <th><!-- Icon --></th>
<th><!-- Rule type --></th>
- <th><?=gettext("If")?></th>
- <th><?=gettext("Proto")?></th>
- <th><?=gettext("Src. addr")?></th>
- <th><?=gettext("Src. ports")?></th>
- <th><?=gettext("Dest. addr")?></th>
- <th><?=gettext("Dest. ports")?></th>
+ <th><?=gettext("Interface")?></th>
+ <th><?=gettext("Protocol")?></th>
+ <th><?=gettext("Source Address")?></th>
+ <th><?=gettext("Source Ports")?></th>
+ <th><?=gettext("Dest. Address")?></th>
+ <th><?=gettext("Dest. Ports")?></th>
<th><?=gettext("NAT IP")?></th>
<th><?=gettext("NAT Ports")?></th>
<th><?=gettext("Description")?></th>
@@ -212,6 +259,15 @@ display_top_tabs($tab_array);
$nnats = $i = 0;
+// There can be a separator before any rules are listed
+if ($config['nat']['separator']['sep0']['row'][0] == "fr-1") {
+ $cellcolor = $config['nat']['separator']['sep0']['color'];
+ print('<tr class="ui-sortable-handle separator">' .
+ '<td class="' . $cellcolor . '" colspan="' . ($columns_in_table -1) . '">' . '<span class="' . $cellcolor . '">' . $config['nat']['separator']['sep0']['text'] . '</span></td>' .
+ '<td class="' . $cellcolor . '"><a href="#"><i class="fa fa-trash no-confirm sepdel" title="delete this separator"></i></a></td>' .
+ '</tr>' . "\n");
+}
+
foreach ($a_nat as $natent):
$alias = rule_columns_with_alias(
@@ -225,13 +281,26 @@ foreach ($a_nat as $natent):
if (!have_natpfruleint_access($natent['interface'])) {
continue;
}
+
+ if (isset($natent['disabled'])) {
+ $iconfn = "pass_d";
+ $trclass = 'class="disabled"';
+ } else {
+ $iconfn = "pass";
+ $trclass = '';
+ }
?>
- <tr id="fr<?=$nnats;?>" onClick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$i;?>';">
+ <tr id="fr<?=$nnats;?>" <?=$trclass?> onClick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$i;?>';">
<td >
<input type="checkbox" id="frc<?=$nnats;?>" onClick="fr_toggle(<?=$nnats;?>)" name="rule[]" value="<?=$i;?>"/>
</td>
<td>
+ <a href="?act=toggle&amp;id=<?=$i?>">
+ <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-times"?>" title="<?=gettext("click to toggle enabled/disabled status")?>"></i>
+ </a>
+ </td>
+ <td>
<?php
if ($natent['associated-rule-id'] == "pass"):
?>
@@ -239,7 +308,7 @@ foreach ($a_nat as $natent):
<?php
elseif (!empty($natent['associated-rule-id'])):
?>
- <i class="fa fa-random" title="<?=gettext("Firewall rule ID ")?><?=htmlspecialchars($natent['associated-rule-id'])?> . <?=gettext('is managed by this rule')?>"></i>
+ <i class="fa fa-random" title="<?=sprintf(gettext("Firewall rule ID %s is managed by this rule"), htmlspecialchars($natent['associated-rule-id']))?>"></i>
<?php
endif;
?>
@@ -266,7 +335,7 @@ foreach ($a_nat as $natent):
<?php
if (isset($alias['src'])):
?>
- <a href="/firewall_aliases_edit.php?id=<?=$alias['src']?>" data-toggle="popover" data-trigger="hover focus" title="Alias details" data-content="<?=alias_info_popup($alias['src'])?>" data-html="true">
+ <a href="/firewall_aliases_edit.php?id=<?=$alias['src']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['src'])?>" data-html="true">
<?php
endif;
?>
@@ -283,7 +352,7 @@ foreach ($a_nat as $natent):
<?php
if (isset($alias['srcport'])):
?>
- <a href="/firewall_aliases_edit.php?id=<?=$alias['srcport']?>" data-toggle="popover" data-trigger="hover focus" title="Alias details" data-content="<?=alias_info_popup($alias['srcport'])?>" data-html="true">
+ <a href="/firewall_aliases_edit.php?id=<?=$alias['srcport']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['srcport'])?>" data-html="true">
<?php
endif;
?>
@@ -301,7 +370,7 @@ foreach ($a_nat as $natent):
<?php
if (isset($alias['dst'])):
?>
- <a href="/firewall_aliases_edit.php?id=<?=$alias['dst']?>" data-toggle="popover" data-trigger="hover focus" title="Alias details" data-content="<?=alias_info_popup($alias['dst'])?>" data-html="true">
+ <a href="/firewall_aliases_edit.php?id=<?=$alias['dst']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['dst'])?>" data-html="true">
<?php
endif;
?>
@@ -318,7 +387,7 @@ foreach ($a_nat as $natent):
<?php
if (isset($alias['dstport'])):
?>
- <a href="/firewall_aliases_edit.php?id=<?=$alias['dstport']?>" data-toggle="popover" data-trigger="hover focus" title="Alias details" data-content="<?=alias_info_popup($alias['dstport'])?>" data-html="true">
+ <a href="/firewall_aliases_edit.php?id=<?=$alias['dstport']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['dstport'])?>" data-html="true">
<?php
endif;
?>
@@ -359,6 +428,18 @@ foreach ($a_nat as $natent):
</td>
</tr>
<?php
+
+ if (isset($config['nat']['separator']['sep0'])) {
+ foreach ($config['nat']['separator'] as $rulesep) {
+ if ($rulesep['row']['0'] == "fr" . $nnats) {
+ $cellcolor = $rulesep['color'];
+ print('<tr class="ui-sortable-handle separator">' .
+ '<td class="' . $cellcolor . '" colspan="' . ($columns_in_table -1) . '">' . '<span class="' . $cellcolor . '">' . $rulesep['text'] . '</span></td>' .
+ '<td class="' . $cellcolor . '"><a href="#"><i class="fa fa-trash no-confirm sepdel" title="delete this separator"></i></a></td>' .
+ '</tr>' . "\n");
+ }
+ }
+ }
$i++;
$nnats++;
endforeach;
@@ -385,11 +466,23 @@ endforeach;
<i class="fa fa-save icon-embed-btn"></i>
<?=gettext("Save")?>
</button>
+ <button type="submit" id="addsep" name="addsep" class="btn btn-sm btn-warning" title="<?=gettext('Add separator')?>">
+ <i class="fa fa-plus icon-embed-btn"></i>
+ <?=gettext("Separator")?>
+ </button>
</nav>
</form>
<script type="text/javascript">
//<![CDATA[
+//Need to create some variables here so that jquery/pfSenseHelpers.js can read them
+iface = "<?=strtolower($if)?>";
+cncltxt = '<?=gettext("Cancel")?>';
+svtxt = '<?=gettext("Save")?>';
+svbtnplaceholder = '<?=gettext("Enter a description, Save, then drag to final location.")?>';
+configsection = "nat";
+dirty = false;
+
events.push(function() {
// Make rules sortable
@@ -397,12 +490,35 @@ events.push(function() {
cursor: 'grabbing',
update: function(event, ui) {
$('#order-store').removeAttr('disabled');
+ dirty = true;
+ reindex_rules(ui.item.parent('tbody'));
+ dirty = true;
}
});
// Check all of the rule checkboxes so that their values are posted
$('#order-store').click(function () {
$('[id^=frc]').prop('checked', true);
+
+ // Save the separator bar configuration
+ save_separators();
+
+ // Suppress the "Do you really want to leave the page" message
+ saving = true;
+
+ });
+
+ // Globals
+ saving = false;
+ dirty = false;
+
+ // provide a warning message if the user tries to change page before saving
+ $(window).bind('beforeunload', function(){
+ if (!saving && dirty) {
+ return ("<?=gettext('You have moved one or more Port Forward rules but have not yet saved')?>");
+ } else {
+ return undefined;
+ }
});
});
//]]>
diff --git a/src/usr/local/www/firewall_nat_1to1.php b/src/usr/local/www/firewall_nat_1to1.php
index a9dded2..4661e70 100644
--- a/src/usr/local/www/firewall_nat_1to1.php
+++ b/src/usr/local/www/firewall_nat_1to1.php
@@ -75,7 +75,7 @@ if (!is_array($config['nat']['onetoone'])) {
$a_1to1 = &$config['nat']['onetoone'];
/* update rule order, POST[rule] is an array of ordered IDs */
-if ($_POST['order-store']) {
+if (array_key_exists('order-store', $_POST)) {
if (is_array($_POST['rule']) && !empty($_POST['rule'])) {
$a_1to1_new = array();
@@ -144,7 +144,7 @@ if (isset($_POST['del_x'])) {
} else {
$a_1to1[$_GET['id']]['disabled'] = true;
}
- if (write_config("Firewall: NAT: Outbound, enable/disable NAT rule")) {
+ if (write_config(gettext("Firewall: NAT: 1 to 1, enable/disable NAT rule"))) {
mark_subsystem_dirty('natconf');
}
header("Location: firewall_nat_1to1.php");
@@ -160,8 +160,8 @@ if ($savemsg) {
}
if (is_subsystem_dirty('natconf')) {
- print_info_box_np(gettext('The NAT configuration has been changed.') . '<br />' .
- gettext('You must apply the changes in order for them to take effect.') . '<br />');
+ print_apply_box(gettext('The NAT configuration has been changed.') . '<br />' .
+ gettext('You must apply the changes in order for them to take effect.'));
}
$tab_array = array();
@@ -173,7 +173,7 @@ display_top_tabs($tab_array);
?>
<form action="firewall_nat_1to1.php" method="post">
<div class="panel panel-default">
- <div class="panel-heading"><?=gettext("NAT 1 to 1 mappings")?></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("NAT 1 to 1 mappings")?></h2></div>
<div id="mainarea" class="table-responsive panel-body">
<table class="table table-striped table-hover table-condensed">
<thead>
@@ -208,7 +208,10 @@ display_top_tabs($tab_array);
<td>
<a href="?act=toggle&amp;id=<?=$i?>">
- <i class="<?= ($iconfn == "pass") ? "fa-check":"fa-times"?>" title="<?=gettext("click to toggle enabled/disabled status")?>"></i>
+ <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-times"?>" title="<?=gettext("click to toggle enabled/disabled status")?>"></i>
+<?php if (isset($natent['nobinat'])) { ?>
+ &nbsp;<i class="fa fa-hand-paper-o text-danger" title="<?=gettext("Negated: This rule excludes NAT from a later rule")?>"></i>
+<?php } ?>
</a>
</td>
<td>
@@ -246,9 +249,9 @@ display_top_tabs($tab_array);
</td>
<td>
- <a class="fa fa-pencil" title="<?=gettext("Edit rule")?>" href="firewall_nat_1to1_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-clone" title="<?=gettext("Add a new rule based on this one")?>" href="firewall_nat_1to1_edit.php?dup=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext("Delete rule")?>" href="firewall_nat_1to1.php?act=del&amp;id=<?=$i?>" onclick="return confirm('<?=gettext("Are you sure you want to delete this rule?")?>')"></a>
+ <a class="fa fa-pencil" title="<?=gettext("Edit mapping")?>" href="firewall_nat_1to1_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-clone" title="<?=gettext("Add a new mapping based on this one")?>" href="firewall_nat_1to1_edit.php?dup=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext("Delete mapping")?>" href="firewall_nat_1to1.php?act=del&amp;id=<?=$i?>"></a>
</td>
</tr>
@@ -262,28 +265,32 @@ display_top_tabs($tab_array);
</div>
<nav class="action-buttons">
- <a href="firewall_nat_1to1_edit.php?after=-1" class="btn btn-sm btn-success" title="<?=gettext('Add new mapping')?>">
- <i class="fa fa-plus icon-embed-btn"></i>
+ <a href="firewall_nat_1to1_edit.php?after=-1" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the top of the list')?>">
+ <i class="fa fa-level-up icon-embed-btn"></i>
<?=gettext('Add')?>
</a>
- <button name="del_x" type="submit" class="btn btn-danger btn-sm" value="<?=gettext("Delete selected rule"); ?>">
+ <a href="firewall_nat_1to1_edit.php" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the end of the list')?>">
+ <i class="fa fa-level-down icon-embed-btn"></i>
+ <?=gettext('Add')?>
+ </a>
+ <button name="del_x" type="submit" class="btn btn-danger btn-sm" title="<?=gettext('Delete selected mappings')?>">
<i class="fa fa-trash icon-embed-btn"></i>
<?=gettext("Delete"); ?>
</button>
- <button type="submit" id="order-store" name="order-store" class="btn btn-primary btn-sm" value="Save changes" disabled>
+ <button type="submit" id="order-store" name="order-store" class="btn btn-primary btn-sm" disabled title="<?=gettext('Save mapping order')?>">
<i class="fa fa-save icon-embed-btn"></i>
<?=gettext("Save")?>
</button>
</nav>
</form>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(gettext('Depending on the way your WAN connection is setup, you may also need a ') . '<a href="firewall_virtual_ip.php">' .
gettext("Virtual IP.") . '</a>' . '<br />' .
gettext('If you add a 1:1 NAT entry for any of the interface IPs on this system, ' .
'it will make this system inaccessible on that IP address. i.e. if ' .
'you use your WAN IP address, any services on this system (IPsec, OpenVPN server, etc.) ' .
- 'using the WAN IP address will no longer function.'), info)?>
+ 'using the WAN IP address will no longer function.'), 'info', false)?>
</div>
@@ -296,12 +303,29 @@ events.push(function() {
cursor: 'grabbing',
update: function(event, ui) {
$('#order-store').removeAttr('disabled');
+ dirty = true;
}
});
// Check all of the rule checkboxes so that their values are posted
$('#order-store').click(function () {
$('[id^=frc]').prop('checked', true);
+
+ // Suppress the "Do you really want to leave the page" message
+ saving = true;
+ });
+
+ // Globals
+ saving = false;
+ dirty = false;
+
+ // provide a warning message if the user tries to change page before saving
+ $(window).bind('beforeunload', function(){
+ if (!saving && dirty) {
+ return ("<?=gettext('You have moved one or more NAT 1:1 mappings but have not yet saved')?>");
+ } else {
+ return undefined;
+ }
});
});
//]]>
diff --git a/src/usr/local/www/firewall_nat_1to1_edit.php b/src/usr/local/www/firewall_nat_1to1_edit.php
index 20c7bb6..4b6178f 100644
--- a/src/usr/local/www/firewall_nat_1to1_edit.php
+++ b/src/usr/local/www/firewall_nat_1to1_edit.php
@@ -103,6 +103,7 @@ if (isset($_GET['dup'])) {
}
if (isset($id) && $a_1to1[$id]) {
+ $pconfig['nobinat'] = isset($a_1to1[$id]['nobinat']);
$pconfig['disabled'] = isset($a_1to1[$id]['disabled']);
address_to_pconfig($a_1to1[$id]['source'], $pconfig['src'],
@@ -146,8 +147,13 @@ if ($_POST) {
}
/* input validation */
- $reqdfields = explode(" ", "interface external");
- $reqdfieldsn = array(gettext("Interface"), gettext("External subnet"));
+ if (isset($_POST['nobinat'])) {
+ $reqdfields = explode(" ", "interface");
+ $reqdfieldsn = array(gettext("Interface"));
+ } else {
+ $reqdfields = explode(" ", "interface external");
+ $reqdfieldsn = array(gettext("Interface"), gettext("External subnet"));
+ }
if ($_POST['srctype'] == "single" || $_POST['srctype'] == "network") {
$reqdfields[] = "src";
@@ -236,6 +242,7 @@ if ($_POST) {
if (!$input_errors) {
$natent = array();
+ $natent['nobinat'] = isset($_POST['nobinat']) ? true:false;
$natent['disabled'] = isset($_POST['disabled']) ? true:false;
$natent['external'] = $_POST['external'];
$natent['descr'] = $_POST['descr'];
@@ -277,16 +284,16 @@ include("head.inc");
function build_srctype_list() {
global $pconfig, $ifdisp;
- $list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network');
+ $list = array('any' => gettext('Any'), 'single' => gettext('Single host or alias'), 'network' => gettext('Network'));
$sel = is_specialnet($pconfig['src']);
if (have_ruleint_access("pppoe")) {
- $list['pppoe'] = 'PPPoE clients';
+ $list['pppoe'] = gettext('PPPoE clients');
}
if (have_ruleint_access("l2tp")) {
- $list['l2tp'] = 'L2TP clients';
+ $list['l2tp'] = gettext('L2TP clients');
}
foreach ($ifdisp as $ifent => $ifdesc) {
@@ -319,14 +326,14 @@ function build_dsttype_list() {
global $pconfig, $config, $ifdisp;
$sel = is_specialnet($pconfig['dst']);
- $list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network', '(self)' => 'This Firewall (self)');
+ $list = array('any' => gettext('Any'), 'single' => gettext('Single host or alias'), 'network' => gettext('Network'), '(self)' => gettext('This Firewall (self)'));
if (have_ruleint_access("pppoe")) {
- $list['pppoe'] = 'PPPoE clients';
+ $list['pppoe'] = gettext('PPPoE clients');
}
if (have_ruleint_access("l2tp")) {
- $list['l2tp'] = 'L2TP clients';
+ $list['l2tp'] = gettext('L2TP clients');
}
foreach ($ifdisp as $if => $ifdesc) {
@@ -366,7 +373,7 @@ function dsttype_selected() {
$sel = is_specialnet($pconfig['dst']);
- if (empty($pconfig['dst'] || $pconfig['dst'] == "any")) {
+ if (empty($pconfig['dst']) || $pconfig['dst'] == "any") {
return('any');
}
@@ -393,10 +400,17 @@ $form = new Form(new Form_Button(
$section = new Form_Section('Edit NAT 1 to 1 entry');
$section->addInput(new Form_Checkbox(
- 'nordr',
- 'No RDR (NOT)',
+ 'nobinat',
+ 'Negate',
+ 'This rule will be excluded from the NAT',
+ $pconfig['nobinat']
+))->setHelp('Use this to exclude addresses from a rule that follows this one');
+
+$section->addInput(new Form_Checkbox(
+ 'disabled',
+ 'No BINAT (NOT)',
'Disable redirection for traffic matching this rule',
- $pconfig['nordr']
+ $pconfig['disabled']
))->setHelp('This option is rarely needed, don\'t use this unless you know what you\'re doing.');
$iflist = get_configured_interface_with_descr(false, true);
@@ -409,22 +423,22 @@ foreach ($iflist as $if => $ifdesc) {
if ($config['l2tp']['mode'] == "server") {
if (have_ruleint_access("l2tp")) {
- $interfaces['l2tp'] = "L2TP VPN";
+ $interfaces['l2tp'] = gettext("L2TP VPN");
}
}
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
- $interfaces['pppoe'] = "PPPoE Server";
+ $interfaces['pppoe'] = gettext("PPPoE Server");
}
/* add ipsec interfaces */
if (ipsec_enabled() && have_ruleint_access("enc0")) {
- $interfaces["enc0"] = "IPsec";
+ $interfaces["enc0"] = gettext("IPsec");
}
/* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
- $interfaces["openvpn"] = "OpenVPN";
+ $interfaces["openvpn"] = gettext("OpenVPN");
}
$section->addInput(new Form_Select(
@@ -461,7 +475,7 @@ $group->add(new Form_IpAddress(
'src',
null,
is_specialnet($pconfig['src']) ? '': $pconfig['src']
-))->addMask('srcmask', $pconfig['srcmask'], 31)->setHelp('Address/mask')->setPattern('[0-9, a-z, A-Z and .');
+))->addMask('srcmask', $pconfig['srcmask'], 31)->setHelp('Address/mask')->setPattern('[a-zA-Z0-9\.\:\_]+');
$group->setHelp('Enter the internal (LAN) subnet for the 1:1 mapping. ' .
'The subnet size specified for the internal subnet will be applied to the external subnet.');
@@ -488,7 +502,7 @@ $group->add(new Form_IpAddress(
'dst',
null,
is_specialnet($pconfig['dst']) ? '': $pconfig['dst']
-))->addMask('dstmask', $pconfig['dstmask'], 31)->setHelp('Address/mask')->setPattern('[0-9, a-z, A-Z and .');
+))->addMask('dstmask', $pconfig['dstmask'], 31)->setHelp('Address/mask')->setPattern('[a-zA-Z0-9\.\:\_]+');
$group->setHelp('The 1:1 mapping will only be used for connections to or from the specified destination. Hint: this is usually "Any".');
@@ -506,9 +520,9 @@ $section->addInput(new Form_Select(
'NAT reflection',
$pconfig['natreflection'],
array(
- 'default' => 'Use system default',
- 'enable' => 'Enable',
- 'disable' => 'Disable'
+ 'default' => gettext('Use system default'),
+ 'enable' => gettext('Enable'),
+ 'disable' => gettext('Disable')
)
));
diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php
index 2e34597..2165a32 100644
--- a/src/usr/local/www/firewall_nat_edit.php
+++ b/src/usr/local/www/firewall_nat_edit.php
@@ -491,6 +491,7 @@ if ($_POST) {
// If this is a new rule, create an ID and add the rule
if ($_POST['filter-rule-association'] == 'add-associated') {
$filterent['associated-rule-id'] = $natent['associated-rule-id'] = get_unique_id();
+ $filterent['tracker'] = (int)microtime(true);
$filterent['created'] = make_config_revision_entry(null, gettext("NAT Port Forward"));
$config['filter']['rule'][] = $filterent;
}
@@ -514,6 +515,18 @@ if ($_POST) {
$natent['created'] = make_config_revision_entry();
if (is_numeric($after)) {
array_splice($a_nat, $after+1, 0, array($natent));
+
+ // Update the separators
+ $a_separators = &$config['nat']['separator'];
+
+ for ($idx=0; isset($a_separators['sep' . $idx]); $idx++ ) {
+ $seprow = substr($a_separators['sep' . $idx]['row']['0'], 2);
+
+ // If the separator is located after the place where the new rule is to go, increment the separator row
+ if ($seprow > $after) {
+ $a_separators['sep' . $idx]['row']['0'] = 'fr' . ($seprow + 1);
+ }
+ }
} else {
$a_nat[] = $natent;
}
@@ -531,16 +544,16 @@ if ($_POST) {
function build_srctype_list() {
global $pconfig, $ifdisp, $config;
- $list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network');
+ $list = array('any' => gettext('Any'), 'single' => gettext('Single host or alias'), 'network' => gettext('Network'));
$sel = is_specialnet($pconfig['src']);
if (have_ruleint_access("pppoe")) {
- $list['pppoe'] = 'PPPoE clients';
+ $list['pppoe'] = gettext('PPPoE clients');
}
if (have_ruleint_access("l2tp")) {
- $list['l2tp'] = 'L2TP clients';
+ $list['l2tp'] = gettext('L2TP clients');
}
foreach ($ifdisp as $ifent => $ifdesc) {
@@ -577,14 +590,14 @@ function build_dsttype_list() {
global $pconfig, $config, $ifdisp;
$sel = is_specialnet($pconfig['dst']);
- $list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network', '(self)' => 'This Firewall (self)');
+ $list = array('any' => gettext('Any'), 'single' => gettext('Single host or alias'), 'network' => gettext('Network'), '(self)' => gettext('This Firewall (self)'));
if (have_ruleint_access("pppoe")) {
- $list['pppoe'] = 'PPPoE clients';
+ $list['pppoe'] = gettext('PPPoE clients');
}
if (have_ruleint_access("l2tp")) {
- $list['l2tp'] = 'L2TP clients';
+ $list['l2tp'] = gettext('L2TP clients');
}
foreach ($ifdisp as $if => $ifdesc) {
@@ -681,22 +694,22 @@ foreach ($iflist as $if => $ifdesc) {
if ($config['l2tp']['mode'] == "server") {
if (have_ruleint_access("l2tp")) {
- $interfaces['l2tp'] = "L2TP VPN";
+ $interfaces['l2tp'] = gettext("L2TP VPN");
}
}
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
- $interfaces['pppoe'] = "PPPoE Server";
+ $interfaces['pppoe'] = gettext("PPPoE Server");
}
/* add ipsec interfaces */
if (ipsec_enabled() && have_ruleint_access("enc0")) {
- $interfaces["enc0"] = "IPsec";
+ $interfaces["enc0"] = gettext("IPsec");
}
/* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
- $interfaces["openvpn"] = "OpenVPN";
+ $interfaces["openvpn"] = gettext("OpenVPN");
}
$section->addInput(new Form_Select(
@@ -752,7 +765,7 @@ $group->add(new Form_IpAddress(
$section->add($group);
-$portlist = array("" => 'Other', 'any' => 'Any');
+$portlist = array("" => gettext('Other'), 'any' => gettext('Any'));
foreach ($wkports as $wkport => $wkportdesc) {
$portlist[$wkport] = $wkportdesc;
@@ -772,9 +785,8 @@ $group->add(new Form_Input(
'srcbeginport_cust',
null,
'text',
- $pconfig['srcbeginport'],
- ['min' => '1', 'max' => '65536']
-))->setHelp('Custom');
+ $pconfig['srcbeginport']
+))->setPattern('[a-zA-Z0-9_]+')->setHelp('Custom');
$group->add(new Form_Select(
'srcendport',
@@ -787,9 +799,8 @@ $group->add(new Form_Input(
'srcendport_cust',
null,
'text',
- $pconfig['srcendport'],
- ['min' => '1', 'max' => '65536']
-))->setHelp('Custom');
+ $pconfig['srcendport']
+))->setPattern('[a-zA-Z0-9_]+')->setHelp('Custom');
$group->setHelp('Specify the source port or port range for this rule. This is usually random and almost never ' .
'equal to the destination port range (and should usually be \'any\'). You can leave the \'to\' field ' .
@@ -835,9 +846,8 @@ $group->add(new Form_Input(
'dstbeginport_cust',
null,
'text',
- $pconfig['dstbeginport'],
- ['min' => '1', 'max' => '65536']
-))->setHelp('Custom');
+ $pconfig['dstbeginport']
+))->setPattern('[a-zA-Z0-9_]+')->setHelp('Custom');
$group->add(new Form_Select(
'dstendport',
@@ -850,9 +860,8 @@ $group->add(new Form_Input(
'dstendport_cust',
null,
'text',
- $pconfig['dstendport'],
- ['min' => '1', 'max' => '65536']
-))->setHelp('Custom');
+ $pconfig['dstendport']
+))->setPattern('[a-zA-Z0-9_]+')->setHelp('Custom');
$group->setHelp('Specify the port or port range for the destination of the packet for this mapping. ' .
'You can leave the \'to\' field empty if you only want to map a single port ');
@@ -884,9 +893,8 @@ $group->add(new Form_Input(
'localbeginport_cust',
null,
'text',
- $pconfig['localbeginport'],
- ['min' => '1', 'max' => '65536']
-))->setHelp('Custom');
+ $pconfig['localbeginport']
+))->setPattern('[a-zA-Z0-9_]+')->setHelp('Custom');
$section->add($group);
@@ -911,24 +919,24 @@ $section->addInput(new Form_Select(
'NAT reflection',
$pconfig['natreflection'],
array(
- 'default' => 'Use system default',
- 'enable' => 'Enable (NAT + Proxy)',
- 'purenat' => 'Enable (Pure NAT)',
- 'disable' => 'Disable'
+ 'default' => gettext('Use system default'),
+ 'enable' => gettext('Enable (NAT + Proxy)'),
+ 'purenat' => gettext('Enable (Pure NAT)'),
+ 'disable' => gettext('Disable')
)
));
if (isset($id) && $a_nat[$id] && (!isset($_GET['dup']) || !is_numericint($_GET['dup']))) {
$hlpstr = '';
- $rulelist = array('' => 'None', 'pass' => 'Pass');
+ $rulelist = array('' => gettext('None'), 'pass' => gettext('Pass'));
if (is_array($config['filter']['rule'])) {
filter_rules_sort();
foreach ($config['filter']['rule'] as $filter_id => $filter_rule) {
if (isset($filter_rule['associated-rule-id'])) {
- $rulelist[$filter_rule['associated-rule-id']] = 'Rule ' . $filter_rule['descr'];
+ $rulelist[$filter_rule['associated-rule-id']] = sprintf(gettext('Rule %s'), $filter_rule['descr']);
if ($filter_rule['associated-rule-id'] == $pconfig['associated-rule-id']) {
$hlpstr = '<a href="firewall_rules_edit.php?id=' . $filter_id . '">' . gettext("View the filter rule") . '</a><br />';
@@ -938,7 +946,7 @@ if (isset($id) && $a_nat[$id] && (!isset($_GET['dup']) || !is_numericint($_GET['
}
if (isset($pconfig['associated-rule-id'])) {
- $rulelist['new'] = 'Create new associated filter rule';
+ $rulelist['new'] = gettext('Create new associated filter rule');
}
$section->addInput(new Form_Select(
@@ -954,9 +962,9 @@ if (isset($id) && $a_nat[$id] && (!isset($_GET['dup']) || !is_numericint($_GET['
'add-associated',
array(
'' => 'None',
- 'add-associated' => 'Add associated filter rule',
- 'add-unassociated' => 'Add unassociated filter rule',
- 'pass' => 'Pass'
+ 'add-associated' => gettext('Add associated filter rule'),
+ 'add-unassociated' => gettext('Add unassociated filter rule'),
+ 'pass' => gettext('Pass')
)
))->setHelp('The "pass" selection does not work properly with Multi-WAN. It will only work on an interface containing the default gateway.');
}
@@ -1060,7 +1068,7 @@ events.push(function() {
} else {
disableInput('srcbeginport', false);
disableInput('srcendport', false);
- disableInput('localbeginport_cust', false);
+// disableInput('localbeginport_cust', false);
if (dstenabled) {
disableInput('dstbeginport', false);
disableInput('dstendport', false);
@@ -1284,9 +1292,10 @@ events.push(function() {
source: addressarray
});
- $('#dstbeginport_cust, #dstendport_cust, #srcbeginport_cust, #srcendport_cust, localbeginport_cust').autocomplete({
+ $('#dstbeginport_cust, #dstendport_cust, #srcbeginport_cust, #srcendport_cust, #localbeginport_cust').autocomplete({
source: customarray
});
+
});
//]]>
</script>
diff --git a/src/usr/local/www/firewall_nat_npt.php b/src/usr/local/www/firewall_nat_npt.php
index 3c3f441..2317dbd 100644
--- a/src/usr/local/www/firewall_nat_npt.php
+++ b/src/usr/local/www/firewall_nat_npt.php
@@ -75,6 +75,27 @@ if (!is_array($config['nat']['npt'])) {
$a_npt = &$config['nat']['npt'];
+/* update rule order, POST[rule] is an array of ordered IDs */
+if (array_key_exists('order-store', $_POST)) {
+ if (is_array($_POST['rule']) && !empty($_POST['rule'])) {
+ $a_npt_new = array();
+
+ // if a rule is not in POST[rule], it has been deleted by the user
+ foreach ($_POST['rule'] as $id) {
+ $a_npt_new[] = $a_npt[$id];
+ }
+
+ $a_npt = $a_npt_new;
+
+ if (write_config()) {
+ mark_subsystem_dirty('natconf');
+ }
+
+ header("Location: firewall_nat_npt.php");
+ exit;
+ }
+}
+
if ($_POST) {
$pconfig = $_POST;
@@ -101,6 +122,36 @@ if ($_GET['act'] == "del") {
}
}
+if (isset($_POST['del_x'])) {
+ /* delete selected rules */
+ if (is_array($_POST['rule']) && count($_POST['rule'])) {
+ foreach ($_POST['rule'] as $rulei) {
+ unset($a_npt[$rulei]);
+ }
+
+ if (write_config()) {
+ mark_subsystem_dirty('natconf');
+ }
+
+ header("Location: firewall_nat_npt.php");
+ exit;
+ }
+
+} else if ($_GET['act'] == "toggle") {
+ if ($a_npt[$_GET['id']]) {
+ if (isset($a_npt[$_GET['id']]['disabled'])) {
+ unset($a_npt[$_GET['id']]['disabled']);
+ } else {
+ $a_npt[$_GET['id']]['disabled'] = true;
+ }
+ if (write_config(gettext("Firewall: NAT: NPt, enable/disable NAT rule"))) {
+ mark_subsystem_dirty('natconf');
+ }
+ header("Location: firewall_nat_npt.php");
+ exit;
+ }
+}
+
$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("NPt"));
include("head.inc");
@@ -109,7 +160,8 @@ if ($savemsg) {
}
if (is_subsystem_dirty('natconf')) {
- print_info_box_np(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext('The NAT configuration has been changed.') . '<br />' .
+ gettext('You must apply the changes in order for them to take effect.'));
}
$tab_array = array();
@@ -119,76 +171,108 @@ $tab_array[] = array(gettext("Outbound"), false, "firewall_nat_out.php");
$tab_array[] = array(gettext("NPt"), true, "firewall_nat_npt.php");
display_top_tabs($tab_array);
?>
-
-<div class="panel-body table responsive">
- <form method="post">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Interface")?></th>
- <th><?=gettext("External Prefix")?></th>
- <th><?=gettext("Internal prefix")?></th>
- <th><?=gettext("Description")?></th>
- <th><!-- Buttons --></th>
- </tr>
- </thead>
- <tbody class="user-entries">
+<form action="firewall_nat_npt.php" method="post">
+ <div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('NPt Mappings')?></h2></div>
+ <div id="mainarea" class="table-responsive panel-body">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><!-- checkbox --></th>
+ <th><!-- icon --></th>
+ <th><?=gettext("Interface")?></th>
+ <th><?=gettext("External Prefix")?></th>
+ <th><?=gettext("Internal prefix")?></th>
+ <th><?=gettext("Description")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody class="user-entries">
<?php
-$i = 0;
-foreach ($a_npt as $natent):
+ $textse = "</span>";
+ $i = 0;
+ foreach ($a_npt as $natent):
+ if (isset($natent['disabled'])) {
+ $textss = "<span class=\"gray\">";
+ $iconfn = "pass_d";
+ $trclass = 'class="disabled"';
+ } else {
+ $textss = "<span>";
+ $iconfn = "pass";
+ $trclass = '';
+ }
?>
- <tr<?=isset($natent['disabled'])? ' class="disabled"' : ''?>>
- <td>
- <input type="hidden" name="rule[]" value="<?=$i?>" />
+ <tr id="fr<?=$i;?>" <?=$trclass?> onClick="fr_toggle(<?=$i;?>)" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';">
+ <td >
+ <input type="checkbox" id="frc<?=$i;?>" onClick="fr_toggle(<?=$i;?>)" name="rule[]" value="<?=$i;?>"/>
+ </td>
+ <td>
+ <a href="?act=toggle&amp;id=<?=$i?>">
+ <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-times"?>" title="<?=gettext("click to toggle enabled/disabled status")?>"></i>
+ </a>
+ </td>
+ <td>
<?php
- if (!$natent['interface']) {
- print(htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan")));
- } else {
- print(htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])));
- }
+ echo $textss;
+ if (!$natent['interface']) {
+ echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan"));
+ } else {
+ echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface']));
+ }
+ echo $textse;
?>
- </td>
+ </td>
+ <td>
<?php
- $source_net = pprint_address($natent['source']);
- $source_cidr = strstr($source_net, '/');
- $destination_net = pprint_address($natent['destination']);
- $destination_cidr = strstr($destination_net, '/');
+ echo $textss . pprint_address($natent['destination']) . $textse;
?>
- <td>
- <?=$destination_net?>
- </td>
- <td>
- <?=$source_net?>
- </td>
- <td>
- <?=htmlspecialchars($natent['descr'])?>
- </td>
- <td>
- <a href="firewall_nat_npt_edit.php?id=<?=$i?>" class="btn btn-xs btn-info"><?=gettext("Edit")?></a>
- <a href="firewall_nat_npt.php?act=del&amp;id=<?=$i?>" class="btn btn-xs btn-danger"><?=gettext("Delete")?></a>
- </td>
- </tr>
+ </td>
+ <td>
+<?php
+ echo $textss . pprint_address($natent['source']) . $textse;
+?>
+ </td>
+ <td>
+<?php
+ echo $textss . htmlspecialchars($natent['descr']) . '&nbsp;' . $textse;
+?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext("Edit mapping")?>" href="firewall_nat_npt_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-clone" title="<?=gettext("Add a new mapping based on this one")?>" href="firewall_nat_npt_edit.php?dup=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext("Delete mapping")?>" href="firewall_nat_npt.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php
$i++;
endforeach;
?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ <nav class="action-buttons">
+ <a href="firewall_nat_npt_edit.php?after=-1" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the top of the list')?>">
+ <i class="fa fa-level-up icon-embed-btn"></i>
+ <?=gettext('Add')?>
+ </a>
+ <a href="firewall_nat_npt_edit.php" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the end of the list')?>">
+ <i class="fa fa-level-down icon-embed-btn"></i>
+ <?=gettext('Add')?>
+ </a>
+ <button name="del_x" type="submit" class="btn btn-danger btn-sm" title="<?=gettext('Delete selected mappings')?>">
+ <i class="fa fa-trash icon-embed-btn"></i>
+ <?=gettext("Delete"); ?>
+ </button>
+ <button type="submit" id="order-store" name="order-store" class="btn btn-primary btn-sm" disabled title="<?=gettext('Save mapping order')?>">
+ <i class="fa fa-save icon-embed-btn"></i>
+ <?=gettext("Save")?>
+ </button>
+ </nav>
</form>
-<nav class="action-buttons">
- <a href="firewall_nat_npt_edit.php" class="btn btn-sm btn-success">
- <i class="fa fa-plus icon-embed-btn"></i>
- <?=gettext("Add")?>
- </a>
- <button type="submit" id="order-store" class="btn btn-primary btn-sm" value="store changes" disabled>
- <i class="fa fa-save icon-embed-btn"></i>
- <?=gettext("Save")?>
- </button>
-</nav>
-
-</div>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
@@ -197,6 +281,28 @@ events.push(function() {
cursor: 'grabbing',
update: function(event, ui) {
$('#order-store').removeAttr('disabled');
+ dirty = true;
+ }
+ });
+
+ // Check all of the rule checkboxes so that their values are posted
+ $('#order-store').click(function () {
+ $('[id^=frc]').prop('checked', true);
+
+ // Suppress the "Do you really want to leave the page" message
+ saving = true;
+ });
+
+ // Globals
+ saving = false;
+ dirty = false;
+
+ // provide a warning message if the user tries to change page before saving
+ $(window).bind('beforeunload', function(){
+ if (!saving && dirty) {
+ return ("<?=gettext('You have moved one or more NPt mappings but have not yet saved')?>");
+ } else {
+ return undefined;
}
});
});
diff --git a/src/usr/local/www/firewall_nat_npt_edit.php b/src/usr/local/www/firewall_nat_npt_edit.php
index 6adbbcf..249159e 100644
--- a/src/usr/local/www/firewall_nat_npt_edit.php
+++ b/src/usr/local/www/firewall_nat_npt_edit.php
@@ -63,20 +63,6 @@
require_once("ipsec.inc");
-function natnptcmp($a, $b) {
- return ipcmp($a['external'], $b['external']);
-}
-
-function nat_npt_rules_sort() {
- global $g, $config;
-
- if (!is_array($config['nat']['npt'])) {
- return;
- }
-
- usort($config['nat']['npt'], "natnptcmp");
-}
-
require("guiconfig.inc");
require_once("interfaces.inc");
require_once("filter.inc");
@@ -102,6 +88,16 @@ if (isset($_POST['id']) && is_numericint($_POST['id'])) {
$id = $_POST['id'];
}
+$after = $_GET['after'];
+if (isset($_POST['after'])) {
+ $after = $_POST['after'];
+}
+
+if (isset($_GET['dup'])) {
+ $id = $_GET['dup'];
+ $after = $_GET['dup'];
+}
+
if (isset($id) && $a_npt[$id]) {
$pconfig['disabled'] = isset($a_npt[$id]['disabled']);
@@ -118,12 +114,14 @@ if (isset($id) && $a_npt[$id]) {
$pconfig['interface'] = "wan";
}
- $pconfig['external'] = $a_npt[$id]['external'];
$pconfig['descr'] = $a_npt[$id]['descr'];
} else {
$pconfig['interface'] = "wan";
}
+if (isset($_GET['dup'])) {
+ unset($id);
+}
if ($_POST) {
@@ -161,9 +159,12 @@ if ($_POST) {
if (isset($id) && $a_npt[$id]) {
$a_npt[$id] = $natent;
} else {
- $a_npt[] = $natent;
+ if (is_numeric($after)) {
+ array_splice($a_npt, $after+1, 0, array($natent));
+ } else {
+ $a_npt[] = $natent;
+ }
}
- nat_npt_rules_sort();
if (write_config()) {
mark_subsystem_dirty('natconf');
@@ -185,24 +186,24 @@ function build_if_list() {
if ($config['l2tp']['mode'] == "server") {
if (have_ruleint_access("l2tp")) {
- $interfaces['l2tp'] = "L2TP VPN";
+ $interfaces['l2tp'] = gettext("L2TP VPN");
}
}
if ($config['pppoe']['mode'] == "server") {
if (have_ruleint_access("pppoe")) {
- $interfaces['pppoe'] = "PPPoE Server";
+ $interfaces['pppoe'] = gettext("PPPoE Server");
}
}
/* add ipsec interfaces */
if (ipsec_enabled() && have_ruleint_access("enc0")) {
- $interfaces["enc0"] = "IPsec";
+ $interfaces["enc0"] = gettext("IPsec");
}
/* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
- $interfaces["openvpn"] = "OpenVPN";
+ $interfaces["openvpn"] = gettext("OpenVPN");
}
return($interfaces);
diff --git a/src/usr/local/www/firewall_nat_out.php b/src/usr/local/www/firewall_nat_out.php
index 5b51d2d..b0ee432 100644
--- a/src/usr/local/www/firewall_nat_out.php
+++ b/src/usr/local/www/firewall_nat_out.php
@@ -244,7 +244,8 @@ if ($savemsg) {
}
if (is_subsystem_dirty('natconf')) {
- print_info_box_np(gettext("The NAT configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext('The NAT configuration has been changed.') . '<br />' .
+ gettext('You must apply the changes in order for them to take effect.'));
}
$tab_array = array();
@@ -300,7 +301,7 @@ print($form);
<form action="firewall_nat_out.php" method="post" name="iform">
<div class="panel panel-default">
- <div class="panel-heading"><?=gettext('Mappings')?></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Mappings')?></h2></div>
<div class="panel-body table-responsive">
<table class="table table-hover table-striped table-condensed">
<thead>
@@ -326,8 +327,12 @@ print($form);
foreach ($a_out as $natent):
$iconfn = "pass";
$textss = $textse = "";
+ $trclass = '';
+
if ($mode == "disabled" || $mode == "automatic" || isset($natent['disabled'])) {
$iconfn .= "_d";
+ $trclass = 'class="disabled"';
+
}
@@ -339,7 +344,7 @@ print($form);
);
?>
- <tr id="fr<?=$i;?>" onClick="fr_toggle(<?=$i;?>)" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$i;?>';">
+ <tr id="fr<?=$i;?>" <?=$trclass?> onClick="fr_toggle(<?=$i;?>)" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$i;?>';">
<td >
<input type="checkbox" id="frc<?=$i;?>" onClick="fr_toggle(<?=$i;?>)" name="rule[]" value="<?=$i;?>"/>
</td>
@@ -353,7 +358,7 @@ print($form);
else:
?>
<a href="?act=toggle&amp;id=<?=$i?>">
- <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-hidden"?>" title="<?=gettext("Click to toggle enabled/disabled status")?>"></i>
+ <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-times"?>" title="<?=gettext("Click to toggle enabled/disabled status")?>"></i>
</a>
<?php
@@ -529,7 +534,7 @@ print($form);
<i class="fa fa-trash icon-embed-btn"></i>
<?=gettext("Delete"); ?>
</button>
- <button type="submit" id="order-store" class="btn btn-primary btn-sm" value="Save changes" disabled name="order-store" title="<?=gettext('Save map order')?>">
+ <button type="submit" id="order-store" class="btn btn-primary btn-sm" value="Save changes" disabled name="order-store" title="<?=gettext('Save mapping order')?>">
<i class="fa fa-save icon-embed-btn"></i>
<?=gettext("Save")?>
</button>
@@ -549,7 +554,7 @@ if ($mode == "automatic" || $mode == "hybrid"):
unset($FilterIflist, $GatewaysList);
?>
<div class="panel panel-default">
- <div class="panel-heading"><?=gettext("Automatic rules:")?></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Automatic rules:")?></h2></div>
<div class="panel-body table-responsive">
<table class="table table-hover table-striped table-condensed">
<thead>
@@ -660,7 +665,7 @@ endif;
</div>
</form>
-<div id="infoblock">
+<div class="infoblock">
<?php
print_info_box(gettext('If automatic outbound NAT is selected, a mapping is automatically generated for each interface\'s subnet (except WAN-type connections) and the rules ' .
'on the "Mappings" section of this page are ignored.' . '<br />' .
@@ -670,7 +675,7 @@ endif;
'If disable outbound NAT is selected, no rules will be used.' . '<br />' .
'If a target address other than an interface\'s IP address is used, then depending on the way the WAN connection is setup, a ') .
'<a href="firewall_virtual_ip.php">' . gettext("Virtual IP") . '</a>' . gettext(" may also be required."),
- info);
+ 'info', false);
?>
</div>
@@ -683,12 +688,29 @@ events.push(function() {
cursor: 'grabbing',
update: function(event, ui) {
$('#order-store').removeAttr('disabled');
+ dirty = true;
}
});
// Check all of the rule checkboxes so that their values are posted
$('#order-store').click(function () {
$('[id^=frc]').prop('checked', true);
+
+ // Suppress the "Do you really want to leave the page" message
+ saving = true;
+ });
+
+ // Globals
+ saving = false;
+ dirty = false;
+
+ // provide a warning message if the user tries to change page before saving
+ $(window).bind('beforeunload', function(){
+ if (!saving && dirty) {
+ return ("<?=gettext('You have moved one or more NAT outbound mappings but have not yet saved')?>");
+ } else {
+ return undefined;
+ }
});
});
//]]>
diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php
index 0836d4e..4983331 100644
--- a/src/usr/local/www/firewall_nat_out_edit.php
+++ b/src/usr/local/www/firewall_nat_out_edit.php
@@ -397,7 +397,7 @@ function build_target_list() {
global $config, $sn, $a_aliases;
$list = array();
- $list[""] = 'Interface Address';
+ $list[""] = gettext('Interface Address');
if (is_array($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $sn) {
@@ -427,10 +427,10 @@ function build_target_list() {
continue;
}
- $list[$alias['name']] = 'Host Alias: ' . $alias['name'] . ' (' . $alias['descr'] . ')';
+ $list[$alias['name']] = gettext('Host Alias: ') . $alias['name'] . ' (' . $alias['descr'] . ')';
}
- $list['other-subnet'] = 'Other Subnet (Enter Below)';
+ $list['other-subnet'] = gettext('Other Subnet (Enter Below)');
return($list);
}
@@ -510,14 +510,14 @@ $group->add(new Form_Select(
'source_type',
null,
(($pconfig['source'] == "any") || ($pconfig['source'] == "(self)")) ? $pconfig['source'] : "network",
- array('any' => 'Any', '(self)' => 'This Firewall (self)', 'network' => 'Network')
+ array('any' => gettext('Any'), '(self)' => gettext('This Firewall (self)'), 'network' => gettext('Network'))
))->setHelp('Type')->setWidth('3');
$group->add(new Form_IpAddress(
'source',
null,
$pconfig['source']
-))->addMask('source_subnet', $pconfig['source_subnet'])->setHelp('Source network for the outbound NAT mapping.')->setPattern('[0-9, a-z, A-Z and .');
+))->addMask('source_subnet', $pconfig['source_subnet'])->setHelp('Source network for the outbound NAT mapping.')->setPattern('[a-zA-Z0-9\_\.\:]+');
$group->add(new Form_Input(
'sourceport',
@@ -534,14 +534,14 @@ $group->add(new Form_Select(
'destination_type',
null,
$pconfig['destination'] == "any" ? "any":"network",
- array('any' => 'Any', 'network' => 'Network')
+ array('any' => gettext('Any'), 'network' => gettext('Network'))
))->setHelp('Type')->setWidth('3');
$group->add(new Form_IpAddress(
'destination',
null,
$pconfig['destination'] == "any" ? "":$pconfig['destination']
-))->addMask('destination_subnet', $pconfig['destination_subnet'])->setHelp('Destination network for the outbound NAT mapping.')->setPattern('[0-9, a-z, A-Z and .');
+))->addMask('destination_subnet', $pconfig['destination_subnet'])->setHelp('Destination network for the outbound NAT mapping.')->setPattern('[a-zA-Z0-9\_\.\:]+');
$group->add(new Form_Input(
'dstport',
@@ -587,22 +587,22 @@ $section->addInput(new Form_Select(
'Pool options',
$pconfig['poolopts'],
array(
- '' => 'Default',
- 'round-robin' => 'Round Robin',
- 'round-robin sticky-address' => 'Round Robin with Sticky Address',
- 'random' => 'Random',
- 'random sticky-address' => 'Random with Sticky Address',
- 'source-hash' => 'Source hash',
- 'bitmask' => 'Bit mask'
+ '' => gettext('Default'),
+ 'round-robin' => gettext('Round Robin'),
+ 'round-robin sticky-address' => gettext('Round Robin with Sticky Address'),
+ 'random' => gettext('Random'),
+ 'random sticky-address' => gettext('Random with Sticky Address'),
+ 'source-hash' => gettext('Source hash'),
+ 'bitmask' => gettext('Bit mask')
)
))->setHelp('Only Round Robin types work with Host Aliases. Any type can be used with a Subnet.' . '<br />' .
- '<ul>' .
- '<li>' . 'Round Robin: Loops through the translation addresses.' . '</li>' . '<br />' .
- '<li>' . 'Random: Selects an address from the translation address pool at random.' . '</li>' . '<br />' .
- '<li>' . 'Source Hash: Uses a hash of the source address to determine the translation address, ensuring that the redirection address is always the same for a given source.' . '</li>' . '<br />' .
- '<li>' . 'Bitmask: Applies the subnet mask and keeps the last portion identical; 10.0.1.50 -&gt; x.x.x.50.' . '</li>' . '<br />' .
+ '</span><ul class="help-block">' .
+ '<li>' . 'Round Robin: Loops through the translation addresses.' . '</li>' .
+ '<li>' . 'Random: Selects an address from the translation address pool at random.' . '</li>' .
+ '<li>' . 'Source Hash: Uses a hash of the source address to determine the translation address, ensuring that the redirection address is always the same for a given source.' . '</li>' .
+ '<li>' . 'Bitmask: Applies the subnet mask and keeps the last portion identical; 10.0.1.50 -&gt; x.x.x.50.' . '</li>' .
'<li>' . 'Sticky Address: The Sticky Address option can be used with the Random and Round Robin pool types to ensure that a particular source address is always mapped to the same translation address.' . '</li>' .
- '</ul>');
+ '</ul><span class="help-block">');
$group = new Form_Group('Port');
$group->addClass('natportgrp');
diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php
index 5cc9ea4..556a4c1 100644
--- a/src/usr/local/www/firewall_rules.php
+++ b/src/usr/local/www/firewall_rules.php
@@ -72,6 +72,51 @@ require_once("shaper.inc");
$pgtitle = array(gettext("Firewall"), gettext("Rules"));
$shortcut_section = "firewall";
+function get_pf_rules($rules, $tracker) {
+
+ if ($rules == NULL || !is_array($rules))
+ return (NULL);
+
+ $arr = array();
+ for ($i = 0; $i < count($rules); $i++) {
+ if ($rules[$i]['tracker'] === $tracker)
+ $arr[] = $rules[$i];
+ }
+
+ if (count($arr) == 0)
+ return (NULL);
+
+ return ($arr);
+}
+
+function print_states($tracker) {
+ global $rulescnt;
+
+ $rulesid = "";
+ $bytes = 0;
+ $states = 0;
+ $packets = 0;
+ $evaluations = 0;
+ $stcreations = 0;
+ $rules = get_pf_rules($rulescnt, $tracker);
+ for ($j = 0; is_array($rules) && $j < count($rules); $j++) {
+ $bytes += $rules[$j]['bytes'];
+ $states += $rules[$j]['states'];
+ $packets += $rules[$j]['packets'];
+ $evaluations += $rules[$j]['evaluations'];
+ $stcreations += $rules[$j]['state creations'];
+ if (strlen($rulesid) > 0)
+ $rulesid .= ",";
+ $rulesid .= "{$rules[$j]['id']}";
+ }
+ printf("<a href=\"diag_dump_states.php?ruleid=%s\" data-toggle=\"popover\" data-trigger=\"hover focus\" title=\"%s\" ",
+ $rulesid, gettext("States details"));
+ printf("data-content=\"evaluations: %s<br>packets: %s<br>bytes: %s<br>states: %s<br>state creations: %s\" data-html=\"true\">",
+ format_number($evaluations), format_number($packets), format_bytes($bytes),
+ format_number($states), format_number($stcreations));
+ printf("%d/%s</a><br>", format_number($states), format_bytes($bytes));
+}
+
function delete_nat_association($id) {
global $config;
@@ -120,26 +165,26 @@ foreach ($ifdescs as $ifent => $ifdesc) {
if ($config['l2tp']['mode'] == "server") {
if (have_ruleint_access("l2tp")) {
- $iflist['l2tp'] = "L2TP VPN";
+ $iflist['l2tp'] = gettext("L2TP VPN");
}
}
if (is_array($config['pppoes']['pppoe'])) {
foreach ($config['pppoes']['pppoe'] as $pppoes) {
if (($pppoes['mode'] == 'server') && have_ruleint_access("pppoe")) {
- $iflist['pppoe'] = "PPPoE Server";
+ $iflist['pppoe'] = gettext("PPPoE Server");
}
}
}
/* add ipsec interfaces */
if (ipsec_enabled() && have_ruleint_access("enc0")) {
- $iflist["enc0"] = "IPsec";
+ $iflist["enc0"] = gettext("IPsec");
}
/* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
- $iflist["openvpn"] = "OpenVPN";
+ $iflist["openvpn"] = gettext("OpenVPN");
}
if (!$if || !isset($iflist[$if])) {
@@ -174,6 +219,17 @@ if ($_GET['act'] == "del") {
delete_nat_association($a_filter[$_GET['id']]['associated-rule-id']);
}
unset($a_filter[$_GET['id']]);
+
+ // Update the separators
+ $a_separators = &$config['filter']['separator'][$if];
+
+ for ($idx=0; isset($a_separators['sep' . $idx]); $idx++ ) {
+ $seprow = substr($a_separators['sep' . $idx]['row']['0'], 2);
+ if ($seprow >= $_GET['id']) {
+ $a_separators['sep' . $idx]['row']['0'] = 'fr' . ($seprow - 1);
+ }
+ }
+
if (write_config()) {
mark_subsystem_dirty('filter');
}
@@ -193,10 +249,20 @@ if (isset($_POST['del_x'])) {
$deleted = false;
if (is_array($_POST['rule']) && count($_POST['rule'])) {
+ $a_separators = &$config['filter']['separator'][$if];
+
foreach ($_POST['rule'] as $rulei) {
delete_nat_association($a_filter[$rulei]['associated-rule-id']);
unset($a_filter[$rulei]);
$deleted = true;
+
+ // Update the separators
+ for ($idx=0; isset($a_separators['sep' . $idx]); $idx++ ) {
+ $seprow = substr($a_separators['sep' . $idx]['row']['0'], 2);
+ if ($seprow >= $rulei) {
+ $a_separators['sep' . $idx]['row']['0'] = 'fr' . ($seprow - 1);
+ }
+ }
}
if ($deleted) {
@@ -223,6 +289,7 @@ if (isset($_POST['del_x'])) {
exit;
}
} else if ($_POST['order-store']) {
+
/* update rule order, POST[rule] is an array of ordered IDs */
if (is_array($_POST['rule']) && !empty($_POST['rule'])) {
$a_filter_new = array();
@@ -233,6 +300,16 @@ if (isset($_POST['del_x'])) {
}
$a_filter = $a_filter_new;
+
+ $config['filter']['separator'][strtolower($if)] = "";
+
+ if ($_POST['separator']) {
+ $idx = 0;
+ foreach ($_POST['separator'] as $separator) {
+ $config['filter']['separator'][strtolower($separator['if'])]['sep' . $idx++] = $separator;
+ }
+ }
+
if (write_config()) {
mark_subsystem_dirty('filter');
}
@@ -266,22 +343,47 @@ if ($savemsg) {
}
if (is_subsystem_dirty('filter')) {
- print_info_box_np(gettext("The firewall rule configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."), "apply", "", true);
+ print_apply_box(gettext("The firewall rule configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
display_top_tabs($tab_array);
+$showantilockout = false;
+$showprivate = false;
+$showblockbogons = false;
+
+if (!isset($config['system']['webgui']['noantilockout']) &&
+ (((count($config['interfaces']) > 1) && ($if == 'lan')) ||
+ ((count($config['interfaces']) == 1) && ($if == 'wan')))) {
+ $showantilockout = true;
+}
+
+if (isset($config['interfaces'][$if]['blockpriv'])) {
+ $showprivate = true;
+}
+
+if (isset($config['interfaces'][$if]['blockbogons'])) {
+ $showblockbogons = true;
+}
+
+/* Load the counter data of each pf rule. */
+$rulescnt = pfSense_get_pf_rules();
+
+// Update this if you add or remove columns!
+$columns_in_table = 13;
+
?>
<form method="post">
<div class="panel panel-default">
- <div class="panel-heading"><?=gettext("Rules (Drag to change order)")?></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Rules (Drag to change order)")?></h2></div>
<div id="mainarea" class="table-responsive panel-body">
- <table name="ruletable" class="table table-hover table-striped table-condensed">
+ <table id="ruletable" class="table table-hover table-striped table-condensed">
<thead>
<tr>
<th><!-- checkbox --></th>
<th><!-- status icons --></th>
- <th><?=gettext("Proto")?></th>
+ <th><?=gettext("States")?></th>
+ <th><?=gettext("Protocol")?></th>
<th><?=gettext("Source")?></th>
<th><?=gettext("Port")?></th>
<th><?=gettext("Destination")?></th>
@@ -293,17 +395,19 @@ display_top_tabs($tab_array);
<th><?=gettext("Actions")?></th>
</tr>
</thead>
+
+<?php if ($showblockbogons || $showantilockout || $showprivate) :
+?>
<tbody>
<?php
// Show the anti-lockout rule if it's enabled, and we are on LAN with an if count > 1, or WAN with an if count of 1.
- if (!isset($config['system']['webgui']['noantilockout']) &&
- (((count($config['interfaces']) > 1) && ($if == 'lan')) ||
- ((count($config['interfaces']) == 1) && ($if == 'wan')))):
- $alports = implode('<br />', filter_get_antilockout_ports(true));
+ if ($showantilockout):
+ $alports = implode('<br />', filter_get_antilockout_ports(true));
?>
- <tr id="antilockout" class="hover-success">
+ <tr id="antilockout">
<td></td>
<td title="<?=gettext("traffic is passed")?>"><i class="fa fa-check text-success"></i></td>
+ <td><?php print_states(intval(ANTILOCKOUT_TRACKER)); ?></td>
<td>*</td>
<td>*</td>
<td>*</td>
@@ -312,16 +416,17 @@ display_top_tabs($tab_array);
<td>*</td>
<td>*</td>
<td></td>
- <td class="bg-info"><?=gettext("Anti-Lockout Rule");?></td>
+ <td><?=gettext("Anti-Lockout Rule");?></td>
<td>
<a href="system_advanced_admin.php" title="<?=gettext("Settings");?>"><i class="fa fa-cog"></i></a>
</td>
</tr>
-<?php endif;?>
-<?php if (isset($config['interfaces'][$if]['blockpriv'])): ?>
- <tr id="frrfc1918" class="hover-danger">
+<?php endif;?>
+<?php if ($showprivate): ?>
+ <tr id="frrfc1918">
<td></td>
<td title="<?=gettext("traffic is blocked")?>"><i class="fa fa-times text-danger"></i></td>
+ <td><?php print_states(intval(RFC1918_TRACKER)); ?></td>
<td>*</td>
<td><?=gettext("RFC 1918 networks");?></td>
<td>*</td>
@@ -330,35 +435,47 @@ display_top_tabs($tab_array);
<td>*</td>
<td>*</td>
<td></td>
- <td class="bg-info"><?=gettext("Block private networks");?></td>
+ <td><?=gettext("Block private networks");?></td>
<td>
<a href="interfaces.php?if=<?=htmlspecialchars($if)?>" title="<?=gettext("Settings");?>"><i class="fa fa-cog"></i></a>
</td>
</tr>
-<?php endif;?>
-<?php if (isset($config['interfaces'][$if]['blockbogons'])): ?>
- <tr id="frrfc1918" class="hover-danger">
- <td></td>
+<?php endif;?>
+<?php if ($showblockbogons): ?>
+ <tr id="frrfc1918">
+ <td></td>
<td title="<?=gettext("traffic is blocked")?>"><i class="fa fa-times text-danger"></i></td>
+ <td><?php print_states(intval(BOGONS_TRACKER)); ?></td>
<td>*</td>
- <td><?=gettext("Reserved/not assigned by IANA");?></td>
+ <td><?=sprintf(gettext("Reserved%sNot assigned by IANA"), "<br />");?></td>
<td>*</td>
<td>*</td>
<td>*</td>
<td>*</td>
<td>*</td>
<td></td>
- <td class="bg-info"><?=gettext("Block bogon networks");?></td>
+ <td><?=gettext("Block bogon networks");?></td>
<td>
<a href="interfaces.php?if=<?=htmlspecialchars($if)?>" title="<?=gettext("Settings");?>"><i class="fa fa-cog"></i></a>
</td>
</tr>
-<?php endif;?>
+<?php endif;?>
</tbody>
-
+<?php endif;?>
<tbody class="user-entries">
<?php
$nrules = 0;
+$seps = 0;
+
+// There can be a separator before any rules are listed
+if ($config['filter']['separator'][strtolower($if)]['sep0']['row'][0] == "fr-1") {
+ $cellcolor = $config['filter']['separator'][strtolower($if)]['sep0']['color'];
+ print('<tr class="ui-sortable-handle separator">' .
+ '<td class="' . $cellcolor . '" colspan="' . ($columns_in_table -1) . '">' . '<span class="' . $cellcolor . '">' . $config['filter']['separator'][strtolower($if)]['sep0']['text'] . '</span></td>' .
+ '<td class="' . $cellcolor . '"><a href="#"><i class="fa fa-trash no-confirm sepdel" title="delete this separator"></i></a></td>' .
+ '</tr>' . "\n");
+}
+
for ($i = 0; isset($a_filter[$i]); $i++):
$filterent = $a_filter[$i];
@@ -367,9 +484,10 @@ for ($i = 0; isset($a_filter[$i]); $i++):
} else {
$display = "";
}
+
?>
<tr id="fr<?=$nrules;?>" <?=$display?> onClick="fr_toggle(<?=$nrules;?>)" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';" <?=(isset($filterent['disabled']) ? ' class="disabled"' : '')?>>
- <td >
+ <td>
<input type="checkbox" id="frc<?=$nrules;?>" onClick="fr_toggle(<?=$nrules;?>)" name="rule[]" value="<?=$i;?>"/>
</td>
@@ -517,8 +635,8 @@ for ($i = 0; isset($a_filter[$i]); $i++):
#FIXME
$sched_caption_escaped = str_replace("'", "\'", $schedule['descr']);
$schedule_span_begin = '<a href="/firewall_schedule_edit.php?id=' . $idx . '" data-toggle="popover" data-trigger="hover focus" title="' . $schedule['name'] . '" data-content="' .
- $sched_caption_escaped . '" data-html="true">';
- $schedule_span_end = "";
+ $sched_caption_escaped . '" data-html="true">';
+ $schedule_span_end = "</a>";
}
}
$idx++;
@@ -528,7 +646,7 @@ for ($i = 0; isset($a_filter[$i]); $i++):
$image = "";
if (!isset($filterent['disabled'])) {
if ($schedstatus) {
- if ($iconfn == "block" || $iconfn == "reject") {
+ if ($filterent['type'] == "block" || $filterent['type'] == "reject") {
$image = "times-circle";
$dispcolor = "text-danger";
$alttext = gettext("Traffic matching this rule is currently being denied");
@@ -539,17 +657,18 @@ for ($i = 0; isset($a_filter[$i]); $i++):
}
$printicon = true;
} else if ($filterent['sched']) {
- if ($iconfn == "block" || $iconfn == "reject") {
+ if ($filterent['type'] == "block" || $filterent['type'] == "reject") {
$image = "times-circle";
} else {
- $image = "times-circle";
+ $image = "play-circle";
}
$alttext = gettext("This rule is not currently active because its period has expired");
- $dispcolor = "text-danger";
+ $dispcolor = "text-warning";
$printicon = true;
}
}
?>
+ <td><?php print_states(intval($filterent['tracker'])); ?></td>
<td>
<?php
if (isset($filterent['ipprotocol'])) {
@@ -572,7 +691,7 @@ for ($i = 0; isset($a_filter[$i]); $i++):
echo strtoupper($filterent['protocol']);
if (strtoupper($filterent['protocol']) == "ICMP" && !empty($filterent['icmptype'])) {
- echo ' <span style="cursor: help;" title="ICMP type: ' .
+ echo ' <span style="cursor: help;" title="' . gettext('ICMP type') . ': ' .
($filterent['ipprotocol'] == "inet6" ? $icmp6types[$filterent['icmptype']] : $icmptypes[$filterent['icmptype']]) .
'"><u>';
echo $filterent['icmptype'];
@@ -584,27 +703,39 @@ for ($i = 0; isset($a_filter[$i]); $i++):
</td>
<td>
<?php if (isset($alias['src'])): ?>
- <a href="/firewall_aliases_edit.php?id=<?=$alias['src']?>" data-toggle="popover" data-trigger="hover focus" title="Alias details" data-content="<?=alias_info_popup($alias['src'])?>" data-html="true">
+ <a href="/firewall_aliases_edit.php?id=<?=$alias['src']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['src'])?>" data-html="true">
+ <?=htmlspecialchars(pprint_address($filterent['source']))?>
+ </a>
+ <?php else: ?>
+ <?=htmlspecialchars(pprint_address($filterent['source']))?>
<?php endif; ?>
- <?=htmlspecialchars(pprint_address($filterent['source']))?>
</td>
<td>
<?php if (isset($alias['srcport'])): ?>
- <a href="/firewall_aliases_edit.php?id=<?=$alias['srcport']?>" data-toggle="popover" data-trigger="hover focus" title="Alias details" data-content="<?=alias_info_popup($alias['srcport'])?>" data-html="true">
+ <a href="/firewall_aliases_edit.php?id=<?=$alias['srcport']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['srcport'])?>" data-html="true">
+ <?=htmlspecialchars(pprint_port($filterent['source']['port']))?>
+ </a>
+ <?php else: ?>
+ <?=htmlspecialchars(pprint_port($filterent['source']['port']))?>
<?php endif; ?>
- <?=htmlspecialchars(pprint_port($filterent['source']['port']))?>
</td>
<td>
<?php if (isset($alias['dst'])): ?>
- <a href="/firewall_aliases_edit.php?id=<?=$alias['dst']?>" data-toggle="popover" data-trigger="hover focus" title="Alias details" data-content="<?=alias_info_popup($alias['dst'])?>" data-html="true">
+ <a href="/firewall_aliases_edit.php?id=<?=$alias['dst']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['dst'])?>" data-html="true">
+ <?=htmlspecialchars(pprint_address($filterent['destination']))?>
+ </a>
+ <?php else: ?>
+ <?=htmlspecialchars(pprint_address($filterent['destination']))?>
<?php endif; ?>
- <?=htmlspecialchars(pprint_address($filterent['destination']))?>
</td>
<td>
<?php if (isset($alias['dstport'])): ?>
- <a href="/firewall_aliases_edit.php?id=<?=$alias['dstport']?>" data-toggle="popover" data-trigger="hover focus" title="Alias details" data-content="<?=alias_info_popup($alias['dstport'])?>" data-html="true">
+ <a href="/firewall_aliases_edit.php?id=<?=$alias['dstport']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['dstport'])?>" data-html="true">
+ <?=htmlspecialchars(pprint_port($filterent['destination']['port']))?>
+ </a>
+ <?php else: ?>
+ <?=htmlspecialchars(pprint_port($filterent['destination']['port']))?>
<?php endif; ?>
- <?=htmlspecialchars(pprint_port($filterent['destination']['port']))?>
</td>
<td>
<?php if (isset($config['interfaces'][$filterent['gateway']]['descr'])):?>
@@ -630,11 +761,11 @@ for ($i = 0; isset($a_filter[$i]); $i++):
</td>
<td>
<?php if ($printicon) { ?>
- <i class="fa fa-<?=$image?> <?=$dispcolor?>" title="<?=$alttext;?>" alt="icon"></i>
+ <i class="fa fa-<?=$image?> <?=$dispcolor?>" title="<?=$alttext;?>"></i>
<?php } ?>
<?=$schedule_span_begin;?><?=htmlspecialchars($filterent['sched']);?>&nbsp;<?=$schedule_span_end;?>
</td>
- <td class="bg-info">
+ <td>
<?=htmlspecialchars($filterent['descr']);?>
</td>
<td class="action-icons">
@@ -649,10 +780,22 @@ for ($i = 0; isset($a_filter[$i]); $i++):
<a href="?act=toggle&amp;if=<?=htmlspecialchars($if);?>&amp;id=<?=$i;?>" class="fa fa-ban" title="<?=gettext('Disable')?>"></a>
<?php }
?>
- <a href="?act=del&amp;if=<?=htmlspecialchars($if);?>&amp;id=<?=$i;?>" class="fa fa-trash" title="<?=gettext('Delete')?>"></a>
+ <a href="?act=del&amp;if=<?=htmlspecialchars($if);?>&amp;id=<?=$i;?>" class="fa fa-trash" title="<?=gettext('Delete this rule')?>"></a>
</td>
</tr>
<?php
+ if (isset($config['filter']['separator'][strtolower($if)]['sep0'])) {
+ foreach ($config['filter']['separator'][strtolower($if)] as $rulesep) {
+ if ($rulesep['row']['0'] == "fr" . $nrules) {
+ $cellcolor = $rulesep['color'];
+ print('<tr class="ui-sortable-handle separator">' .
+ '<td class="' . $cellcolor . '" colspan="' . ($columns_in_table -1) . '">' . '<span class="' . $cellcolor . '">' . $rulesep['text'] . '</span></td>' .
+ '<td class="' . $cellcolor . '"><a href="#"><i class="fa fa-trash no-confirm sepdel" title="delete this separator"></i></a></td>' .
+ '</tr>' . "\n");
+ }
+ }
+ }
+
$nrules++;
endfor;
?>
@@ -692,11 +835,15 @@ for ($i = 0; isset($a_filter[$i]); $i++):
<i class="fa fa-save icon-embed-btn"></i>
<?=gettext("Save")?>
</button>
+ <button type="submit" id="addsep" name="addsep" class="btn btn-sm btn-warning" title="<?=gettext('Add separator')?>">
+ <i class="fa fa-plus icon-embed-btn"></i>
+ <?=gettext("Separator")?>
+ </button>
</nav>
</form>
-<div id="infoblock">
- <div class="alert alert-info clearfix" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><div class="pull-left">
+<div class="infoblock">
+ <div class="alert alert-info clearfix" role="alert"><div class="pull-left">
<dl class="dl-horizontal responsive">
<!-- Legend -->
<dt><?=gettext('Legend')?></dt> <dd></dd>
@@ -724,24 +871,56 @@ for ($i = 0; isset($a_filter[$i]); $i++):
}
?>
</div>
+ </div>
</div>
<script type="text/javascript">
//<![CDATA[
+
+//Need to create some variables here so that jquery/pfSenseHelpers.js can read them
+iface = "<?=strtolower($if)?>";
+cncltxt = '<?=gettext("Cancel")?>';
+svtxt = '<?=gettext("Save")?>';
+svbtnplaceholder = '<?=gettext("Enter a description, Save, then drag to final location.")?>';
+configsection = "filter";
+
events.push(function() {
- // Make rules sortable
+ // Make rules sortable. Hiding the table before applying sortable, then showing it again is
+ // a work-around for very slow sorting on FireFox
+ $('table tbody.user-entries').hide();
+
$('table tbody.user-entries').sortable({
cursor: 'grabbing',
update: function(event, ui) {
$('#order-store').removeAttr('disabled');
+ reindex_rules(ui.item.parent('tbody'));
+ dirty = true;
}
});
+ $('table tbody.user-entries').show();
+
// Check all of the rule checkboxes so that their values are posted
$('#order-store').click(function () {
- $('[id^=frc]').prop('checked', true);
+ $('[id^=frc]').prop('checked', true);
+
+ // Save the separator bar configuration
+ save_separators();
+
+ // Suppress the "Do you really want to leave the page" message
+ saving = true;
+ });
+
+ // provide a warning message if the user tries to change page before saving
+ $(window).bind('beforeunload', function(){
+ if ((!saving && dirty) || newSeperator) {
+ return ("<?=gettext('You have moved one or more rules but have not yet saved')?>");
+ } else {
+ return undefined;
+ }
});
+
});
//]]>
</script>
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php
index 4c64853..ba692bb 100644
--- a/src/usr/local/www/firewall_rules_edit.php
+++ b/src/usr/local/www/firewall_rules_edit.php
@@ -429,10 +429,10 @@ if ($_POST) {
$reqdfields[] = "src";
$reqdfields[] = "dst";
}
- $reqdfieldsn = explode(",", "Type,Protocol");
+ $reqdfieldsn = array(gettext("Type"), gettext("Protocol"));
if (isset($a_filter[$id]['associated-rule-id']) === false) {
- $reqdfieldsn[] = "Source";
- $reqdfieldsn[] = "Destination";
+ $reqdfieldsn[] = gettext("Source");
+ $reqdfieldsn[] = gettext("Destination");
}
if ($_POST['statetype'] == "modulate state" or $_POST['statetype'] == "synproxy state") {
@@ -447,7 +447,7 @@ if ($_POST) {
if (isset($a_filter[$id]['associated-rule-id']) === false &&
(!(is_specialnet($_POST['srctype']) || ($_POST['srctype'] == "single")))) {
$reqdfields[] = "srcmask";
- $reqdfieldsn[] = "Source bit count";
+ $reqdfieldsn[] = gettext("Source bit count");
}
if (isset($a_filter[$id]['associated-rule-id']) === false &&
(!(is_specialnet($_POST['dsttype']) || ($_POST['dsttype'] == "single")))) {
@@ -645,22 +645,22 @@ if ($_POST) {
if ($_POST['statetype'] == "none") {
if (!empty($_POST['max'])) {
- $input_errors[] = gettext("You cannot specify the maximum state entries (advanced option) if statetype is none and no L7 container is selected.");
+ $input_errors[] = gettext("You cannot specify the maximum state entries (advanced option) if statetype is none.");
}
if (!empty($_POST['max-src-nodes'])) {
- $input_errors[] = gettext("You cannot specify the maximum number of unique source hosts (advanced option) if statetype is none and no L7 container is selected.");
+ $input_errors[] = gettext("You cannot specify the maximum number of unique source hosts (advanced option) if statetype is none.");
}
if (!empty($_POST['max-src-conn'])) {
- $input_errors[] = gettext("You cannot specify the maximum number of established connections per host (advanced option) if statetype is none and no L7 container is selected.");
+ $input_errors[] = gettext("You cannot specify the maximum number of established connections per host (advanced option) if statetype is none.");
}
if (!empty($_POST['max-src-states'])) {
- $input_errors[] = gettext("You cannot specify the maximum state entries per host (advanced option) if statetype is none and no L7 container is selected.");
+ $input_errors[] = gettext("You cannot specify the maximum state entries per host (advanced option) if statetype is none.");
}
if (!empty($_POST['max-src-conn-rate']) || !empty($_POST['max-src-conn-rates'])) {
- $input_errors[] = gettext("You cannot specify the maximum new connections per host / per second(s) (advanced option) if statetype is none and no L7 container is selected.");
+ $input_errors[] = gettext("You cannot specify the maximum new connections per host / per second(s) (advanced option) if statetype is none.");
}
if (!empty($_POST['statetimeout'])) {
- $input_errors[] = gettext("You cannot specify the state timeout (advanced option) if statetype is none and no L7 container is selected.");
+ $input_errors[] = gettext("You cannot specify the state timeout (advanced option) if statetype is none.");
}
}
@@ -911,6 +911,18 @@ if ($_POST) {
$filterent['created'] = make_config_revision_entry();
if (is_numeric($after)) {
array_splice($a_filter, $after+1, 0, array($filterent));
+
+ // Update the separators
+ $a_separators = &$config['filter']['separator'][$if];
+
+ for ($idx=0; isset($a_separators['sep' . $idx]); $idx++ ) {
+ $seprow = substr($a_separators['sep' . $idx]['row']['0'], 2);
+
+ // If the separator is located after the place where the new rule is to go, increment the separator row
+ if ($seprow > $after) {
+ $a_separators['sep' . $idx]['row']['0'] = 'fr' . ($seprow + 1);
+ }
+ }
} else {
$a_filter[] = $filterent;
}
@@ -939,8 +951,8 @@ function build_flag_table() {
$setflags = explode(",", $pconfig['tcpflags1']);
$outofflags = explode(",", $pconfig['tcpflags2']);
$header = "<td></td>";
- $tcpflags1 = "<td>set</td>";
- $tcpflags2 = "<td>out of</td>";
+ $tcpflags1 = "<td>" . gettext("set") . "</td>";
+ $tcpflags2 = "<td>" . gettext("out of") . "</td>";
foreach ($tcpflags as $tcpflag) {
$header .= "<td><strong>" . strtoupper($tcpflag) . "</strong></td>\n";
@@ -966,7 +978,7 @@ function build_flag_table() {
$flagtable .= "</table>";
$flagtable .= '<input type="checkbox" name="tcpflags_any" id="tcpflags_any" value="on"';
- $flagtable .= $pconfig['tcpflags_any'] ? 'checked':'' . '/>';
+ $flagtable .= ($pconfig['tcpflags_any'] ? 'checked':'') . '/>';
$flagtable .= '<strong>' . gettext(" Any flags.") . '</strong>';
return($flagtable);
@@ -993,21 +1005,21 @@ function build_if_list() {
}
if ($config['l2tp']['mode'] == "server" && have_ruleint_access("l2tp")) {
- $iflist['l2tp'] = 'L2TP VPN';
+ $iflist['l2tp'] = gettext('L2TP VPN');
}
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
- $iflist['pppoe'] = "PPPoE Server";
+ $iflist['pppoe'] = gettext("PPPoE Server");
}
// add ipsec interfaces
if (ipsec_enabled() && have_ruleint_access("enc0")) {
- $iflist["enc0"] = "IPsec";
+ $iflist["enc0"] = gettext("IPsec");
}
// add openvpn/tun interfaces
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
- $iflist["openvpn"] = "OpenVPN";
+ $iflist["openvpn"] = gettext("OpenVPN");
}
return($iflist);
@@ -1062,13 +1074,13 @@ $form->addGlobal(new Form_Input(
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/htmlphpearly");
$values = array(
- 'pass' => 'Pass',
- 'block' => 'Block',
- 'reject' => 'Reject',
+ 'pass' => gettext('Pass'),
+ 'block' => gettext('Block'),
+ 'reject' => gettext('Reject'),
);
if ($if == "FloatingRules" || isset($pconfig['floating'])) {
- $values['match'] = 'Match';
+ $values['match'] = gettext('Match');
}
$section->addInput(new Form_Select(
@@ -1159,9 +1171,9 @@ if ($if == "FloatingRules" || isset($pconfig['floating'])) {
'Direction',
$pconfig['direction'],
array(
- 'any' => 'any',
- 'in' => 'in',
- 'out' => 'out',
+ 'any' => gettext('any'),
+ 'in' => gettext('in'),
+ 'out' => gettext('out'),
)
));
@@ -1201,7 +1213,7 @@ $section->addInput(new Form_Select(
'pim' => 'PIM',
'ospf' => 'OSPF',
'sctp' => 'SCTP',
- 'any' => 'any',
+ 'any' => gettext('any'),
'carp' => 'CARP',
'pfsync' => 'PFSYNC',
)
@@ -1252,23 +1264,23 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) {
}
$ruleValues = array(
- 'any' => 'any',
- 'single' => 'Single host or alias',
- 'network' => 'Network',
+ 'any' => gettext('any'),
+ 'single' => gettext('Single host or alias'),
+ 'network' => gettext('Network'),
);
- if($type == 'dst') {
- $ruleValues['(self)'] = "This firewall (self)";
+ if ($type == 'dst') {
+ $ruleValues['(self)'] = gettext("This firewall (self)");
}
if (isset($a_filter[$id]['floating']) || $if == "FloatingRules") {
- $ruleValues['(self)'] = 'This Firewall (self)';
+ $ruleValues['(self)'] = gettext('This Firewall (self)');
}
if (have_ruleint_access("pppoe")) {
- $ruleValues['pppoe'] = 'PPPoE clients';
+ $ruleValues['pppoe'] = gettext('PPPoE clients');
}
if (have_ruleint_access("l2tp")) {
- $ruleValues['l2tp'] = 'L2TP clients';
+ $ruleValues['l2tp'] = gettext('L2TP clients');
}
foreach ($ifdisp as $ifent => $ifdesc) {
@@ -1291,7 +1303,7 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) {
$type,
$name .' Address',
$pconfig[$type]
- ))->addMask($type .'mask', $pconfig[$type.'mask'])->setPattern('[0-9, a-z, A-Z and .');
+ ))->addMask($type .'mask', $pconfig[$type.'mask'])->setPattern('[a-zA-Z0-9\_\.\:]+');
$section->add($group);
@@ -1302,7 +1314,7 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) {
))->removeClass('btn-primary');
}
- $portValues = ['' => '(other)', 'any' => 'any'];
+ $portValues = ['' => gettext('(other)'), 'any' => gettext('any')];
foreach ($wkports as $port => $portName) {
$portValues[$port] = $portName.' ('. $port .')';
@@ -1399,7 +1411,7 @@ $section->addInput(new Form_Select(
'os',
'Source OS',
(empty($pconfig['os']) ? '':$pconfig['os']),
- ['' => 'Any'] + array_combine($ostypes, $ostypes)
+ ['' => gettext('Any')] + array_combine($ostypes, $ostypes)
))->setHelp('Note: this only works for TCP rules. General OS choice matches all subtypes.');
$section->addInput(new Form_Select(
@@ -1505,12 +1517,12 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_Select(
'statetype',
'State type',
- (isset($pconfig['statetype'])) ? "keep state":$pconfig['statetype'],
+ (isset($pconfig['statetype'])) ? $pconfig['statetype'] : "keep state",
array(
- 'keep state' => 'Keep',
- 'sloppy state' => 'Sloppy',
- 'synproxy state' => 'Synproxy',
- 'none' => 'None',
+ 'keep state' => gettext('Keep'),
+ 'sloppy state' => gettext('Sloppy'),
+ 'synproxy state' => gettext('Synproxy'),
+ 'none' => gettext('None'),
)
))->setHelp('Select which type of state tracking mechanism you would like to use. If in doubt, use keep state' . '<br />' .
'<span></span>');
@@ -1549,10 +1561,10 @@ $section->addInput(new Form_Select(
'sched',
'Schedule',
$pconfig['sched'],
- ['' => 'none'] + array_combine($schedules, $schedules)
+ ['' => gettext('none')] + array_combine($schedules, $schedules)
))->setHelp('Leave as \'none\' to leave the rule enabled all the time');
-$gateways = array("" => 'default');
+$gateways = array("" => gettext('default'));
foreach (return_gateways_array() as $gwname => $gw) {
if (($pconfig['ipprotocol'] == "inet46")) {
continue;
@@ -1590,14 +1602,14 @@ $group->add(new Form_Select(
'dnpipe',
'DNpipe',
(isset($pconfig['dnpipe'])) ? $pconfig['dnpipe']:"",
- array('' => 'none') + array_combine(array_keys($dnqlist), array_keys($dnqlist))
+ array('' => gettext('none')) + array_combine(array_keys($dnqlist), array_keys($dnqlist))
));
$group->add(new Form_Select(
'pdnpipe',
'PDNpipe',
(isset($pconfig['pdnpipe'])) ? $pconfig['pdnpipe']:"",
- array('' => 'none') + array_combine(array_keys($dnqlist), array_keys($dnqlist))
+ array('' => gettext('none')) + array_combine(array_keys($dnqlist), array_keys($dnqlist))
));
$section->add($group)->setHelp('Choose the Out queue/Virtual interface only if '.
@@ -1678,6 +1690,7 @@ events.push(function() {
var srcportsvisible = 0;
function ext_change() {
+
if (($('#srcbeginport').find(":selected").index() == 0) && portsenabled && editenabled) {
disableInput('srcbeginport_cust', false);
} else {
@@ -1874,6 +1887,10 @@ events.push(function() {
ext_change();
});
+ $('#save').on('click', function() {
+ disableInput('save');
+ });
+
$('#dstbeginport').on('change', function() {
dst_rep_change();
ext_change();
@@ -1937,6 +1954,18 @@ events.push(function() {
setHelpText(target, dispstr);
}
+ // When editing "associated" rules, everything except the enable, action, address family and desscription
+ // fields are disabled
+ function disable_most(disable) {
+ var elementsToDisable = [
+ 'interface', 'proto', 'icmptype', 'icmp6type', 'srcnot', 'srctype', 'src', 'srcmask', 'srcbebinport', 'srcbeginport_cust', 'srcendport',
+ 'srcendport_cust', 'dstnot', 'dsttype', 'dst', 'dstmask', 'dstbeginport', 'dstbeginport_cust', 'dstendport', 'dstendport_cust'];
+
+ for (var idx=0, len = elementsToDisable.length; idx<len; idx++) {
+ disableInput(elementsToDisable[idx], disable);
+ }
+ }
+
// ---------- Click checkbox handlers ---------------------------------------------------------
$('#statetype').on('change', function() {
@@ -1946,6 +1975,12 @@ events.push(function() {
// ---------- On initial page load ------------------------------------------------------------
setOptText('statetype', $('#statetype').val())
+<?php if ($edit_disabled) {
+?>
+ disable_most(true);
+<?php
+}
+?>
// ---------- Autocomplete --------------------------------------------------------------------
diff --git a/src/usr/local/www/firewall_schedule.php b/src/usr/local/www/firewall_schedule.php
index c057b0a..c44a53a 100644
--- a/src/usr/local/www/firewall_schedule.php
+++ b/src/usr/local/www/firewall_schedule.php
@@ -126,7 +126,7 @@ if ($savemsg) {
<th><?=gettext("Name")?></th>
<th><?=gettext("Range: Date / Times / Name")?></th>
<th><?=gettext("Description")?></th>
- <th><!--Buttons--></th>
+ <th><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody>
@@ -279,8 +279,8 @@ endforeach;
</a>
</nav>
-<div id="infoblock">
- <?=print_info_box(gettext('Schedules act as placeholders for time ranges to be used in Firewall Rules.'), info)?>
+<div class="infoblock">
+ <?=print_info_box(gettext('Schedules act as placeholders for time ranges to be used in Firewall Rules.'), 'info', false)?>
</div>
<?php
diff --git a/src/usr/local/www/firewall_schedule_edit.php b/src/usr/local/www/firewall_schedule_edit.php
index c40f4fc..93c7f91 100644
--- a/src/usr/local/www/firewall_schedule_edit.php
+++ b/src/usr/local/www/firewall_schedule_edit.php
@@ -130,7 +130,7 @@ if ($_POST) {
$input_errors[] = gettext("Reserved word used for schedule name.");
} else {
if (is_validaliasname($_POST['name']) == false) {
- $input_errors[] = gettext("The schedule name may only consist of the characters a-z, A-Z, 0-9");
+ $input_errors[] = sprintf(gettext("The schedule name must be less than 32 characters long, may not consist of only numbers, may not consist of only underscores, and may only contain the following characters: %s"), 'a-z, A-Z, 0-9, _');
}
}
@@ -286,8 +286,8 @@ function build_date_table() {
$mostr .= '" class="col-md-6">';
$mostr .=
- '<table class="table table-condensed" border="1" cellspacing="1" cellpadding="1" id="calTable' . $monthcounter . $yearcounter . '" >
- <thead><tr class="info"><td colspan="7" align="center" ><b>' . date("F_Y", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter))) . '</b></td>
+ '<table class="table table-condensed table-bordered" id="calTable' . $monthcounter . $yearcounter . '" >
+ <thead><tr class="info"><td colspan="7" class="text-center"><b>' . date("F_Y", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter))) . '</b></td>
</tr>
<tr>
<th class="text-center" style="cursor: pointer;" onclick="daytoggle(\'w1p1\');">' . gettext("Mon") . '</th>
@@ -325,7 +325,14 @@ function build_date_table() {
$mostr .= '<td class="text-center"></td>';
}
- if ($positioncounter == 7 || $daycounter > $numberofdays) {
+ if ($daycounter > $numberofdays) {
+ while ($positioncounter < 7) {
+ $mostr .= '<td class="text-center"></td>';
+ $positioncounter++;
+ }
+ }
+
+ if ($positioncounter == 7) {
$positioncounter = 1;
$mostr .= "</tr>";
} else {
@@ -388,7 +395,7 @@ $input = new Form_Input(
$pconfig['name']
);
-$input->setHelp((is_schedule_inuse($pconfig['name']) != true) ? 'The name of the alias may only consist of the characters a-z, A-Z and 0-9':
+$input->setHelp((is_schedule_inuse($pconfig['name']) != true) ? 'The name of the schedule may only consist of the characters "a-z, A-Z, 0-9 and _".':
'This schedule is in use so the name may not be modified!');
if (is_schedule_inuse($pconfig['name']) == true) {
@@ -429,7 +436,7 @@ $group->add(new Form_Select(
'starttimemin',
null,
null,
- array('00' => '00', '15' => '15', '30' => '30', '59' => '59')
+ array('00' => '00', '15' => '15', '30' => '30', '45' => '45', '59' => '59')
))->setHelp('Start Mins');
$group->add(new Form_Select(
@@ -443,7 +450,7 @@ $group->add(new Form_Select(
'stoptimemin',
null,
'59',
- array('00' => '00', '15' => '15', '30' => '30', '59' => '59')
+ array('00' => '00', '15' => '15', '30' => '30', '45' => '45', '59' => '59')
))->setHelp('Stop Mins');
$group->setHelp('Select the time range for the day(s) selected on the Month(s) above. A full day is 0:00-23:59.');
@@ -701,7 +708,7 @@ events.push(function() {
$('[id^=Delete]').prop('type', 'button');
$('[id^=Delete]').click(function(event) {
- delete_row(event.target.id.slice(6));
+ fse_delete_row(event.target.id.slice(6));
});
});
//]]>
@@ -1170,7 +1177,7 @@ function insertElements(tempFriendlyTime, starttimehour, starttimemin, stoptimeh
$(rowhtml.replace(/@/g, counter)).insertBefore(node);
$('[id^=delete]').click(function(event) {
- delete_row(event.target.id.slice(6));
+ fse_delete_row(event.target.id.slice(6));
});
counter++;
@@ -1184,7 +1191,7 @@ function insertElements(tempFriendlyTime, starttimehour, starttimemin, stoptimeh
}
// If only everything were this simple
-function delete_row(row) {
+function fse_delete_row(row) {
$('.schedulegrp' + row).remove();
}
//]]>
diff --git a/src/usr/local/www/firewall_shaper.php b/src/usr/local/www/firewall_shaper.php
index a4e35f7..837d200 100644
--- a/src/usr/local/www/firewall_shaper.php
+++ b/src/usr/local/www/firewall_shaper.php
@@ -157,15 +157,17 @@ if ($_GET) {
if (write_config()) {
$retval = 0;
$retval |= filter_configure();
- $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true) {
$savemsg = get_std_save_message($retval);
+ $class = 'success';
} else {
$savemsg = $retval;
+ $class = 'warning';
}
} else {
$savemsg = gettext("Unable to write config.xml (Access Denied?)");
+ $class = 'warning';
}
$dfltmsg = true;
@@ -198,7 +200,7 @@ if ($_GET) {
} else if ($addnewaltq) {
$q = new altq_root_queue();
} else {
- $input_errors[] = gettext("Could not create new queue/discipline!");
+ $input_errors[] = gettext("Could not create new queue/discipline! Did you remember to apply any recent changes?");
}
if ($q) {
@@ -336,12 +338,13 @@ if ($_POST) {
$retval = 0;
$retval = filter_configure();
- $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true) {
$savemsg = get_std_save_message($retval);
+ $class = 'success';
} else {
$savemsg = $retval;
+ $class = 'warning';
}
/* reset rrd queues */
@@ -423,11 +426,11 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg, 'success');
+ print_info_box($savemsg, $class);
}
if (is_subsystem_dirty('shaper')) {
- print_info_box_np(gettext("The traffic shaper configuration has been changed. You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The traffic shaper configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -461,7 +464,7 @@ if (count($altq_list_queues) > 0) {
<td>
<?php
-if (!$dfltmsg) {
+if (!$dfltmsg && $sform) {
// Add global buttons
if (!$dontshow || $newqueue) {
if ($can_add || $addnewaltq) {
@@ -506,8 +509,8 @@ if (!$dfltmsg) {
if ($dfltmsg) {
?>
<div>
- <div id="infoblock">
- <?=print_info_box($default_shaper_msg, info)?>
+ <div class="infoblock">
+ <?=print_info_box($default_shaper_msg, 'info', false)?>
</div>
</div>
<?php
diff --git a/src/usr/local/www/firewall_shaper_queues.php b/src/usr/local/www/firewall_shaper_queues.php
index 7cd5b1f..9e751c9 100644
--- a/src/usr/local/www/firewall_shaper_queues.php
+++ b/src/usr/local/www/firewall_shaper_queues.php
@@ -204,8 +204,10 @@ if ($_POST['apply']) {
$savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true) {
$savemsg = get_std_save_message($retval);
+ $class = 'alert-success';
} else {
$savemsg = $retval;
+ $class = 'alert-danger';
}
/* reset rrd queues */
@@ -230,11 +232,11 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, $class);
}
if (is_subsystem_dirty('shaper')) {
- print_info_box_np(gettext("The traffic shaper configuration has been changed. You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The traffic shaper configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -248,7 +250,7 @@ display_top_tabs($tab_array);
<form action="firewall_shaper_queues.php" method="post" name="iform" id="iform">
<div class="panel panel-default">
- <div class="panel-heading" align="center"><h2 class="panel-title"><?=$qname?></h2></div>
+ <div class="panel-heading text-center"><h2 class="panel-title"><?=$qname?></h2></div>
<div class="panel-body">
<div class="form-group">
<div class="col-sm-2 ">
@@ -263,5 +265,5 @@ display_top_tabs($tab_array);
</form>
<?php
-
include("foot.inc");
+?>
diff --git a/src/usr/local/www/firewall_shaper_vinterface.php b/src/usr/local/www/firewall_shaper_vinterface.php
index bbcdbd0..ccea421 100644
--- a/src/usr/local/www/firewall_shaper_vinterface.php
+++ b/src/usr/local/www/firewall_shaper_vinterface.php
@@ -140,7 +140,7 @@ if ($_GET) {
header("Location: firewall_shaper_vinterface.php");
exit;
}
- $output_form .= $queue->build_form();
+ $sform= $queue->build_form();
} else {
$input_errors[] = sprintf(gettext("No queue with name %s was found!"), $qname);
$output_form .= $dn_default_shaper_msg;
@@ -170,27 +170,27 @@ if ($_GET) {
if (write_config()) {
$retval = 0;
$retval = filter_configure();
- $savemsg = get_std_save_message($retval);
- if (stristr($retval, "error") != true) {
- $savemsg = get_std_save_message($retval);
+ if (stristr($retval, "error") != true) {
+ $savemsg = get_std_save_message($retval);
+ $class = 'success';
+ } else {
+ $savemsg = $retval;
+ $class = 'danger';
+ }
+
} else {
- $savemsg = $retval;
+ $savemsg = gettext("Unable to write config.xml (Access Denied?)");
+ $class = 'danger';
}
- } else {
- $savemsg = gettext("Unable to write config.xml (Access Denied?)");
- }
-
- $dfltmsg = true;
+ $dfltmsg = true;
break;
case "add":
if ($dnpipe) {
$q = new dnqueue_class();
$q->SetPipe($pipe);
- $output_form .= "<input type=\"hidden\" name=\"parentqueue\" id=\"parentqueue\"";
- $output_form .= " value=\"".$pipe."\" />";
} else if ($addnewpipe) {
$q = new dnpipe_class();
$q->SetQname($pipe);
@@ -200,10 +200,19 @@ if ($_GET) {
if ($q) {
$sform = $q->build_form();
+ if ($dnpipe) {
+ $sform->addGlobal(new Form_Input(
+ 'parentqueue',
+ null,
+ 'hidden',
+ $pipe
+ ));
+ }
$newjavascript = $q->build_javascript();
unset($q);
$newqueue = true;
}
+
break;
case "show":
if ($queue) {
@@ -298,12 +307,13 @@ if ($_POST) {
$retval = 0;
$retval = filter_configure();
- $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") != true) {
$savemsg = get_std_save_message($retval);
+ $class = 'success';
} else {
$savemsg = $retval;
+ $class = 'danger';
}
/* XXX: TODO Make dummynet pretty graphs */
@@ -394,11 +404,11 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg, 'success');
+ print_info_box($savemsg, $class);
}
if (is_subsystem_dirty('shaper')) {
- print_info_box_np(gettext("The traffic shaper configuration has been changed. You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The traffic shaper configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -408,7 +418,6 @@ $tab_array[] = array(gettext("Limiter"), true, "firewall_shaper_vinterface.php")
$tab_array[] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php");
display_top_tabs($tab_array);
?>
-
<div class="table-responsive">
<table class="table">
<tbody>
@@ -423,15 +432,15 @@ display_top_tabs($tab_array);
<?php
if ($dfltmsg) {
- print_info_box($dn_default_shaper_msg);
+ print_info_box($dn_default_shaper_msg, 'info');
} else {
// Add global buttons
if (!$dontshow || $newqueue) {
- if ($can_add || $addnewaltq) {
+ if ($can_add && ($action != "add")) {
if ($queue) {
- $url = 'href="firewall_shaper_vinterface.php?pipe=' . $pipe . '&queue=' . $queue->GetQname() . '&action=add';
+ $url = 'firewall_shaper_vinterface.php?pipe=' . $pipe . '&queue=' . $queue->GetQname() . '&action=add';
} else {
- $url = 'firewall_shaper.php?pipe='. $pipe . '&action=add';
+ $url = 'firewall_shaper_vinterface.php?pipe='. $pipe . '&action=add';
}
$sform->addGlobal(new Form_Button(
@@ -441,21 +450,26 @@ if ($dfltmsg) {
))->removeClass('btn-default')->addClass('btn-success');
}
- if ($queue) {
- $url = 'firewall_shaper_vinterface.php?pipe='. $pipe . '&queue=' . $queue->GetQname() . '&action=delete';
- } else {
- $url = 'firewall_shaper_vinterface.php?pipe='. $pipe . '&action=delete';
- }
+ if ($action != "add") {
+ if ($queue) {
+ $url = 'firewall_shaper_vinterface.php?pipe='. $pipe . '&queue=' . $queue->GetQname() . '&action=delete';
+ } else {
+ $url = 'firewall_shaper_vinterface.php?pipe='. $pipe . '&action=delete';
+ }
- $sform->addGlobal(new Form_Button(
- 'delete',
- $queue ? 'Delete this queue':'Delete',
- $url
- ))->removeClass('btn-default')->addClass('btn-danger');
+ $sform->addGlobal(new Form_Button(
+ 'delete',
+ ($queue && ($qname != $pipe)) ? 'Delete this queue':'Delete Limiter',
+ $url
+ ))->removeClass('btn-default')->addClass('btn-danger');
+ }
}
// Print the form
- print($sform);
+ if ($sform) {
+ $sform->setAction("firewall_shaper_vinterface.php");
+ print($sform);
+ }
}
?>
@@ -475,8 +489,8 @@ events.push(function() {
}
function change_masks() {
- disableInput('maskbits', ($('#scheduler').val() == 'none'));
- disableInput('maskbitsv6', ($('#scheduler').val() == 'none'));
+ disableInput('maskbits', ($('#mask').val() == 'none'));
+ disableInput('maskbitsv6', ($('#mask').val() == 'none'));
}
// ---------- On initial page load ------------------------------------------------------------
@@ -485,7 +499,7 @@ events.push(function() {
// ---------- Click checkbox handlers ---------------------------------------------------------
- $('#scheduler').on('change', function() {
+ $('#mask').on('change', function() {
change_masks();
});
});
diff --git a/src/usr/local/www/firewall_shaper_wizards.php b/src/usr/local/www/firewall_shaper_wizards.php
index fec62a2..b1e8eb2 100644
--- a/src/usr/local/www/firewall_shaper_wizards.php
+++ b/src/usr/local/www/firewall_shaper_wizards.php
@@ -77,11 +77,12 @@ if ($_POST['apply']) {
$retval = 0;
/* Setup pf rules since the user may have changed the optimization value */
$retval = filter_configure();
- $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true) {
$savemsg = get_std_save_message($retval);
+ $class = 'success';
} else {
$savemsg = $retval;
+ $class = 'warning';
}
/* reset rrd queues */
@@ -114,11 +115,11 @@ $tab_array[] = array(gettext("Wizards"), true, "firewall_shaper_wizards.php");
display_top_tabs($tab_array);
if ($savemsg) {
- print_info_box($savemsg, 'success');
+ print_info_box($savemsg, $class);
}
if (is_subsystem_dirty('shaper')) {
- print_info_box_np(gettext("The traffic shaper configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The traffic shaper configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
?>
diff --git a/src/usr/local/www/firewall_virtual_ip.php b/src/usr/local/www/firewall_virtual_ip.php
index 59ac887..964ba69 100644
--- a/src/usr/local/www/firewall_virtual_ip.php
+++ b/src/usr/local/www/firewall_virtual_ip.php
@@ -217,13 +217,13 @@ if ($_GET['act'] == "del") {
}
if ($found_carp === true && $found_other_alias === false && $found_if === false) {
- $input_errors[] = gettext("This entry cannot be deleted because it is still referenced by a CARP IP with the description") . " {$vip['descr']}.";
+ $input_errors[] = sprintf(gettext("This entry cannot be deleted because it is still referenced by a CARP IP with the description %s."), $vip['descr']);
}
} else if ($a_vip[$_GET['id']]['mode'] == "carp") {
$vipiface = "{$a_vip[$_GET['id']]['interface']}_vip{$a_vip[$_GET['id']]['vhid']}";
foreach ($a_vip as $vip) {
if ($vipiface == $vip['interface'] && $vip['mode'] == "ipalias") {
- $input_errors[] = gettext("This entry cannot be deleted because it is still referenced by an IP alias entry with the description") . " {$vip['descr']}.";
+ $input_errors[] = sprintf(gettext("This entry cannot be deleted because it is still referenced by an IP alias entry with the description %s."), $vip['descr']);
}
}
}
@@ -262,10 +262,10 @@ if ($_GET['act'] == "del") {
$id = $_GET['id'];
}
-$types = array('proxyarp' => 'Proxy ARP',
- 'carp' => 'CARP',
- 'other' => 'Other',
- 'ipalias' => 'IP Alias'
+$types = array('proxyarp' => gettext('Proxy ARP'),
+ 'carp' => gettext('CARP'),
+ 'other' => gettext('Other'),
+ 'ipalias' => gettext('IP Alias')
);
$pgtitle = array(gettext("Firewall"), gettext("Virtual IP Addresses"));
@@ -276,7 +276,7 @@ if ($input_errors) {
} else if ($savemsg) {
print_info_box($savemsg, 'success');
} else if (is_subsystem_dirty('vip')) {
- print_info_box_np(gettext("The VIP configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The VIP configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
/* active tabs
@@ -296,7 +296,7 @@ display_top_tabs($tab_array);
<th><?=gettext("Interface")?></th>
<th><?=gettext("Type")?></th>
<th><?=gettext("Description")?></th>
- <th><!--Buttons--></th>
+ <th><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody>
@@ -364,9 +364,9 @@ endforeach;
</a>
</nav>
-<div id="infoblock">
- <?=print_info_box(gettext('The virtual IP addresses defined on this page may be used in ') . '<a href="firewall_nat.php">' . gettext('NAT') . '</a>' . gettext(' mappings.') . '<br />' .
- gettext('You can check the status of your CARP Virtual IPs and interfaces ') . '<a href="status_carp.php">' . gettext('here') . '</a>', info)?>
+<div class="infoblock">
+ <?=print_info_box(sprintf(gettext('The virtual IP addresses defined on this page may be used in %1$sNAT%2$s mappings'), '<a href="firewall_nat.php">', '</a>') . '<br />' .
+ sprintf(gettext('You can check the status of your CARP Virtual IPs and interfaces %1$shere%2$s'), '<a href="status_carp.php">', '</a>'), 'info', false)?>
</div>
<?php
diff --git a/src/usr/local/www/firewall_virtual_ip_edit.php b/src/usr/local/www/firewall_virtual_ip_edit.php
index 0e379bc..f459813 100644
--- a/src/usr/local/www/firewall_virtual_ip_edit.php
+++ b/src/usr/local/www/firewall_virtual_ip_edit.php
@@ -176,7 +176,7 @@ if ($_POST) {
/* ipalias and carp should not use network or broadcast address */
if ($_POST['mode'] == "ipalias" || $_POST['mode'] == "carp") {
- if (is_ipaddrv4($_POST['subnet']) && $_POST['subnet_bits'] != "32") {
+ if (is_ipaddrv4($_POST['subnet']) && $_POST['subnet_bits'] != "32" && $_POST['subnet_bits'] != "31") {
$network_addr = gen_subnet($_POST['subnet'], $_POST['subnet_bits']);
$broadcast_addr = gen_subnet_max($_POST['subnet'], $_POST['subnet_bits']);
} else if (is_ipaddrv6($_POST['subnet']) && $_POST['subnet_bits'] != "128") {
@@ -200,7 +200,7 @@ if ($_POST) {
$idtracker = 0;
foreach ($config['virtualip']['vip'] as $vip) {
if ($vip['vhid'] == $_POST['vhid'] && $vip['interface'] == $_POST['interface'] && $idtracker != $id) {
- $input_errors[] = sprintf(gettext("VHID %s is already in use on interface %s. Pick a unique number on this interface."), $_POST['vhid'], convert_friendly_interface_to_friendly_descr($_POST['interface']));
+ $input_errors[] = sprintf(gettext("VHID %1$s is already in use on interface %2$s. Pick a unique number on this interface."), $_POST['vhid'], convert_friendly_interface_to_friendly_descr($_POST['interface']));
}
$idtracker++;
}
@@ -209,6 +209,10 @@ if ($_POST) {
$input_errors[] = gettext("You must specify a CARP password that is shared between the two VHID members.");
}
+ if ($_POST['password'] != $_POST['password_confirm']) {
+ $input_errors[] = gettext("Password and confirm password must match");
+ }
+
if ($_POST['interface'] == 'lo0') {
$input_errors[] = gettext("For this type of vip localhost is not allowed.");
} else if (strpos($_POST['interface'], '_vip')) {
@@ -271,7 +275,12 @@ if ($_POST) {
$vipent['uniqid'] = $_POST['uniqid'];
$vipent['advskew'] = $_POST['advskew'];
$vipent['advbase'] = $_POST['advbase'];
- $vipent['password'] = $_POST['password'];
+
+ if ($_POST['password'] != DMYPWD) {
+ $vipent['password'] = $_POST['password'];
+ } else {
+ $vipent['password'] = $a_vip[$id]['password'];
+ }
}
/* Common fields */
@@ -401,8 +410,8 @@ $section->addInput(new Form_Select(
'Address type',
((!$pconfig['range'] && $pconfig['subnet_bits'] == 32) || (!isset($pconfig['subnet']))) ? 'single':'network',
array(
- 'single' => 'Single address',
- 'network' => 'Network'
+ 'single' => gettext('Single address'),
+ 'network' => gettext('Network')
)
))->addClass('typesel');
@@ -419,7 +428,7 @@ $section->addInput(new Form_Checkbox(
isset($pconfig['noexpand'])
));
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'password',
'Virtual IP Password',
'password',
@@ -480,9 +489,9 @@ $form->add($section);
print($form);
?>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(gettext("Proxy ARP and Other type Virtual IPs cannot be bound to by anything running on the firewall, such as IPsec, OpenVPN, etc. Use a CARP or IP Alias type address for these types.") . '<br />' .
- sprintf(gettext("For more information on CARP and the above values, visit the OpenBSD %s"), '<a href="http://www.openbsd.org/faq/pf/carp.html">CARP FAQ</a>.'), info)?>
+ sprintf(gettext("For more information on CARP and the above values, visit the OpenBSD %s"), '<a href="http://www.openbsd.org/faq/pf/carp.html">CARP FAQ</a>.'), 'info', false)?>
</div>
<script type="text/javascript">
@@ -513,6 +522,7 @@ events.push(function() {
disableInput('subnet_bits', true);
disableInput('type', true);
disableInput('password', true);
+ disableInput('password_confirm', true);
hideCheckbox('noexpand', true);
if (mode == 'ipalias') {
@@ -526,6 +536,7 @@ events.push(function() {
disableInput('advbase', false);
disableInput('advskew', false);
disableInput('password', false);
+ disableInput('password_confirm', false);
disableInput('subnet_bits', false);
$('#type').val('single');
} else if (mode == 'proxyarp') {
diff --git a/src/usr/local/www/foot.inc b/src/usr/local/www/foot.inc
index 4f73507..081cfca 100755
--- a/src/usr/local/www/foot.inc
+++ b/src/usr/local/www/foot.inc
@@ -18,13 +18,12 @@
</div>
</footer>
- <script src="/jquery/jquery-1.11.2.min.js"></script>
- <script src="/jquery/jquery-ui-1.11.2.min.js"></script>
+ <script src="/jquery/jquery-1.12.0.min.js"></script>
+ <script src="/jquery/jquery-ui-1.11.4.min.js"></script>
<script src="/bootstrap/js/bootstrap.min.js"></script>
<script src="/jquery/pfSense.js"></script>
<script src="/jquery/pfSenseHelpers.js"></script>
<script src="/sortable/sortable.js"></script>
-
<script type="text/javascript">
//<![CDATA[
// Un-hide the "Top of page" icons if the page is larger than the window
diff --git a/src/usr/local/www/graph.php b/src/usr/local/www/graph.php
index 0f3f421..4853114 100755
--- a/src/usr/local/www/graph.php
+++ b/src/usr/local/www/graph.php
@@ -115,7 +115,7 @@ $attribs['error']='fill="blue" font-family="Arial" font-size="4"';
$attribs['collect_initial']='fill="gray" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="4"';
//Error text if we cannot fetch data : depends on which method is used
-$error_text = "Cannot get data about interface " . htmlspecialchars($ifnum);
+$error_text = sprintf(gettext("Cannot get data about interface %s"), htmlspecialchars($ifnum));
$height=100; //SVG internal height : do not modify
$width=200; //SVG internal width : do not modify
@@ -144,7 +144,7 @@ print('<?xml version="1.0" encoding="UTF-8"?>' . "\n");?>
<text id="switch_scale" x="<?=$width*0.55?>" y="11" <?=$attribs['switch_scale']?>><?=gettext("AutoScale"); ?> (<?=$scale_type?>)</text>
<text id="date" x="<?=$width*0.33?>" y="5" <?=$attribs['legend']?>> </text>
<text id="time" x="<?=$width*0.33?>" y="11" <?=$attribs['legend']?>> </text>
- <text id="graphlast" x="<?=$width*0.55?>" y="17" <?=$attribs['legend']?>><?=gettext("Graph shows last"); ?> <?=$time_interval*$nb_plot?> <?=gettext("seconds"); ?></text>
+ <text id="graphlast" x="<?=$width*0.55?>" y="17" <?=$attribs['legend']?>><?=sprintf(gettext("Graph shows last %s seconds"), $time_interval*$nb_plot)?></text>
<polygon id="axis_arrow_x" <?=$attribs['axis']?> points="<?=($width) . "," . ($height)?> <?=($width-2) . "," . ($height-2)?> <?=($width-2) . "," . $height?>"/>
<text id="error" x="<?=$width*0.5?>" y="<?=$height*0.5?>" visibility="hidden" <?=$attribs['error']?> text-anchor="middle"><?=$error_text?></text>
<text id="collect_initial" x="<?=$width*0.5?>" y="<?=$height*0.5?>" visibility="hidden" <?=$attribs['collect_initial']?> text-anchor="middle"><?=gettext("Collecting initial data, please wait"); ?>...</text>
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc
index a30696e..175f540 100644
--- a/src/usr/local/www/guiconfig.inc
+++ b/src/usr/local/www/guiconfig.inc
@@ -91,6 +91,12 @@ $navlevelsep = ": "; /* navigation level separator string */
$mandfldhtml = ""; /* display this before mandatory input fields */
$mandfldhtmlspc = ""; /* same as above, but with spacing */
+if (!function_exists('set_language')) {
+ require_once("pfsense-utils.inc");
+}
+
+set_language();
+
/* Some ajax scripts still need access to GUI */
if (!$ignorefirmwarelock) {
if (is_subsystem_dirty('firmwarelock')) {
@@ -151,8 +157,8 @@ $ldap_urltypes = array(
'SSL - Encrypted' => 636);
$ldap_scopes = array(
- 'one' => "One Level",
- 'subtree' => "Entire Subtree");
+ 'one' => gettext("One Level"),
+ 'subtree' => gettext("Entire Subtree"));
$ldap_protvers = array(
2,
@@ -179,9 +185,9 @@ $ldap_templates = array(
'attr_member' => "uniqueMember"));
$radius_srvcs = array(
- 'both' => "Authentication and Accounting",
- 'auth' => "Authentication",
- 'acct' => "Accounting");
+ 'both' => gettext("Authentication and Accounting"),
+ 'auth' => gettext("Authentication"),
+ 'acct' => gettext("Accounting"));
$netbios_nodetypes = array(
'0' => "none",
@@ -240,7 +246,10 @@ $wkports = array(
/* TCP flags */
$tcpflags = array("fin", "syn", "rst", "psh", "ack", "urg", "ece", "cwr");
-$specialnets = array("(self)" => "This Firewall", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients");
+$specialnets = array(
+ "(self)" => gettext("This Firewall"),
+ "pppoe" => gettext("PPPoE clients"),
+ "l2tp" => gettext("L2TP clients"));
$spiflist = get_configured_interface_with_descr(false, true);
foreach ($spiflist as $ifgui => $ifdesc) {
@@ -249,16 +258,16 @@ foreach ($spiflist as $ifgui => $ifdesc) {
}
$medias = array(
- "auto" => "autoselect",
- "100full" => "100BASE-TX full-duplex",
- "100half" => "100BASE-TX half-duplex",
- "10full" => "10BASE-T full-duplex",
- "10half" => "10BASE-T half-duplex");
+ "auto" => gettext("autoselect"),
+ "100full" => gettext("100BASE-TX full-duplex"),
+ "100half" => gettext("100BASE-TX half-duplex"),
+ "10full" => gettext("10BASE-T full-duplex"),
+ "10half" => gettext("10BASE-T half-duplex"));
$wlan_modes = array(
- "bss" => "Infrastructure (BSS)",
- "adhoc" => "Ad-hoc (IBSS)",
- "hostap" => "Access Point");
+ "bss" => gettext("Infrastructure (BSS)"),
+ "adhoc" => gettext("Ad-hoc (IBSS)"),
+ "hostap" => gettext("Access Point"));
function do_input_validation($postdata, $reqdfields, $reqdfieldsn, &$input_errors) {
@@ -298,89 +307,44 @@ function verify_gzip_file($fname) {
}
}
-function print_info_box_np($msg, $name="apply", $value="", $showapply=false, $class="alert-warning") {
- global $g;
+// print_info_box() has been updated so that any required button is explicitly created, rather than relying on the detection of certain
+// strings in the message (such as "apply"). print_info_box_np() has been exterminated.
+// $class = the bootstrap style class (default, info, warning, success, danger)
+// $btnname and btntext describe the optional button and its display text, the default is an 'x' Close button.
+// Note that there is also a shortcut function print_apply_box here that creates a standard "apply" box for you.
+// In many cases just substitute that for print_info_box_np() to easily get a warning style "Apply changes" box.
+function print_info_box($msg, $class="alert-warning", $btnname = "close", $btntext = "") {
if (strpos($class, "alert-") !== 0) {
$class = 'alert-' . $class;
}
- if (empty($value)) {
- $value = gettext("Apply changes");
- }
-
$msg = '<div class="pull-left">' . $msg . '</div>';
- if (stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) {
- $msg .= '<form method="post" class="pull-right"><button type="submit" class="btn btn-default" name="'. $name .'" value="'.$value.'">'.$name.'</button>';
+ if ($btnname === "close") {
+ $msg = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' . $msg;
+ } else if ($btnname != "") {
+ if (empty($btntext)) {
+ $btntext = $btnname;
+ }
+
+ $msg .= '<form method="post" class="pull-right"><button type="submit" class="btn btn-default" name="'. $btnname . '" value="' . $btntext . '">' . $btntext . '</button>';
if ($_POST['if']) {
$msg .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
}
$msg .= '</form>';
- } else {
- $msg = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'. $msg;
- }
-
- echo '<div class="alert ' . $class . ' clearfix" role="alert">'.$msg.'</div>';
-}
-
-function print_info_box_np_undo($msg, $name = "apply", $value = "Apply changes", $undo) {
- global $g;
-
- if (stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) {
- $savebutton = "<td class=\"infoboxsave text-nowrap\">";
- $savebutton .= "<input type=\"button\" value=\"". gettext("Undo") . "\" onclick=\"document.location='{$undo}'\" />";
- $savebutton .= "<input name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\" />";
- $savebutton .= "</td>";
- if ($_POST['if']) {
- $savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
- }
}
- $nifty_redbox = "#990000";
- $nifty_blackbox = "#000000";
-
- if (!$savebutton) {
- $savebutton = "<td class=\"infoboxsave\"><input value=\"" . gettext("Close") . "\" type=\"button\" onclick=\"jQuery(this).parents('table[id=redboxtable]').hide();\" /></td>";
- }
-
- echo <<<EOFnp
- <table class="infobox" id="redboxtable" summary="red box table">
- <tr>
- <td>
- <div class="infoboxnp" id="redbox">
- <table class="infoboxnptable2" summary="message">
- <tr>
- <td class="infoboxnptd">
- &nbsp;&nbsp;&nbsp;<i class="fa fa-exclamation-circle"></i>
- </td>
- <td class="infoboxnptd2">
- <b>{$msg}</b>
- </td>
- {$savebutton}
- {$undobutton}
- </tr>
- </table>
- </div>
- <div>
- <p>&nbsp;</p>
- </div>
- </td>
- </tr>
- </table>
-EOFnp;
-
+ echo '<div class="alert ' . $class . ' clearfix" role="alert">' . $msg . '</div>';
}
-function print_info_box($msg, $class="alert-warning") {
- print_info_box_np($msg, null, null, false, $class);
-
+function print_apply_box($msg) {
+ print_info_box($msg, "warning", "apply", gettext("Apply changes"));
}
function get_std_save_message($ok) {
- global $d_sysrebootreqd_path;
$filter_related = false;
$filter_pages = array("nat", "filter");
$to_return = gettext("The changes have been applied successfully.");
@@ -562,18 +526,23 @@ function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $g
$specific_log = basename($logfile, '.log') . '_settings';
if ($config['syslog'][$specific_log]['cronorder'] == 'forward') $sor = "";
if ($config['syslog'][$specific_log]['cronorder'] == 'reverse') $sor = "-r";
- $logarr = "";
+ $logarr = array();
$grepline = " ";
if (is_array($grepfor)) {
- $grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor));
+ $invert = '';
+ if ((strpos($grepfor[0], '!') === 0)) {
+ $grepfor[0] = substr($grepfor[0], 1);
+ $invert = '-v';
+ }
+ $grepline .= " | /usr/bin/egrep {$invert} " . escapeshellarg(implode("|", $grepfor));
}
if (is_array($grepinvert)) {
$grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert));
}
if (is_dir($logfile)) {
- $logarr = array("File $logfile is a directory.");
+ $logarr = array(sprintf(gettext("File %s is a directory."), $logfile));
} elseif (file_exists($logfile) && filesize($logfile) == 0) {
- $logarr = array("Log file started.");
+ $logarr = array(gettext("Log file started."));
} else {
if ($config['system']['disablesyslogclog']) {
exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
@@ -608,18 +577,23 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert
$specific_log = basename($logfile, '.log') . '_settings';
if ($config['syslog'][$specific_log]['cronorder'] == 'forward') $sor = "";
if ($config['syslog'][$specific_log]['cronorder'] == 'reverse') $sor = "-r";
- $logarr = "";
+ $logarr = array();
$grepline = " ";
if (is_array($grepfor)) {
- $grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor));
+ $invert = '';
+ if ((strpos($grepfor[0], '!') === 0)) {
+ $grepfor[0] = substr($grepfor[0], 1);
+ $invert = '-v';
+ }
+ $grepline .= " | /usr/bin/egrep {$invert} " . escapeshellarg(implode("|", $grepfor));
}
if (is_array($grepinvert)) {
$grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert));
}
if (is_dir($logfile)) {
- $logarr = array("File $logfile is a directory.");
+ $logarr = array(sprintf(gettext("File %s is a directory."), $logfile));
} elseif (file_exists($logfile) && filesize($logfile) == 0) {
- $logarr = array("Log file started.");
+ $logarr = array(gettext("Log file started."));
} else {
if ($config['system']['disablesyslogclog']) {
exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
@@ -653,7 +627,7 @@ function return_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinve
$specific_log = basename($logfile, '.log') . '_settings';
if (($config['syslog'][$specific_log]['cronorder'] == 'forward') && !$grepreverse) $sor = "";
if (($config['syslog'][$specific_log]['cronorder'] == 'reverse') || $grepreverse) $sor = "-r";
- $logarr = "";
+ $logarr = array();
$grepline = " ";
if (is_array($grepfor)) {
$grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor));
@@ -1177,12 +1151,30 @@ function get_flash_message() {
@session_start();
if (isset($_SESSION['flash_messages']) && !empty($_SESSION['flash_messages'])) {
foreach ($_SESSION['flash_messages'] as $class => $flash_message) {
- print_info_box_np(implode("<br />", $flash_message), null, null, false, $class);
+ print_info_box(implode("<br />", $flash_message), $class);
}
unset($_SESSION['flash_messages']);
}
}
+/* Retrieve GET or POST Value/State
+ * Eample Usage:
+ * $value = getGETPOSTsettingvalue('get/post parameter name', "");
+ * $value = getGETPOSTsettingvalue('get/post parameter name', null);
+ * $state = getGETPOSTsettingvalue('get/post parameter name', null);
+ * $state = getGETPOSTsettingvalue('get/post parameter name', false);
+ */
+function getGETPOSTsettingvalue($settingname, $default) {
+ $settingvalue = $default;
+ if ($_GET[$settingname]) {
+ $settingvalue = $_GET[$settingname];
+ }
+ if ($_POST[$settingname]) {
+ $settingvalue = $_POST[$settingname];
+ }
+ return $settingvalue;
+}
+
/* set timezone */
if (isset($config['system']['timezone']) &&
!empty($config['system']['timezone'])) {
diff --git a/src/usr/local/www/head.inc b/src/usr/local/www/head.inc
index c8e99dd..515a6d6 100755
--- a/src/usr/local/www/head.inc
+++ b/src/usr/local/www/head.inc
@@ -125,6 +125,14 @@ if (($pagename == "pkg.php") || ($pagename == "pkg_edit.php") || ($pagename == "
$pagename = $xmlfile[1];
}
}
+} else if ($pagename == "status_logs.php") {
+ $param_split = explode('&', $uri_split[2]);
+ foreach ($param_split as $param) {
+ if (substr($param, 0, 8) == "logfile=") {
+ $logtype = explode('=', $param);
+ $pagename .= '-' . $logtype[1];
+ }
+ }
}
// Build the full help URL.
@@ -461,8 +469,32 @@ if (($pagename === "index.php") && ($numColumns > 2)) {
}
?>
<ul class="context-links">
-<?php
+ <?php if ($dashboard_available_widgets_hidden): ?>
+ <li>
+ <a onclick="$('#widget-available').toggle(360);" title="<?=gettext("Available Widgets")?>">
+ <i style="cursor:pointer" class="fa fa-plus"></i>
+ </a>
+ </li>
+ <?php endif?>
+
+ <?php if ($system_logs_filter_form_hidden): ?>
+ <li>
+ <a onclick="$('#filter-form').toggle(360)" title="<?=gettext("Log Filter")?>">
+ <i style="cursor:pointer" class="fa fa-filter"></i>
+ </a>
+ </li>
+ <?php endif ?>
+
+ <?php if ($system_logs_manage_log_form_hidden): ?>
+ <li>
+ <a onclick="$('#manage-log-form').toggle(360)" title="<?=gettext("Manage Log")?>">
+ <i style="cursor:pointer" class="fa fa-wrench"></i>
+ </a>
+ </li>
+ <?php endif ?>
+
+<?php
if (!$hide_service_status && !empty($shortcuts[$shortcut_section]['service'])) {
$ssvc = array();
switch ($shortcut_section) {
@@ -488,7 +520,7 @@ echo '<li>'. get_shortcut_log_link($shortcut_section, false). '</li>';
?>
<?php if (!$g['disablehelpicon']): ?>
<li>
- <a href="<?=$helpurl?>" title="<?=gettext("Help for items on this page")?>" class="help-icon">
+ <a href="<?=$helpurl?>" target="_blank" title="<?=gettext("Help for items on this page")?>">
<i class="fa fa-question-circle"></i>
</a>
</li>
@@ -499,14 +531,14 @@ echo '<li>'. get_shortcut_log_link($shortcut_section, false). '</li>';
/* if upgrade in progress, alert user */
if (is_subsystem_dirty('packagelock') || file_exists('/conf/needs_package_sync' && platform_booting())) {
if (file_exists('/conf/needs_package_sync') && platform_booting()) {
- $info_text = sprintf(gettext("%s is booting then packages will be reinstalled in the background.<p>Do not make changes in the GUI until this is complete."), $g['product_name']);
+ $warning_text = sprintf(gettext("%s is booting then packages will be reinstalled in the background.<p>Do not make changes in the GUI until this is complete."), $g['product_name']);
} else {
$pgtitle = array(gettext("System"), gettext("Package Manager"));
- $info_text = gettext("Packages are currently being reinstalled in the background.<p>Do not make changes in the GUI until this is complete.");
- $info_text .= gettext("<p>If the above message is still displayed after a couple of hours, use the 'Clear Package Lock' button on the <a href='diag_backup.php' title='Backup/Restore'>Backup/Restore page</a> and reinstall packages manually.");
+ $warning_text = gettext("Packages are currently being reinstalled in the background.<p>Do not make changes in the GUI until this is complete.");
+ $warning_text .= gettext("<p>If the above message is still displayed after a couple of hours, use the 'Clear Package Lock' button on the <a href='diag_backup.php' title='Backup/Restore'>Backup/Restore page</a> and reinstall packages manually.");
}
- print_info_box($info_text);
+ print_info_box($warning_text);
}
$pgtitle_output = true;
@@ -515,7 +547,7 @@ $pgtitle_output = true;
if ($config['remote_managed_pages']['item']) {
foreach ($config['remote_managed_pages']['item'] as $rmp) {
if ($rmp == $_SERVER['SCRIPT_NAME']) {
- print_info_box_np("This page is currently being managed by a remote machine.");
+ print_info_box(gettext("This page is currently being managed by a remote machine."));
include("foot.inc");
exit;
}
@@ -534,7 +566,7 @@ if (are_notices_pending()):?>
<span aria-hidden="true">&times;</span>
</button>
- <h3 class="modal-title" id="myModalLabel">Notices</h3>
+ <h3 class="modal-title" id="myModalLabel"><?=gettext("Notices")?></h3>
</div>
<div class="modal-body">
@@ -573,7 +605,7 @@ if (are_notices_pending()):?>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal"><?=gettext("Close")?></button>
<button type="button" id="clearallnotices" class="btn btn-primary"><?=gettext("Mark all as read")?></button>
</div>
</div>
diff --git a/src/usr/local/www/help.php b/src/usr/local/www/help.php
index 485e33f..723f060 100644
--- a/src/usr/local/www/help.php
+++ b/src/usr/local/www/help.php
@@ -99,18 +99,22 @@ $helppages = array(
'diag_dump_states.php' => 'https://doc.pfsense.org/index.php/Show_States',
'diag_resetstate.php' => 'https://doc.pfsense.org/index.php/Reset_States',
'status_logs.php' => 'https://doc.pfsense.org/index.php/System_Logs',
- 'diag_logs_auth.php' => 'https://doc.pfsense.org/index.php/Captive_Portal_Authentication_Logs',
- 'diag_logs_dhcp.php' => 'https://doc.pfsense.org/index.php/DHCP_Logs',
+ 'status_logs.php-dhcpd' => 'https://doc.pfsense.org/index.php/DHCP_Logs',
+ 'status_logs.php-gateways' => 'https://doc.pfsense.org/index.php/Gateway_Logs',
+ 'status_logs.php-ipsec' => 'https://doc.pfsense.org/index.php/IPsec_Logs',
+ 'status_logs.php-ntpd' => 'https://doc.pfsense.org/index.php/NTP_Logs',
+ 'status_logs.php-openvpn' => 'https://doc.pfsense.org/index.php/OpenVPN_Logs',
+ 'status_logs.php-portalauth' => 'https://doc.pfsense.org/index.php/Captive_Portal_Authentication_Logs',
+ 'status_logs.php-ppp' => 'https://doc.pfsense.org/index.php/PPP_Logs',
+ 'status_logs.php-relayd' => 'https://doc.pfsense.org/index.php/Load_Balancer_Logs',
+ 'status_logs.php-resolver' => 'https://doc.pfsense.org/index.php/Resolver_Logs',
+ 'status_logs.php-routing' => 'https://doc.pfsense.org/index.php/Routing_Logs',
+ 'status_logs.php-wireless' => 'https://doc.pfsense.org/index.php/Wireless_Logs',
'status_logs_filter.php' => 'https://doc.pfsense.org/index.php/Firewall_Logs',
'status_logs_filter_dynamic.php' => 'https://doc.pfsense.org/index.php/Firewall_Logs',
'status_logs_filter_summary.php' => 'https://doc.pfsense.org/index.php/Firewall_Logs',
- 'diag_logs_ntpd.php' => 'https://doc.pfsense.org/index.php/NTP_Logs',
- 'diag_logs_ppp.php' => 'https://doc.pfsense.org/index.php/PPP_Logs',
- 'diag_logs_relayd.php' => 'https://doc.pfsense.org/index.php/Load_Balancer_Logs',
'status_logs_settings.php' => 'https://doc.pfsense.org/index.php/Log_Settings',
'status_logs_vpn.php' => 'https://doc.pfsense.org/index.php/PPTP_VPN_Logs',
- 'diag_logs_ipsec.php' => 'https://doc.pfsense.org/index.php/IPsec_Logs',
- 'diag_logs_openvpn.php' => 'https://doc.pfsense.org/index.php/OpenVPN_Logs',
'diag_nanobsd.php' => 'https://doc.pfsense.org/index.php/NanoBSD_Diagnostics',
'diag_ping.php' => 'https://doc.pfsense.org/index.php/Ping_Host',
'status_pkglogs.php' => 'https://doc.pfsense.org/index.php/Package_Logs',
@@ -240,10 +244,6 @@ $helppages = array(
'system_crlmanager.php' => 'https://doc.pfsense.org/index.php/Certificate_Management',
'crash_reporter.php' => 'https://doc.pfsense.org/index.php/Unexpected_Reboot_Troubleshooting',
'diag_dump_states_sources.php' => 'https://doc.pfsense.org/index.php/Show_Source_Tracking',
- 'diag_logs_gateways.php' => 'https://doc.pfsense.org/index.php/Gateway_Logs',
- 'diag_logs_resolver.php' => 'https://doc.pfsense.org/index.php/Resolver_Logs',
- 'diag_logs_routing.php' => 'https://doc.pfsense.org/index.php/Routing_Logs',
- 'diag_logs_wireless.php' => 'https://doc.pfsense.org/index.php/Wireless_Logs',
'diag_ndp.php' => 'https://doc.pfsense.org/index.php/NDP_Table',
'diag_sockets.php' => 'https://doc.pfsense.org/index.php/Diag_Sockets',
'diag_testport.php' => 'https://doc.pfsense.org/index.php/Test_Port',
diff --git a/src/usr/local/www/includes/functions.inc.php b/src/usr/local/www/includes/functions.inc.php
index b092de7..8431bda 100644
--- a/src/usr/local/www/includes/functions.inc.php
+++ b/src/usr/local/www/includes/functions.inc.php
@@ -1,4 +1,4 @@
-<?
+<?php
/*
functions.inc.php
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php
index 613ba78..55de55e 100644
--- a/src/usr/local/www/index.php
+++ b/src/usr/local/www/index.php
@@ -57,7 +57,7 @@
*/
##|+PRIV
-##|*IDENT=page-system-login/logout
+##|*IDENT=page-system-login-logout
##|*NAME=System: Login / Logout / Dashboard
##|*DESCR=Allow access to the 'System: Login / Logout' page and Dashboard.
##|*MATCH=index.php*
@@ -107,7 +107,8 @@ if ($g['disablecrashreporter'] != true) {
}
if ($x > 0) {
- $savemsg = "{$g['product_name']} has detected a crash report or programming bug. Click <a href='crash_reporter.php'>here</a> for more information.";
+ $savemsg = sprintf(gettext("%s has detected a crash report or programming bug. Click <a href='crash_reporter.php'>here</a> for more information."), $g['product_name']);
+ $class = "warning";
}
}
}
@@ -119,15 +120,15 @@ $dirhandle = opendir($directory);
$filename = "";
while (false !== ($filename = readdir($dirhandle))) {
+ if (!stristr($filename, ".inc")) {
+ continue;
+ }
$phpincludefiles[] = $filename;
}
## Include each widget include file.
## These define vars that specify the widget title and title link.
foreach ($phpincludefiles as $includename) {
- if (!stristr($includename, ".inc")) {
- continue;
- }
if (file_exists($directory . $includename)) {
include($directory . $includename);
}
@@ -139,7 +140,7 @@ foreach (glob("/usr/local/www/widgets/widgets/*.widget.php") as $file) {
// Get the widget title that should be in a var defined in the widget's inc file.
$widgettitle = ${$name . '_title'};
- if ((strlen($widgettitle) == 0)) {
+ if (empty(trim($widgettitle))) {
// Fall back to constructing a title from the file name of the widget.
$widgettitle = ucwords(str_replace('_', ' ', $name));
}
@@ -276,7 +277,7 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") {
// Get the widget title that should be in a var defined in the widget's inc file.
$widgettitle = ${$file . '_title'};
- if ((strlen($widgettitle) == 0)) {
+ if (empty(trim($widgettitle))) {
// Fall back to constructing a title from the file name of the widget.
$widgettitle = ucwords(str_replace('_', ' ', $file));
}
@@ -299,31 +300,49 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") {
}
}
+## Get the configured options for Show/Hide available widgets panel.
+$dashboard_available_widgets_hidden = isset($config['system']['webgui']['dashboardavailablewidgetspanel']) ? false : true;
+
+if ($dashboard_available_widgets_hidden) {
+ $panel_state = 'out';
+ $panel_body_state = 'in';
+} else {
+ $panel_state = 'in';
+ $panel_body_state = 'out';
+}
+
## Set Page Title and Include Header
$pgtitle = array(gettext("Status"), gettext("Dashboard"));
include("head.inc");
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, $class);
}
pfSense_handle_custom_code("/usr/local/pkg/dashboard/pre_dashboard");
?>
-<div class="panel panel-default" id="widget-available">
- <div class="panel-heading"><?=gettext("Available Widgets"); ?>
- <span class="widget-heading-icon">
- <a data-toggle="collapse" href="#widget-available_panel-body" id="widgets-available">
- <i class="fa fa-plus-circle"></i>
- </a>
- </span>
+<div class="panel panel-default collapse <?=$panel_state?>" id="widget-available">
+ <div class="panel-heading">
+ <h2 class="panel-title"><?=gettext("Available Widgets"); ?>
+ <span class="widget-heading-icon">
+ <a data-toggle="collapse" href="#widget-available_panel-body" id="widgets-available">
+ <i class="fa fa-plus-circle"></i>
+ </a>
+ </span>
+ </h2>
</div>
- <div id="widget-available_panel-body" class="panel-body collapse out">
+ <div id="widget-available_panel-body" class="panel-body collapse <?=$panel_body_state?>">
<div class="content">
<div class="row">
<?php
-foreach ($widgets as $widgetname => $widgetconfig):
+
+// Build the Available Widgets table using a sorted copy of the $widgets array
+$available = $widgets;
+uasort($available, function($a, $b){ return strcasecmp($a['name'], $b['name']); });
+
+foreach ($available as $widgetname => $widgetconfig):
if ($widgetconfig['display'] == 'none'):
?>
<div class="col-sm-3"><a href="#" id="btnadd-<?=$widgetname?>"><i class="fa fa-plus"></i> <?=$widgetconfig['name']?></a></div>
@@ -334,33 +353,9 @@ foreach ($widgets as $widgetname => $widgetconfig):
</div>
</div>
-<div class="modal fade">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
- <h4 class="modal-title"><?=gettext("Welcome to the Dashboard page"); ?>!</h4>
- </div>
- <div class="modal-body">
- <p>
- <?=gettext("This page allows you to customize the information you want to be displayed!");?>
- <?=gettext("To get started click the ");?> FIXME <?=gettext(" icon to add widgets.");?><br />
- <br />
- <?=gettext("You can move any widget around by clicking and dragging the title.");?>
- </p>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default btn-primary" data-dismiss="modal">Close</button>
- </div>
- </div>
- </div>
-</div>
-
<div class="hidden" id="widgetSequence">
<form action="/" method="post" id="widgetSequence_form" name="widgetForm">
<input type="hidden" name="sequence" value="" />
-
- <button type="submit" id="btnstore" class="btn btn-primary">Store widget configuration</button>
</form>
</div>
@@ -406,19 +401,21 @@ foreach ($widgets as $widgetname => $widgetconfig) {
?>
<div class="panel panel-default" id="widget-<?=$widgetname?>">
<div class="panel-heading">
- <?=$wtitle?>
- <span class="widget-heading-icon">
- <a data-toggle="collapse" href="#widget-<?=$widgetname?>_panel-footer" class="config hidden">
- <i class="fa fa-wrench"></i>
- </a>
- <a data-toggle="collapse" href="#widget-<?=$widgetname?>_panel-body">
- <!-- actual icon is determined in css based on state of body -->
- <i class="fa fa-plus-circle"></i>
- </a>
- <a data-toggle="close" href="#widget-<?=$widgetname?>">
- <i class="fa fa-times-circle"></i>
- </a>
- </span>
+ <h2 class="panel-title">
+ <?=$wtitle?>
+ <span class="widget-heading-icon">
+ <a data-toggle="collapse" href="#widget-<?=$widgetname?>_panel-footer" class="config hidden">
+ <i class="fa fa-wrench"></i>
+ </a>
+ <a data-toggle="collapse" href="#widget-<?=$widgetname?>_panel-body">
+ <!-- actual icon is determined in css based on state of body -->
+ <i class="fa fa-plus-circle"></i>
+ </a>
+ <a data-toggle="close" href="#widget-<?=$widgetname?>">
+ <i class="fa fa-times-circle"></i>
+ </a>
+ </span>
+ </h2>
</div>
<div id="widget-<?=$widgetname?>_panel-body" class="panel-body collapse<?=($widgetconfig['display'] == 'close' ? '' : ' in')?>">
<?php include('/usr/local/www/widgets/widgets/'. $widgetname.'.widget.php'); ?>
@@ -437,6 +434,8 @@ foreach ($widgets as $widgetname => $widgetconfig) {
<script type="text/javascript">
//<![CDATA[
+
+dirty = false;
function updateWidgets(newWidget) {
var sequence = '';
@@ -457,7 +456,6 @@ function updateWidgets(newWidget) {
}
}
- $('#widgetSequence').removeClass('hidden');
$('input[name=sequence]', $('#widgetSequence_form')).val(sequence);
}
@@ -468,6 +466,8 @@ events.push(function() {
$(el).on('click', function(e) {
$(el).parents('.panel').remove();
updateWidgets();
+ // Submit the form save/display all selected widgets
+ $('[name=widgetForm]').submit();
})
});
@@ -476,7 +476,7 @@ events.push(function() {
handle: '.panel-heading',
cursor: 'grabbing',
connectWith: '.container .col-md-<?=$columnWidth?>',
- update: updateWidgets
+ update: function(){dirty = true;}
});
// On clicking a widget to install . .
@@ -484,13 +484,27 @@ events.push(function() {
// Add the widget name to the list of displayed widgets
updateWidgets(this.id.replace('btnadd-', ''));
- // We don't want to see the "Store" button because we are doing that automatically
- $('#btnstore').hide();
-
// Submit the form save/display all selected widgets
$('[name=widgetForm]').submit();
});
+
+ $('.context-links li:last').prev('li').html('<a href="#" title="<?=gettext("Save dashboard layout")?>" id="btnstore"><i class="fa fa-save"></i></a>');
+
+ $('#btnstore').click(function() {
+ updateWidgets();
+ dirty = false;
+ $('[name=widgetForm]').submit();
+ });
+
+ // provide a warning message if the user tries to change page before saving
+ $(window).bind('beforeunload', function(){
+ if (dirty) {
+ return ("<?=gettext('You have moved one or more widgets but have not yet saved')?>");
+ } else {
+ return undefined;
+ }
+ });
});
//]]>
</script>
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php
index 104a1bf..01f6f95 100644
--- a/src/usr/local/www/interfaces.php
+++ b/src/usr/local/www/interfaces.php
@@ -280,14 +280,6 @@ $pconfig['dhcp_plus'] = isset($wancfg['dhcp_plus']);
$pconfig['descr'] = remove_bad_chars($wancfg['descr']);
$pconfig['enable'] = isset($wancfg['enable']);
-if (is_array($config['aliases']['alias'])) {
- foreach ($config['aliases']['alias'] as $alias) {
- if ($alias['name'] == $wancfg['descr']) {
- $input_errors[] = sprintf(gettext("Sorry, an alias with the name %s already exists."), $wancfg['descr']);
- }
- }
-}
-
switch ($wancfg['ipaddr']) {
case "dhcp":
$pconfig['type'] = "dhcp";
@@ -492,7 +484,7 @@ if ($_POST['apply']) {
if (isset($wancfg['wireless'])) {
interface_sync_wireless_clones($wancfg, false);
}
- write_config("Interface {$_POST['descr']}({$if}) is now disabled.");
+ write_config(sprintf(gettext('Interface %1$s (%2$s) is now disabled.'), $_POST['descr'], $if));
mark_subsystem_dirty('interfaces');
if (file_exists("{$g['tmp_path']}/.interfaces.apply")) {
$toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.interfaces.apply"));
@@ -540,6 +532,25 @@ if ($_POST['apply']) {
break;
}
}
+
+ /* Is the description already used as an alias name? */
+ if (is_array($config['aliases']['alias'])) {
+ foreach ($config['aliases']['alias'] as $alias) {
+ if ($alias['name'] == $_POST['descr']) {
+ $input_errors[] = sprintf(gettext("Sorry, an alias with the name %s already exists."), $_POST['descr']);
+ }
+ }
+ }
+
+ /* Is the description already used as an interface group name? */
+ if (is_array($config['ifgroups']['ifgroupentry'])) {
+ foreach ($config['ifgroups']['ifgroupentry'] as $ifgroupentry) {
+ if ($ifgroupentry['ifname'] == $_POST['descr']) {
+ $input_errors[] = sprintf(gettext("Sorry, an interface group with the name %s already exists."), $wancfg['descr']);
+ }
+ }
+ }
+
if (is_numeric($_POST['descr'])) {
$input_errors[] = gettext("The interface description cannot contain only numbers.");
}
@@ -658,6 +669,10 @@ if ($_POST['apply']) {
$input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."), $_POST['type6']);
}
+ if (empty($_POST['track6-interface'])) {
+ $input_errors[] = gettext("You have to select a valid interface to track.");
+ }
+
if ($_POST['track6-prefix-id--hex'] != "" && !is_numeric("0x" . $_POST['track6-prefix-id--hex'])) {
$input_errors[] = gettext("You must enter a valid hexadecimal number for the IPv6 prefix ID.");
} else {
@@ -947,6 +962,19 @@ if ($_POST['apply']) {
}
}
}
+
+ if ($_POST['ppp_password'] != $_POST['ppp_password_confirm']) {
+ $input_errors[] = gettext("PPP Password and confirmed password must match!");
+ }
+
+ if ($_POST['pppoe_password'] != $_POST['pppoe_password_confirm']) {
+ $input_errors[] = gettext("PPPoE Password and confirmed password must match!");
+ }
+
+ if ($_POST['pptp_password'] != $_POST['pptp_password_confirm']) {
+ $input_errors[] = gettext("PTPP Password and confirmed password must match!");
+ }
+
if (!$input_errors) {
// These 3 fields can be a list of multiple data items when used for MLPPP.
// The UI in this code only processes the first of the list, so save the data here then we can preserve any other entries.
@@ -1125,7 +1153,9 @@ if ($_POST['apply']) {
$a_ppps[$pppid]['if'] = $_POST['type'].$_POST['ptpid'];
$a_ppps[$pppid]['ports'] = $_POST['port'];
$a_ppps[$pppid]['username'] = $_POST['ppp_username'];
- $a_ppps[$pppid]['password'] = base64_encode($_POST['ppp_password']);
+ if ($_POST['ppp_password'] != DMYPWD) {
+ $a_ppps[$pppid]['password'] = base64_encode($_POST['ppp_password']);
+ }
$a_ppps[$pppid]['phone'] = $_POST['phone'];
$a_ppps[$pppid]['apn'] = $_POST['apn'];
$wancfg['if'] = $_POST['type'] . $_POST['ptpid'];
@@ -1142,7 +1172,9 @@ if ($_POST['apply']) {
$a_ppps[$pppid]['ports'] = $wancfg['if'];
}
$a_ppps[$pppid]['username'] = $_POST['pppoe_username'];
- $a_ppps[$pppid]['password'] = base64_encode($_POST['pppoe_password']);
+ if ($_POST['pppoe_password'] != DMYPWD) {
+ $a_ppps[$pppid]['password'] = base64_encode($_POST['pppoe_password']);
+ }
if (!empty($_POST['provider'])) {
$a_ppps[$pppid]['provider'] = $_POST['provider'];
} else {
@@ -1178,7 +1210,9 @@ if ($_POST['apply']) {
$a_ppps[$pppid]['ports'] = $wancfg['if'];
}
$a_ppps[$pppid]['username'] = $_POST['pptp_username'];
- $a_ppps[$pppid]['password'] = base64_encode($_POST['pptp_password']);
+ if ($_POST['pptp_password'] != DMYPWD) {
+ $a_ppps[$pppid]['password'] = base64_encode($_POST['pptp_password']);
+ }
// Replace the first (0) entry with the posted data. Preserve any other entries that might be there.
$poriginal['pptp_localip'][0] = $_POST['pptp_local0'];
$a_ppps[$pppid]['localip'] = implode(',', $poriginal['pptp_localip']);
@@ -1611,7 +1645,7 @@ foreach ($mediaopts as $mediaopt) {
}
}
-$pgtitle = array(gettext("Interfaces"), $pconfig['descr']);
+$pgtitle = array(gettext("Interfaces"), $wancfg['descr']);
$shortcut_section = "interfaces";
$types4 = array("none" => gettext("None"), "staticv4" => gettext("Static IPv4"), "dhcp" => gettext("DHCP"), "ppp" => gettext("PPP"), "pppoe" => gettext("PPPoE"), "pptp" => gettext("PPTP"), "l2tp" => gettext("L2TP"));
@@ -1625,8 +1659,8 @@ $mymac = str_replace("\n", "", $mymac);
function build_mediaopts_list() {
global $mediaopts_list;
- $list = ["" => "Default (no preference, typically autoselect)",
- " " => "------- Media Supported by this interface -------"
+ $list = ["" => gettext("Default (no preference, typically autoselect)"),
+ " " => gettext("------- Media Supported by this interface -------")
];
foreach ($mediaopts_list as $mediaopt) {
@@ -1639,7 +1673,7 @@ function build_mediaopts_list() {
function build_gateway_list() {
global $a_gateways, $if;
- $list = array("none" => "None");
+ $list = array("none" => gettext("None"));
foreach ($a_gateways as $gateway) {
if (($gateway['interface'] == $if) && (is_ipaddrv4($gateway['gateway']))) {
$list[$gateway['name']] = $gateway['name'] . " - " . $gateway['gateway'];
@@ -1652,7 +1686,7 @@ function build_gateway_list() {
function build_gatewayv6_list() {
global $a_gateways, $if;
- $list = array("none" => "None");
+ $list = array("none" => gettext("None"));
foreach ($a_gateways as $gateway) {
if (($gateway['interface'] == $if) && (is_ipaddrv6($gateway['gateway']))) {
$list[$gateway['name']] = $gateway['name'] . " - " . $gateway['gateway'];
@@ -1669,8 +1703,8 @@ if ($input_errors) {
}
if (is_subsystem_dirty('interfaces')) {
- print_info_box_np(sprintf(gettext("The %s configuration has been changed."), $wancfg['descr']) . "<br />" .
- gettext("You must apply the changes in order for them to take effect. Don't forget to adjust the DHCP Server range if needed after applying."));
+ print_apply_box(sprintf(gettext("The %s configuration has been changed."), $wancfg['descr']) . "<br />" .
+ gettext("You must apply the changes in order for them to take effect. Don't forget to adjust the DHCP Server range if needed after applying."));
}
if ($savemsg) {
@@ -2062,17 +2096,19 @@ $section = new Form_Section('DHCP6 client configuration');
$section->addClass('dhcp6');
$section->addInput(new Form_Checkbox(
- 'dhcp6adv',
+ 'adv_dhcp6_config_advanced',
'Advanced',
'Show DHCPv6 advanced options',
- $pconfig['adv_dhcp6_config_advanced']
+ $pconfig['adv_dhcp6_config_advanced'],
+ 'Selected'
));
$section->addInput(new Form_Checkbox(
'adv_dhcp6_config_file_override',
'Config file override',
'Override the configuration from this file',
- $pconfig['adv_dhcp6_config_file_override']
+ $pconfig['adv_dhcp6_config_file_override'],
+ 'Selected'
));
$section->addInput(new Form_Checkbox(
@@ -2124,7 +2160,8 @@ $section->addInput(new Form_Checkbox(
'adv_dhcp6_interface_statement_information_only_enable',
'Information only',
null,
- $pconfig['adv_dhcp6_interface_statement_information_only_enable']
+ $pconfig['adv_dhcp6_interface_statement_information_only_enable'],
+ 'Selected'
));
$section->addInput(new Form_Input(
@@ -2159,7 +2196,8 @@ $group->add(new Form_Checkbox(
'adv_dhcp6_id_assoc_statement_address_enable',
null,
'Non-Temporary Address Allocation',
- $pconfig['adv_dhcp6_id_assoc_statement_address_enable']
+ $pconfig['adv_dhcp6_id_assoc_statement_address_enable'],
+ 'Selected'
));
$group->add(new Form_Input(
@@ -2198,7 +2236,8 @@ $group->add(new Form_Checkbox(
'adv_dhcp6_id_assoc_statement_prefix_enable',
null,
'Prefix Delegation ',
- $pconfig['adv_dhcp6_id_assoc_statement_prefix_enable']
+ $pconfig['adv_dhcp6_id_assoc_statement_prefix_enable'],
+ 'Selected'
));
$group->add(new Form_Input(
@@ -2452,7 +2491,7 @@ $section->addInput(new Form_Input(
$pconfig['ppp_username']
));
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'ppp_password',
'Password',
'password',
@@ -2518,7 +2557,7 @@ $section->addInput(new Form_Input(
$pconfig['pppoe_username']
));
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'pppoe_password',
'Password',
'password',
@@ -2553,7 +2592,7 @@ $section->addInput(new Form_Select(
'pppoe-reset-type',
'Periodic reset',
$pconfig['pppoe-reset-type'],
- ['' => 'Disabled', 'custom' => 'Custom', 'preset' => 'Pre-set']
+ ['' => gettext('Disabled'), 'custom' => gettext('Custom'), 'preset' => gettext('Pre-set')]
))->setHelp('Select a reset timing type');
$group = new Form_Group('Custom reset');
@@ -2649,7 +2688,7 @@ $section->addInput(new Form_Input(
$pconfig['pptp_username']
));
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'pptp_password',
'Password',
'password',
@@ -2743,7 +2782,7 @@ if (isset($wancfg['wireless'])) {
'protmode',
'802.11g OFDM Protection Mode',
$pconfig['protmode'],
- ['off' => 'Off', 'cts' => 'CTS to self', 'rtscts' => 'RTS and CTS']
+ ['off' => gettext('Off'), 'cts' => gettext('CTS to self'), 'rtscts' => gettext('RTS and CTS')]
))->setHelp('For IEEE 802.11g, use the specified technique for protecting OFDM frames in a mixed 11b/11g network.');
} else {
$section->addInput(new Form_Input(
@@ -2754,7 +2793,7 @@ if (isset($wancfg['wireless'])) {
));
}
- $mode_list = ['0' => 'Auto'];
+ $mode_list = ['0' => gettext('Auto')];
if (is_array($wl_modes)) {
foreach ($wl_modes as $wl_standard => $wl_channels) {
@@ -2793,7 +2832,7 @@ if (isset($wancfg['wireless'])) {
'diversity',
null,
(isset($pconfig['diversity'])) ? $pconfig['diversity']:'',
- ['' => 'Default', '0' => 'Off', '1' => 'On']
+ ['' => gettext('Default'), '0' => gettext('Off'), '1' => gettext('On')]
))->setHelp('Diversity');
}
@@ -2802,7 +2841,7 @@ if (isset($wancfg['wireless'])) {
'txantenna',
null,
(isset($pconfig['txantenna'])) ? $pconfig['txantenna']:'',
- ['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']
+ ['' => gettext('Default'), '0' => gettext('Auto'), '1' => gettext('#1'), '2' => gettext('#2')]
))->setHelp('Transmit antenna');
}
@@ -2811,7 +2850,7 @@ if (isset($wancfg['wireless'])) {
'rxantenna',
null,
(isset($pconfig['rxantenna'])) ? $pconfig['rxantenna']:'',
- ['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']
+ ['' => gettext('Default'), '0' => gettext('Auto'), '1' => gettext('#1'), '2' => gettext('#2')]
))->setHelp('Receive antenna');
}
@@ -2869,7 +2908,7 @@ if (isset($wancfg['wireless'])) {
'reglocation',
'Location',
$pconfig['reglocation'],
- ['' => 'Default', 'indoor' => 'Indoor', 'outdoor' => 'Outdoor', 'anywhere' => 'Anywhere']
+ ['' => gettext('Default'), 'indoor' => gettext('Indoor'), 'outdoor' => gettext('Outdoor'), 'anywhere' => gettext('Anywhere')]
))->setHelp('These settings may affect which channels are available and the maximum transmit power allowed on those channels. ' .
'Using the correct settings to comply with local regulatory requirements is recommended.' . '<br />' .
'All wireless networks on this interface will be temporarily brought down when changing regulatory settings. ' .
@@ -2884,7 +2923,7 @@ if (isset($wancfg['wireless'])) {
'mode',
'Mode',
$pconfig['mode'],
- ['bss' => 'Infrastructure (BSS)', 'adhoc' => 'Ad-hoc (IBSS)', 'hostap' => 'Access Point']
+ ['bss' => gettext('Infrastructure (BSS)'), 'adhoc' => gettext('Ad-hoc (IBSS)'), 'hostap' => gettext('Access Point')]
));
$section->addInput(new Form_Input(
@@ -2899,7 +2938,7 @@ if (isset($wancfg['wireless'])) {
'puremode',
'Minimum wireless standard',
$pconfig['puremode'],
- ['any' => 'Any', '11g' => '802.11g', '11n' => '802.11n']
+ ['any' => gettext('Any'), '11g' => gettext('802.11g'), '11n' => gettext('802.11n')]
))->setHelp('When operating as an access point, allow only stations capable of the selected wireless standard to associate (stations not capable are not permitted to associate)');
} elseif (isset($wl_modes['11g'])) {
$section->addInput(new Form_Checkbox(
@@ -2959,21 +2998,21 @@ if (isset($wancfg['wireless'])) {
'wpa_mode',
'WPA mode',
(isset($pconfig['wpa_mode'])) ? $pconfig['wpa_mode']: '2',
- ['1' => 'WPA', '2' => 'WPA2', '3' => 'Both']
+ ['1' => gettext('WPA'), '2' => gettext('WPA2'), '3' => gettext('Both')]
));
$section->addInput(new Form_Select(
'wpa_key_mgmt',
'WPA Key Management Mode',
$pconfig['wpa_key_mgmt'],
- ['WPA-PSK' => 'Pre-Shared Key', 'WPA-EAP' => 'Extensible Authentication Protocol', 'WPA-PSK WPA-EAP' => 'Both']
+ ['WPA-PSK' => gettext('Pre-Shared Key'), 'WPA-EAP' => gettext('Extensible Authentication Protocol'), 'WPA-PSK WPA-EAP' => gettext('Both')]
));
$section->addInput(new Form_Select(
'wpa_pairwise',
'WPA Pairwise',
(isset($pconfig['wpa_pairwise'])) ? $pconfig['wpa_pairwise']:'CCMP',
- ['CCMP TKIP' => 'Both', 'CCMP' => 'AES (recommended)', 'TKIP' => 'TKIP']
+ ['CCMP TKIP' => gettext('Both'), 'CCMP' => gettext('AES (recommended)'), 'TKIP' => gettext('TKIP')]
));
$section->addInput(new Form_Input(
@@ -3486,7 +3525,7 @@ events.push(function() {
function show_dhcp6adv() {
var ovr = $('#adv_dhcp6_config_file_override').prop('checked');
- var adv = $('#dhcp6adv').prop('checked');
+ var adv = $('#adv_dhcp6_config_advanced').prop('checked');
hideCheckbox('dhcp6usev4iface', ovr);
hideCheckbox('dhcp6prefixonly', ovr);
@@ -3608,7 +3647,7 @@ events.push(function() {
setDHCPoptions();
});
- $('#dhcp6adv').click(function () {
+ $('#adv_dhcp6_config_advanced').click(function () {
show_dhcp6adv();
});
diff --git a/src/usr/local/www/interfaces_assign.php b/src/usr/local/www/interfaces_assign.php
index 3c92a2c..3c17dbe 100644
--- a/src/usr/local/www/interfaces_assign.php
+++ b/src/usr/local/www/interfaces_assign.php
@@ -274,6 +274,7 @@ if (isset($_POST['add']) && isset($_POST['if_add'])) {
write_config();
$savemsg = gettext("Interface has been added.");
+ $class = "success";
}
} else if (isset($_POST['apply'])) {
@@ -284,12 +285,13 @@ if (isset($_POST['add']) && isset($_POST['if_add'])) {
write_config();
$retval = filter_configure();
- $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true) {
$savemsg = get_std_save_message($retval);
+ $class = "success";
} else {
$savemsg = $retval;
+ $class = "danger";
}
}
@@ -334,7 +336,7 @@ if (isset($_POST['add']) && isset($_POST['if_add'])) {
$members = explode(",", strtoupper($bridge['members']));
foreach ($members as $member) {
if ($member == $ifnames[0]) {
- $input_errors[] = sprintf(gettext("You cannot set port %s to interface %s because this interface is a member of %s."), $portname, $member, $portname);
+ $input_errors[] = sprintf(gettext('You cannot set port %1$s to interface %2$s because this interface is a member of %3$s.'), $portname, $member, $portname);
break;
}
}
@@ -345,7 +347,7 @@ if (isset($_POST['add']) && isset($_POST['if_add'])) {
if (is_array($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) {
if (does_interface_exist($vlan['if']) == false) {
- $input_errors[] = "Vlan parent interface {$vlan['if']} does not exist anymore so vlan id {$vlan['tag']} cannot be created please fix the issue before continuing.";
+ $input_errors[] = sprintf(gettext('Vlan parent interface %1$s does not exist anymore so vlan id %2$s cannot be created please fix the issue before continuing.'), $vlan['if'], $vlan['tag']);
}
}
}
@@ -461,6 +463,7 @@ if (isset($_POST['add']) && isset($_POST['if_add'])) {
link_interface_to_vlans($realid, "update");
$savemsg = gettext("Interface has been deleted.");
+ $class = "success";
}
}
}
@@ -486,20 +489,23 @@ if (file_exists("/var/run/interface_mismatch_reboot_needed")) {
if ($_POST) {
if ($rebootingnow) {
$savemsg = gettext("The system is now rebooting. Please wait.");
+ $class = "success";
} else {
$savemsg = gettext("Reboot is needed. Please apply the settings in order to reboot.");
+ $class = "warning";
}
} else {
$savemsg = gettext("Interface mismatch detected. Please resolve the mismatch and click 'Apply changes'. The firewall will reboot afterwards.");
+ $class = "warning";
}
}
if (file_exists("/tmp/reload_interfaces")) {
echo "<p>\n";
- print_info_box_np(gettext("The interface configuration has been changed.<br />You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The interface configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
echo "<br /></p>\n";
} elseif ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, $class);
}
pfSense_handle_custom_code("/usr/local/pkg/interfaces_assign/pre_input_errors");
@@ -528,6 +534,7 @@ display_top_tabs($tab_array);
<tr>
<th><?=gettext("Interface")?></th>
<th><?=gettext("Network port")?></th>
+ <th>&nbsp;</th>
</tr>
</thead>
<tbody>
diff --git a/src/usr/local/www/interfaces_bridge.php b/src/usr/local/www/interfaces_bridge.php
index 9a45bc6..3498713 100644
--- a/src/usr/local/www/interfaces_bridge.php
+++ b/src/usr/local/www/interfaces_bridge.php
@@ -126,18 +126,20 @@ $tab_array[] = array(gettext("Bridges"), true, "interfaces_bridge.php");
$tab_array[] = array(gettext("LAGG"), false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
-
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Interface"); ?></th>
- <th><?=gettext("Members"); ?></th>
- <th><?=gettext("Description"); ?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Bridge Interfaces')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Interface"); ?></th>
+ <th><?=gettext("Members"); ?></th>
+ <th><?=gettext("Description"); ?></th>
+ <th><?=gettext("Actions"); ?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$i = 0;
@@ -145,11 +147,11 @@ $ifdescrs = get_configured_interface_with_descr();
foreach ($a_bridges as $bridge) {
?>
- <tr>
- <td>
- <?=htmlspecialchars(strtoupper($bridge['bridgeif']))?>
- </td>
- <td>
+ <tr>
+ <td>
+ <?=htmlspecialchars(strtoupper($bridge['bridgeif']))?>
+ </td>
+ <td>
<?php
$members = explode(',', $bridge['members']);
$j = 0;
@@ -163,29 +165,30 @@ foreach ($a_bridges as $bridge) {
}
}
?>
- </td>
- <td>
- <?=htmlspecialchars($bridge['descr'])?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit interface bridge')?>" href="interfaces_bridge_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete interface bridge')?>" href="interfaces_bridge.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ </td>
+ <td>
+ <?=htmlspecialchars($bridge['descr'])?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit interface bridge')?>" href="interfaces_bridge_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete interface bridge')?>" href="interfaces_bridge.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php
$i++;
}
?>
- </tbody>
- </table>
-
- <nav class="action-buttons">
- <a href="interfaces_bridge_edit.php" class="btn btn-success btn-sm">
- <i class="fa fa-plus icon-embed-btn"></i>
- <?=gettext("Add")?>
- </a>
- </nav>
-
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
+<nav class="action-buttons">
+ <a href="interfaces_bridge_edit.php" class="btn btn-success btn-sm">
+ <i class="fa fa-plus icon-embed-btn"></i>
+ <?=gettext("Add")?>
+ </a>
+</nav>
+
<?php include("foot.inc");
diff --git a/src/usr/local/www/interfaces_bridge_edit.php b/src/usr/local/www/interfaces_bridge_edit.php
index 4997ef5..7425d42 100644
--- a/src/usr/local/www/interfaces_bridge_edit.php
+++ b/src/usr/local/www/interfaces_bridge_edit.php
@@ -180,7 +180,7 @@ if ($_POST) {
}
foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST[$ifn] <> "" && !is_numericint($_POST[$ifn])) {
- $input_errors[] = "{$ifdescr} " . gettext("interface priority for STP needs to be an integer between 0 and 240.");
+ $input_errors[] = sprintf(gettext("%s interface priority for STP needs to be an integer between 0 and 240."), $ifdescr);
}
}
@@ -188,7 +188,7 @@ if ($_POST) {
foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST["{$ifn}{$i}"] <> "" && !is_numeric($_POST["{$ifn}{$i}"])) {
- $input_errors[] = "{$ifdescr} " . gettext("interface path cost for STP needs to be an integer between 1 and 200000000.");
+ $input_errors[] = sprintf(gettext("%s interface path cost for STP needs to be an integer between 1 and 200000000."), $ifdescr);
}
$i++;
}
@@ -216,7 +216,7 @@ if ($_POST) {
$a_members = explode(',', $a_bridge['members']);
foreach ($a_members as $a_member) {
if ($ifmembers === $a_member) {
- $input_errors[] = $ifmembers . gettext(" is part of another bridge. Remove the interface from bridge members to continue.");
+ $input_errors[] = sprintf(gettext("%s is part of another bridge. Remove the interface from bridge members to continue."), $ifmembers);
}
}
}
@@ -315,7 +315,7 @@ if ($_POST) {
function build_spanport_list() {
global $ifacelist;
- $splist = array('none' => 'None');
+ $splist = array('none' => gettext('None'));
foreach ($ifacelist as $ifn => $ifdescr) {
$splist[$ifn] = $ifdescr;
@@ -327,8 +327,7 @@ function build_spanport_list() {
function build_member_list() {
global $pconfig, $ifacelist;
- $memberlist = array('list' => array(),
- 'selected' => array());
+ $memberlist = array('list' => array(), 'selected' => array());
$members_array = explode(',', $pconfig['members']);
foreach ($ifacelist as $ifn => $ifinfo) {
@@ -343,14 +342,14 @@ function build_member_list() {
}
function build_port_list($selecton) {
- global $pconfig, $ifacelist;
+ global $ifacelist;
$portlist = array('list' => array(), 'selected' => array());
foreach ($ifacelist as $ifn => $ifdescr) {
$portlist['list'][$ifn] = $ifdescr;
- if (stristr($selecton, $ifn)) {
+ if (in_array($ifn, explode(',', $selecton))) {
array_push($portlist['selected'], $ifn);
}
}
@@ -431,7 +430,7 @@ $section->addInput(new Form_Select(
$edgelist = build_port_list($pconfig['edge']);
$section->addInput(new Form_Select(
- 'edge[]',
+ 'edge',
'Edge Ports',
$edgelist['selected'],
$edgelist['list'],
@@ -441,7 +440,7 @@ $section->addInput(new Form_Select(
$edgelist = build_port_list($pconfig['autoedge']);
$section->addInput(new Form_Select(
- 'autoedge[]',
+ 'autoedge',
'Auto Edge Ports',
$edgelist['selected'],
$edgelist['list'],
@@ -462,7 +461,7 @@ $section->addInput(new Form_Select(
$edgelist = build_port_list($pconfig['autoptp']);
$section->addInput(new Form_Select(
- 'autoptp[]',
+ 'autoptp',
'Auto PTP Ports',
$edgelist['selected'],
$edgelist['list'],
@@ -473,7 +472,7 @@ $section->addInput(new Form_Select(
$edgelist = build_port_list($pconfig['static']);
$section->addInput(new Form_Select(
- 'static[]',
+ 'static',
'Sticky Ports',
$edgelist['selected'],
$edgelist['list'],
@@ -484,7 +483,7 @@ $section->addInput(new Form_Select(
$edgelist = build_port_list($pconfig['private']);
$section->addInput(new Form_Select(
- 'private[]',
+ 'private',
'Private Ports',
$edgelist['selected'],
$edgelist['list'],
@@ -520,7 +519,7 @@ $section->addInput(new Form_Select(
$edgelist = build_port_list($pconfig['stp']);
$section->addInput(new Form_Select(
- 'stp[]',
+ 'stp',
'STP Interfaces',
$edgelist['selected'],
$edgelist['list'],
diff --git a/src/usr/local/www/interfaces_gif.php b/src/usr/local/www/interfaces_gif.php
index dd56647..5e939e6 100644
--- a/src/usr/local/www/interfaces_gif.php
+++ b/src/usr/local/www/interfaces_gif.php
@@ -121,37 +121,41 @@ $tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
$tab_array[] = array(gettext("LAGG"), false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
-
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Interface"); ?></th>
- <th><?=gettext("Tunnel to &hellip;"); ?></th>
- <th><?=gettext("Description"); ?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('GIF Interfaces')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Interface"); ?></th>
+ <th><?=gettext("Tunnel to &hellip;"); ?></th>
+ <th><?=gettext("Description"); ?></th>
+ <th><?=gettext("Actions"); ?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php foreach ($a_gifs as $i => $gif): ?>
- <tr>
- <td>
- <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($gif['if']))?>
- </td>
- <td>
- <?=htmlspecialchars($gif['remote-addr'])?>
- </td>
- <td>
- <?=htmlspecialchars($gif['descr'])?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit GIF interface')?>" href="interfaces_gif_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete GIF interface')?>" href="interfaces_gif.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($gif['if']))?>
+ </td>
+ <td>
+ <?=htmlspecialchars($gif['remote-addr'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($gif['descr'])?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit GIF interface')?>" href="interfaces_gif_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete GIF interface')?>" href="interfaces_gif.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php endforeach; ?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
<nav class="action-buttons">
diff --git a/src/usr/local/www/interfaces_gre.php b/src/usr/local/www/interfaces_gre.php
index 00a2397..76da5dc 100644
--- a/src/usr/local/www/interfaces_gre.php
+++ b/src/usr/local/www/interfaces_gre.php
@@ -121,36 +121,41 @@ $tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
$tab_array[] = array(gettext("LAGG"), false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Interface"); ?></th>
- <th><?=gettext("Tunnel to &hellip;"); ?></th>
- <th><?=gettext("Description"); ?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('GRE Interfaces')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Interface"); ?></th>
+ <th><?=gettext("Tunnel to &hellip;"); ?></th>
+ <th><?=gettext("Description"); ?></th>
+ <th><?=gettext("Actions"); ?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php foreach ($a_gres as $i => $gre): ?>
- <tr>
- <td>
- <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($gre['if']))?>
- </td>
- <td>
- <?=htmlspecialchars($gre['remote-addr'])?>
- </td>
- <td>
- <?=htmlspecialchars($gre['descr'])?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit GRE interface')?>" href="interfaces_gre_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete GRE interface')?>" href="interfaces_gre.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($gre['if']))?>
+ </td>
+ <td>
+ <?=htmlspecialchars($gre['remote-addr'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($gre['descr'])?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit GRE interface')?>" href="interfaces_gre_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete GRE interface')?>" href="interfaces_gre.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php endforeach; ?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
<nav class="action-buttons">
diff --git a/src/usr/local/www/interfaces_groups.php b/src/usr/local/www/interfaces_groups.php
index 5d4156d..a4972b2 100644
--- a/src/usr/local/www/interfaces_groups.php
+++ b/src/usr/local/www/interfaces_groups.php
@@ -103,23 +103,26 @@ $tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
$tab_array[] = array(gettext("LAGG"), false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext('Name');?></th>
- <th><?=gettext('Members');?></th>
- <th><?=gettext('Description');?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Interface Groups')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext('Name');?></th>
+ <th><?=gettext('Members');?></th>
+ <th><?=gettext('Description');?></th>
+ <th><?=gettext('Actions');?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php foreach ($a_ifgroups as $i => $ifgroupentry): ?>
- <tr>
- <td>
- <?=htmlspecialchars($ifgroupentry['ifname']); ?>
- </td>
- <td>
+ <tr>
+ <td>
+ <?=htmlspecialchars($ifgroupentry['ifname']); ?>
+ </td>
+ <td>
<?php
$members_arr = explode(" ", $ifgroupentry['members']);
$iflist = get_configured_interface_with_descr(false, true);
@@ -135,18 +138,20 @@ display_top_tabs($tab_array);
echo '&hellip;';
}
?>
- </td>
- <td>
- <?=htmlspecialchars($ifgroupentry['descr']);?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit group')?>" href="interfaces_groups_edit.php?id=<?=$i; ?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete group')?>" href="interfaces_groups.php?act=del&amp;id=<?=$i; ?>"></a>
- </td>
- </tr>
+ </td>
+ <td>
+ <?=htmlspecialchars($ifgroupentry['descr']);?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit group')?>" href="interfaces_groups_edit.php?id=<?=$i; ?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete group')?>" href="interfaces_groups.php?act=del&amp;id=<?=$i; ?>"></a>
+ </td>
+ </tr>
<?php endforeach; ?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
<nav class="action-buttons">
@@ -156,9 +161,9 @@ display_top_tabs($tab_array);
</a>
</nav>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(gettext('Interface Groups allow you to setup rules for multiple interfaces without duplicating the rules.<br />' .
- 'If you remove members from an interface group, the group rules are no longer applicable to that interface.'), info)?>
+ 'If you remove members from an interface group, the group rules are no longer applicable to that interface.'), 'info', false)?>
</div>
<?php
diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php
index f7ef013..3deecdc 100644
--- a/src/usr/local/www/interfaces_groups_edit.php
+++ b/src/usr/local/www/interfaces_groups_edit.php
@@ -100,37 +100,19 @@ if ($_POST) {
}
}
}
+
if (preg_match("/([^a-zA-Z])+/", $_POST['ifname'], $match)) {
$input_errors[] = gettext("Only letters A-Z are allowed as the group name.");
}
- foreach ($iflist as $gif => $gdescr) {
+ foreach ($interface_list as $gif => $gdescr) {
if ($gdescr == $_POST['ifname'] || $gif == $_POST['ifname']) {
$input_errors[] = "The specified group name is already used by an interface. Please choose another name.";
}
}
- $members = "";
- $isfirst = 0;
- /* item is a normal ifgroupentry type */
- for ($x = 0; $x < 9999; $x++) {
- if ($_POST["members{$x}"] <> "") {
- if ($isfirst > 0) {
- $members .= " ";
- }
- $members .= $_POST["members{$x}"];
- $isfirst++;
- }
- }
if (isset($_POST['members'])) {
- foreach ($_POST['members'] as $member) {
- if ($isfirst > 0) {
- $members .= " ";
- }
-
- $members .= $member[0];
- $isfirst++;
- }
+ $members = implode(" ", $_POST['members']);
} else {
$members = "";
}
@@ -238,7 +220,7 @@ $tab_array[10] = array(gettext("LAGG"), false, "interfaces_lagg.php");
display_top_tabs($tab_array);
$form = new Form;
-$section = new Form_Section('Interface Group Edit');
+$section = new Form_Section('Interface Group Configuration');
$section->addInput(new Form_Input(
'ifname',
@@ -259,7 +241,7 @@ $section->addInput(new Form_Input(
'here for your reference (not parsed)');
$section->addInput(new Form_Select(
- 'members[]',
+ 'members',
'Group Members',
explode(' ', $pconfig['members']),
$interface_list,
diff --git a/src/usr/local/www/interfaces_lagg.php b/src/usr/local/www/interfaces_lagg.php
index 72c9c9f..2138cc6 100644
--- a/src/usr/local/www/interfaces_lagg.php
+++ b/src/usr/local/www/interfaces_lagg.php
@@ -128,51 +128,57 @@ $tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
$tab_array[] = array(gettext("LAGG"), true, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Interface"); ?></th>
- <th><?=gettext("Members"); ?></th>
- <th><?=gettext("Description"); ?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('LAGG Interfaces')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Interface"); ?></th>
+ <th><?=gettext("Members"); ?></th>
+ <th><?=gettext("Description"); ?></th>
+ <th><?=gettext("Actions"); ?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$i = 0;
foreach ($a_laggs as $lagg) {
?>
- <tr>
- <td>
- <?=htmlspecialchars(strtoupper($lagg['laggif']))?>
- </td>
- <td>
- <?=htmlspecialchars($lagg['members'])?>
- </td>
- <td>
- <?=htmlspecialchars($lagg['descr'])?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit LAGG interface')?>" href="interfaces_lagg_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete LAGG interface')?>" href="interfaces_lagg.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?=htmlspecialchars(strtoupper($lagg['laggif']))?>
+ </td>
+ <td>
+ <?=htmlspecialchars($lagg['members'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($lagg['descr'])?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit LAGG interface')?>" href="interfaces_lagg_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete LAGG interface')?>" href="interfaces_lagg.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php
$i++;
}
?>
- </tbody>
- </table>
-
- <nav class="action-buttons">
- <a href="interfaces_lagg_edit.php" class="btn btn-success btn-sm">
- <i class="fa fa-plus icon-embed-btn"></i>
- <?=gettext("Add")?>
- </a>
- </nav>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
+
+ <nav class="action-buttons">
+ <a href="interfaces_lagg_edit.php" class="btn btn-success btn-sm">
+ <i class="fa fa-plus icon-embed-btn"></i>
+ <?=gettext("Add")?>
+ </a>
+</nav>
+
<?php
include("foot.inc");
diff --git a/src/usr/local/www/interfaces_lagg_edit.php b/src/usr/local/www/interfaces_lagg_edit.php
index effd171..8417834 100644
--- a/src/usr/local/www/interfaces_lagg_edit.php
+++ b/src/usr/local/www/interfaces_lagg_edit.php
@@ -70,56 +70,56 @@ $a_laggs = &$config['laggs']['lagg'];
$portlist = get_interface_list();
$laggprotos = array("none", "lacp", "failover", "fec", "loadbalance", "roundrobin");
-$laggprotosuc = array("NONE", "LACP", "FAILOVER", "FEC", "LOADBALANCE", "ROUNDROBIN");
+$laggprotosuc = array(gettext("NONE"), gettext("LACP"), gettext("FAILOVER"), gettext("FEC"), gettext("LOADBALANCE"), gettext("ROUNDROBIN"));
$protohelp =
'<ul>' .
'<li>' .
- '<strong>' . gettext($laggprotos[0]) . '</strong><br />' .
- gettext('This protocol is intended to do nothing: it disables any ' .
- 'traffic without disabling the lagg interface itself') .
+ '<strong>' . $laggprotosuc[0] . '</strong><br />' .
+ gettext('This protocol is intended to do nothing: it disables any ' .
+ 'traffic without disabling the lagg interface itself') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[1]) . '</strong><br />' .
- gettext('Supports the IEEE 802.3ad Link Aggregation Control Protocol ' .
- '(LACP) and the Marker Protocol. LACP will negotiate a set ' .
- 'of aggregable links with the peer in to one or more Link ' .
- 'Aggregated Groups. Each LAG is composed of ports of the ' .
- 'same speed, set to full-duplex operation. The traffic will ' .
- 'be balanced across the ports in the LAG with the greatest ' .
- 'total speed, in most cases there will only be one LAG which ' .
- 'contains all ports. In the event of changes in physical ' .
- 'connectivity, Link Aggregation will quickly converge to a ' .
- 'new configuration.') .
+ '<strong>' . $laggprotosuc[1] . '</strong><br />' .
+ gettext('Supports the IEEE 802.3ad Link Aggregation Control Protocol ' .
+ '(LACP) and the Marker Protocol. LACP will negotiate a set ' .
+ 'of aggregable links with the peer in to one or more Link ' .
+ 'Aggregated Groups. Each LAG is composed of ports of the ' .
+ 'same speed, set to full-duplex operation. The traffic will ' .
+ 'be balanced across the ports in the LAG with the greatest ' .
+ 'total speed, in most cases there will only be one LAG which ' .
+ 'contains all ports. In the event of changes in physical ' .
+ 'connectivity, Link Aggregation will quickly converge to a ' .
+ 'new configuration.') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[2]) . '</strong><br />' .
+ '<strong>' . $laggprotosuc[2] . '</strong><br />' .
gettext('Sends and receives traffic only through the master port. If ' .
'the master port becomes unavailable, the next active port is ' .
'used. The first interface added is the master port; any ' .
'interfaces added after that are used as failover devices.') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[3]) . '</strong><br />' .
+ '<strong>' . $laggprotosuc[3] . '</strong><br />' .
gettext('Supports Cisco EtherChannel. This is a static setup and ' .
- 'does not negotiate aggregation with the peer or exchange ' .
- 'frames to monitor the link.') .
+ 'does not negotiate aggregation with the peer or exchange ' .
+ 'frames to monitor the link.') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[4]) . '</strong><br />' .
- gettext('Balances outgoing traffic across the active ports based on ' .
- 'hashed protocol header information and accepts incoming ' .
- 'traffic from any active port. This is a static setup and ' .
- 'does not negotiate aggregation with the peer or exchange ' .
- 'frames to monitor the link. The hash includes the Ethernet ' .
- 'source and destination address, and, if available, the VLAN ' .
- 'tag, and the IP source and destination address') .
+ '<strong>' . $laggprotosuc[4] . '</strong><br />' .
+ gettext('Balances outgoing traffic across the active ports based on ' .
+ 'hashed protocol header information and accepts incoming ' .
+ 'traffic from any active port. This is a static setup and ' .
+ 'does not negotiate aggregation with the peer or exchange ' .
+ 'frames to monitor the link. The hash includes the Ethernet ' .
+ 'source and destination address, and, if available, the VLAN ' .
+ 'tag, and the IP source and destination address') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[5]) . '</strong><br />' .
- gettext('Distributes outgoing traffic using a round-robin scheduler ' .
- 'through all active ports and accepts incoming traffic from ' .
- 'any active port') .
+ '<strong>' . $laggprotosuc[5] . '</strong><br />' .
+ gettext('Distributes outgoing traffic using a round-robin scheduler ' .
+ 'through all active ports and accepts incoming traffic from ' .
+ 'any active port') .
'</li>' .
'</ul>';
@@ -163,6 +163,7 @@ if (isset($id) && $a_laggs[$id]) {
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
+ $pconfig['members'] = implode(',', $_POST['members']);
/* input validation */
$reqdfields = explode(" ", "members proto");
@@ -173,7 +174,7 @@ if ($_POST) {
if (is_array($_POST['members'])) {
foreach ($_POST['members'] as $member) {
if (!does_interface_exist($member)) {
- $input_errors[] = gettext("Interface supplied as member is invalid");
+ $input_errors[] = sprintf(gettext("Interface supplied as member (%s) is invalid"), $member);
}
}
} else if (!does_interface_exist($_POST['members'])) {
@@ -220,18 +221,16 @@ if ($_POST) {
function build_member_list() {
global $pconfig, $portlist, $realifchecklist;
- $memberlist = array('list' => array(),
- 'selected' => array());
+ $memberlist = array('list' => array(), 'selected' => array());
- $members_array = explode(',', $pconfig['members']);
foreach ($portlist as $ifn => $ifinfo) {
if (array_key_exists($ifn, $realifchecklist)) {
continue;
}
- $memberlist['list'][$ifn] = $ifn . '(' . $ifinfo['mac'] . ')';
+ $memberlist['list'][$ifn] = $ifn . ' (' . $ifinfo['mac'] . ')';
- if (stristr($pconfig['members'], $ifn)) {
+ if (in_array($ifn, explode(",", $pconfig['members']))) {
array_push($memberlist['selected'], $ifn);
}
}
@@ -242,6 +241,11 @@ function build_member_list() {
$pgtitle = array(gettext("Interfaces"), gettext("LAGG"), gettext("Edit"));
$shortcut_section = "interfaces";
include("head.inc");
+
+if ($input_errors) {
+ print_input_errors($input_errors);
+}
+
$form = new Form();
$section = new Form_Section('LAGG Configuration');
@@ -249,7 +253,7 @@ $section = new Form_Section('LAGG Configuration');
$memberslist = build_member_list();
$section->addInput(new Form_Select(
- 'members[]',
+ 'members',
'Parent Interfaces',
$memberslist['selected'],
$memberslist['list'],
diff --git a/src/usr/local/www/interfaces_ppps.php b/src/usr/local/www/interfaces_ppps.php
index 6804743..d30309c 100644
--- a/src/usr/local/www/interfaces_ppps.php
+++ b/src/usr/local/www/interfaces_ppps.php
@@ -120,28 +120,31 @@ $tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
$tab_array[] = array(gettext("LAGG"), false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Interface"); ?></th>
- <th><?=gettext("Interface(s)/Port(s)"); ?></th>
- <th><?=gettext("Description"); ?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('PPP Interfaces')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Interface"); ?></th>
+ <th><?=gettext("Interface(s)/Port(s)"); ?></th>
+ <th><?=gettext("Description"); ?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$i = 0;
foreach ($a_ppps as $id => $ppp) {
?>
- <tr>
- <td>
- <?=htmlspecialchars($ppp['if'])?>
- </td>
- <td>
+ <tr>
+ <td>
+ <?=htmlspecialchars($ppp['if'])?>
+ </td>
+ <td>
<?php
$portlist = explode(",", $ppp['ports']);
foreach ($portlist as $portid => $port) {
@@ -149,31 +152,34 @@ foreach ($a_ppps as $id => $ppp) {
$portlist[$portid] = convert_friendly_interface_to_friendly_descr($port);
}
}
- echo htmlspecialchars(implode(",", $portlist));
+ echo htmlspecialchars(implode(",", $portlist));
?>
- </td>
- <td>
- <?=htmlspecialchars($ppp['descr'])?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit PPP interface')?>" href="interfaces_ppps_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete PPP interface')?>" href="interfaces_ppps.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ </td>
+ <td>
+ <?=htmlspecialchars($ppp['descr'])?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit PPP interface')?>" href="interfaces_ppps_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete PPP interface')?>" href="interfaces_ppps.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php
$i++;
}
?>
- </tbody>
- </table>
-
- <nav class="action-buttons">
- <a href="interfaces_ppps_edit.php" class="btn btn-success btn-sm">
- <i class="fa fa-plus icon-embed-btn"></i>
- <?=gettext("Add")?>
- </a>
- </nav>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
+
+<nav class="action-buttons">
+ <a href="interfaces_ppps_edit.php" class="btn btn-success btn-sm">
+ <i class="fa fa-plus icon-embed-btn"></i>
+ <?=gettext("Add")?>
+ </a>
+</nav>
+
<?php
include("foot.inc");
diff --git a/src/usr/local/www/interfaces_ppps_edit.php b/src/usr/local/www/interfaces_ppps_edit.php
index 843402a..8f06a58 100644
--- a/src/usr/local/www/interfaces_ppps_edit.php
+++ b/src/usr/local/www/interfaces_ppps_edit.php
@@ -257,6 +257,9 @@ if ($_POST) {
$input_errors[] = gettext("Please choose a Link Type.");
break;
}
+ if ($_POST['passwordfld'] != $_POST['passwordfld_confirm']) {
+ $input_errors[] = gettext("Password and confirmed password must match.");
+ }
if ($_POST['type'] == "ppp" && count($_POST['interfaces']) > 1) {
$input_errors[] = gettext("Multilink connections (MLPPP) using the PPP link type is not currently supported. Please select only one Link Interface.");
}
@@ -320,7 +323,11 @@ if ($_POST) {
$ppp['if'] = $ppp['type'].$ppp['ptpid'];
$ppp['ports'] = implode(',', $_POST['interfaces']);
$ppp['username'] = $_POST['username'];
- $ppp['password'] = base64_encode($_POST['passwordfld']);
+ if ($_POST['passwordfld'] != DMYPWD) {
+ $ppp['password'] = base64_encode($_POST['passwordfld']);
+ } else {
+ $ppp['password'] = $a_ppps[$id]['password'];
+ }
$ppp['ondemand'] = $_POST['ondemand'] ? true : false;
if (!empty($_POST['idletimeout'])) {
$ppp['idletimeout'] = $_POST['idletimeout'];
@@ -445,7 +452,7 @@ $pgtitle = array(gettext("Interfaces"), gettext("PPPs"), gettext("Edit"));
$shortcut_section = "interfaces";
include("head.inc");
-$types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP", "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/);
+$types = array("select" => gettext("Select"), "ppp" => gettext("PPP"), "pppoe" => gettext("PPPoE"), "pptp" => gettext("PPTP"), "l2tp" => gettext("L2TP")/*, "tcp" => "TCP", "udp" => "UDP"*/);
$serviceproviders_xml = "/usr/local/share/mobile-broadband-provider-info/serviceproviders.xml";
$serviceproviders_contents = file_get_contents($serviceproviders_xml);
@@ -476,12 +483,13 @@ $serport_count = 0;
function build_link_list() {
global $pconfig, $portlist, $port_count, $serport_count;
- $linklist = array('list' => array(),
- 'selected' => array());
+ $linklist = array('list' => array(), 'selected' => array());
$selected_ports = array();
- if ($pconfig['interfaces']) {
+ if (is_array($pconfig['interfaces'])) {
+ $selected_ports = $pconfig['interfaces'];
+ } elseif (!empty($pconfig['interfaces'])) {
$selected_ports = explode(',', $pconfig['interfaces']);
}
@@ -543,7 +551,7 @@ $linkparamstr = gettext('Bandwidth is set only for MLPPP connections and when li
$form = new Form();
-$section = new Form_Section('PPPs Configuration');
+$section = new Form_Section('PPP Configuration');
$section->addInput(new Form_Select(
'type',
@@ -597,7 +605,7 @@ $section->addInput(new Form_Input(
$pconfig['username']
));
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'passwordfld',
'Password',
'password',
@@ -717,9 +725,9 @@ $section->addInput(new Form_Select(
'Periodic Reset',
$pconfig['pppoe-reset-type'],
array(
- '' => 'Disabled',
- 'custom' => 'Custom',
- 'preset' => 'Pre-set'
+ '' => gettext('Disabled'),
+ 'custom' => gettext('Custom'),
+ 'preset' => gettext('Pre-set')
)
))->addClass('pppoe')->setHelp('Select a reset timing type');
@@ -957,18 +965,19 @@ events.push(function() {
// The options that follow are only shown if type == 'ppp'
var ppptype = ($('#type').val() == 'ppp');
- hideInput('apnum', showadvanced && ppptype);
- hideInput('simpin', showadvanced && ppptype);
- hideInput('pin-wait', showadvanced && ppptype);
- hideInput('initstr', showadvanced && ppptype);
- hideInput('connect-timeout', showadvanced && ppptype);
- hideCheckbox('uptime', showadvanced && ppptype);
+ hideInput('apn', showadvanced || !ppptype);
+ hideInput('apnum', showadvanced || !ppptype);
+ hideInput('simpin', showadvanced || !ppptype);
+ hideInput('pin-wait', showadvanced || !ppptype);
+ hideInput('initstr', showadvanced || !ppptype);
+ hideInput('connect-timeout', showadvanced || !ppptype);
+ hideCheckbox('uptime', showadvanced || !ppptype);
// The options that follow are only shown if type == 'pppoe'
var pppoetype = ($('#type').val() != 'pppoe');
- hideClass('pppoe', showadvanced || pppoetype);
- hideInput('pppoe-reset-type', showadvanced || pppoetype);
+ hideClass('pppoe', pppoetype);
+ hideInput('pppoe-reset-type', pppoetype || showadvanced);
hideResetDisplay(true);
diff --git a/src/usr/local/www/interfaces_qinq.php b/src/usr/local/www/interfaces_qinq.php
index 53babb3..12289e9 100644
--- a/src/usr/local/www/interfaces_qinq.php
+++ b/src/usr/local/www/interfaces_qinq.php
@@ -133,46 +133,51 @@ $tab_array[] = array(gettext("LAGG"), false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Interface"); ?></th>
- <th><?=gettext("Tag");?></td>
- <th><?=gettext("QinQ members"); ?></th>
- <th><?=gettext("Description"); ?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('QinQ Interfaces')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Interface"); ?></th>
+ <th><?=gettext("Tag");?></th>
+ <th><?=gettext("QinQ members"); ?></th>
+ <th><?=gettext("Description"); ?></th>
+ <th><?=gettext("Actions"); ?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php foreach ($a_qinqs as $i => $qinq):?>
- <tr>
- <td>
- <?=htmlspecialchars($qinq['if'])?>
- </td>
- <td>
- <?=htmlspecialchars($qinq['tag'])?>
- </td>
- <td>
+ <tr>
+ <td>
+ <?=htmlspecialchars($qinq['if'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($qinq['tag'])?>
+ </td>
+ <td>
<?php if (strlen($qinq['members']) > 20):?>
- <?=substr(htmlspecialchars($qinq['members']), 0, 20)?>&hellip;
+ <?=substr(htmlspecialchars($qinq['members']), 0, 20)?>&hellip;
<?php else:?>
- <?=htmlspecialchars($qinq['members'])?>
+ <?=htmlspecialchars($qinq['members'])?>
<?php endif; ?>
- </td>
- <td>
- <?=htmlspecialchars($qinq['descr'])?>&nbsp;
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit Q-in-Q interface')?>" href="interfaces_qinq_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete Q-in-Q interface')?>" href="interfaces_qinq.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ </td>
+ <td>
+ <?=htmlspecialchars($qinq['descr'])?>&nbsp;
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit Q-in-Q interface')?>" href="interfaces_qinq_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete Q-in-Q interface')?>" href="interfaces_qinq.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php
endforeach;
?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
<nav class="action-buttons">
@@ -182,10 +187,10 @@ endforeach;
</a>
</nav>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(sprintf(gettext('Not all drivers/NICs support 802.1Q QinQ tagging properly. <br />On cards that do not explicitly support it, ' .
'QinQ tagging will still work, but the reduced MTU may cause problems.<br />' .
- 'See the %s handbook for information on supported cards.'), $g['product_name']), info)?>
+ 'See the %s handbook for information on supported cards.'), $g['product_name']), 'info', false)?>
</div>
<?php
diff --git a/src/usr/local/www/interfaces_qinq_edit.php b/src/usr/local/www/interfaces_qinq_edit.php
index 9d98573..3a198d8 100644
--- a/src/usr/local/www/interfaces_qinq_edit.php
+++ b/src/usr/local/www/interfaces_qinq_edit.php
@@ -261,7 +261,7 @@ $form = new Form(new Form_Button(
gettext("Save")
));
-$section = new Form_Section('Interface QinQ Edit');
+$section = new Form_Section('QinQ Configuration');
$section->addInput(new Form_Select(
'if',
diff --git a/src/usr/local/www/interfaces_vlan.php b/src/usr/local/www/interfaces_vlan.php
index 041a131..8c505e3 100644
--- a/src/usr/local/www/interfaces_vlan.php
+++ b/src/usr/local/www/interfaces_vlan.php
@@ -130,50 +130,60 @@ display_top_tabs($tab_array);
<input id="act" type="hidden" name="act" value="" />
<input id="id" type="hidden" name="id" value=""/>
- <div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext('Interface');?></th>
- <th><?=gettext('VLAN tag');?></th>
- <th><?=gettext('Priority');?></th>
- <th><?=gettext('Description');?></th>
- </tr>
- </thead>
+ <div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('VLAN Interfaces')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext('Interface');?></th>
+ <th><?=gettext('VLAN tag');?></th>
+ <th><?=gettext('Priority');?></th>
+ <th><?=gettext('Description');?></th>
+ <th><?=gettext('Actions');?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$i = 0;
foreach ($a_vlans as $vlan) {
?>
- <tr>
- <td><?=htmlspecialchars($vlan['if']);?></td>
- <td><?=htmlspecialchars($vlan['tag']);?></td>
- <td><?=htmlspecialchars($vlan['pcp']);?></td>
- <td><?=htmlspecialchars($vlan['descr']);?></td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit VLAN')?>" role="button" href="interfaces_vlan_edit.php?id=<?=$i?>"></a>
+ <tr>
+ <td><?=htmlspecialchars($vlan['if']);?></td>
+ <td><?=htmlspecialchars($vlan['tag']);?></td>
+ <td><?=htmlspecialchars($vlan['pcp']);?></td>
+ <td><?=htmlspecialchars($vlan['descr']);?></td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit VLAN')?>" role="button" href="interfaces_vlan_edit.php?id=<?=$i?>"></a>
<!-- <a class="btn btn-danger btn-xs" role="button" href="interfaces_vlan.php?act=del&amp;id=<?=$i?>"><?=gettext('Delete')?></a></td> -->
- <a class="fa fa-trash" title="<?=gettext('Delete VLAN')?>" role="button" id="del-<?=$i?>"></a>
- </td>
- </tr>
+ <a class="fa fa-trash" title="<?=gettext('Delete VLAN')?>" role="button" id="del-<?=$i?>"></a>
+ </td>
+ </tr>
<?php
$i++;
}
?>
- </table>
- <nav class="action-buttons">
- <a class="btn btn-success btn-sm" role="button" href="interfaces_vlan_edit.php">
- <i class="fa fa-plus icon-embed-btn"></i>
- <?=gettext('Add'); ?>
- </a>
- </nav>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
+
+ <nav class="action-buttons">
+ <a class="btn btn-success btn-sm" role="button" href="interfaces_vlan_edit.php">
+ <i class="fa fa-plus icon-embed-btn"></i>
+ <?=gettext('Add'); ?>
+ </a>
+ </nav>
+
</form>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(sprintf(gettext('NOTE: Not all drivers/NICs support 802.1Q '.
'VLAN tagging properly. <br />On cards that do not explicitly support it, VLAN '.
'tagging will still work, but the reduced MTU may cause problems.<br />See the '.
- '%s handbook for information on supported cards.'), $g['product_name']), info)?>
+ '%s handbook for information on supported cards.'), $g['product_name']), 'info', false)?>
</div>
<script type="text/javascript">
//<![CDATA[
diff --git a/src/usr/local/www/interfaces_vlan_edit.php b/src/usr/local/www/interfaces_vlan_edit.php
index 42258e7..3ed25d9 100644
--- a/src/usr/local/www/interfaces_vlan_edit.php
+++ b/src/usr/local/www/interfaces_vlan_edit.php
@@ -137,7 +137,7 @@ if ($_POST) {
if (is_array($config['qinqs']['qinqentry'])) {
foreach ($config['qinqs']['qinqentry'] as $qinq) {
if ($qinq['tag'] == $_POST['tag'] && $qinq['if'] == $_POST['if']) {
- $input_errors[] = gettext("A QinQ VLAN exists with this tag please remove it to use this tag with.");
+ $input_errors[] = sprintf(gettext('A QinQ VLAN exists on %s with this tag. Please remove it to use this tag for a normal VLAN.'), $_POST['if']);
}
}
}
@@ -208,7 +208,7 @@ if ($input_errors) {
}
$form = new Form;
-$section = new Form_Section('Interface VLAN Edit');
+$section = new Form_Section('VLAN Configuration');
$section->addInput(new Form_Select(
'if',
diff --git a/src/usr/local/www/interfaces_wireless.php b/src/usr/local/www/interfaces_wireless.php
index 7ddbfa1..8dd6318 100644
--- a/src/usr/local/www/interfaces_wireless.php
+++ b/src/usr/local/www/interfaces_wireless.php
@@ -125,51 +125,55 @@ $tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
$tab_array[] = array(gettext("LAGG"), false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
-
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Interface"); ?></th>
- <th><?=gettext("Mode"); ?></th>
- <th><?=gettext("Description"); ?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Wireless Interfaces')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Interface"); ?></th>
+ <th><?=gettext("Mode"); ?></th>
+ <th><?=gettext("Description"); ?></th>
+ <th><?=gettext("Actions"); ?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$i = 0;
foreach ($a_clones as $clone) {
?>
- <tr>
- <td>
- <?=htmlspecialchars($clone['cloneif'])?>
- </td>
- <td>
- <?= $wlan_modes[$clone['mode']]; ?>
- </td>
- <td>
- <?=htmlspecialchars($clone['descr'])?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit WiFi interface')?>" href="interfaces_wireless_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete WiFi interface')?>" href="interfaces_wireless.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?=htmlspecialchars($clone['cloneif'])?>
+ </td>
+ <td>
+ <?= $wlan_modes[$clone['mode']]; ?>
+ </td>
+ <td>
+ <?=htmlspecialchars($clone['descr'])?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit WiFi interface')?>" href="interfaces_wireless_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete WiFi interface')?>" href="interfaces_wireless.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php
$i++;
}
?>
- </tbody>
- </table>
-
- <nav class="action-buttons">
- <a href="interfaces_wireless_edit.php" class="btn btn-success btn-sm">
- <i class="fa fa-plus icon-embed-btn"></i>
- <?=gettext("Add")?></a>
- </nav>
+ </tbody>
+ </table>
+
+ <nav class="action-buttons">
+ <a href="interfaces_wireless_edit.php" class="btn btn-success btn-sm">
+ <i class="fa fa-plus icon-embed-btn"></i>
+ <?=gettext("Add")?></a>
+ </nav>
+ </div>
+ </div>
</div>
<?php
include("foot.inc");
diff --git a/src/usr/local/www/interfaces_wireless_edit.php b/src/usr/local/www/interfaces_wireless_edit.php
index 07e0d08..99899c2 100644
--- a/src/usr/local/www/interfaces_wireless_edit.php
+++ b/src/usr/local/www/interfaces_wireless_edit.php
@@ -207,10 +207,10 @@ if ($input_errors) {
$form = new Form();
-$section = new Form_Section('Wireless Interface');
+$section = new Form_Section('Wireless Interface Configuration');
$section->addInput(new Form_Select(
- 'parent',
+ 'if',
'Parent Interface',
$pconfig['if'],
build_parent_list()
@@ -221,9 +221,9 @@ $section->addInput(new Form_Select(
'Mode',
$pconfig['mode'],
array(
- 'bss' => 'Infrastructure (BSS)',
- 'adhoc' => 'Ad-hoc (IBSS)',
- 'hostap' => 'Access Point'
+ 'bss' => gettext('Infrastructure (BSS)'),
+ 'adhoc' => gettext('Ad-hoc (IBSS)'),
+ 'hostap' => gettext('Access Point')
)
));
diff --git a/src/usr/local/www/jquery/jquery-1.11.2.min.js b/src/usr/local/www/jquery/jquery-1.11.2.min.js
deleted file mode 100644
index e6a051d..0000000
--- a/src/usr/local/www/jquery/jquery-1.11.2.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v1.11.2 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.2",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=mb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=nb(b);function qb(){}qb.prototype=d.filters=d.pseudos,d.setFilters=new qb,g=gb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?gb.error(a):z(a,i).slice(0)};function rb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
-return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)
-}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
diff --git a/src/usr/local/www/jquery/jquery-1.12.0.min.js b/src/usr/local/www/jquery/jquery-1.12.0.min.js
new file mode 100644
index 0000000..6c60672
--- /dev/null
+++ b/src/usr/local/www/jquery/jquery-1.12.0.min.js
@@ -0,0 +1,5 @@
+/*! jQuery v1.12.0 | (c) jQuery Foundation | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
+return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ra(b),i=l.boxSizing&&"border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Sa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Oa.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+eb(b,c,e||(i?"border":"content"),f,h)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{
+marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb,tb,ub=n.expr.attrHandle,vb=/^(?:checked|selected)$/i,wb=l.getSetAttribute,xb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?tb:sb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?xb&&wb||!vb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(wb?c:d)}}),tb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):xb&&wb||!vb.test(c)?a.setAttribute(!wb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ub[b]||n.find.attr;xb&&wb||!vb.test(b)?ub[b]=function(a,b,d){var e,f;return d||(f=ub[b],ub[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ub[b]=f),e}:ub[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),xb&&wb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):sb&&sb.set(a,b,c)}}),wb||(sb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ub.id=ub.name=ub.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:sb.set},n.attrHooks.contenteditable={set:function(a,b,c){sb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var yb=/^(?:input|select|textarea|button|object)$/i,zb=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):yb.test(a.nodeName)||zb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Ab=/[\t\r\n\f]/g;function Bb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Bb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Bb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Bb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=Bb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Bb(c)+" ").replace(Ab," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Cb=a.location,Db=n.now(),Eb=/\?/,Fb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Fb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Gb=/#.*$/,Hb=/([?&])_=[^&]*/,Ib=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Jb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kb=/^(?:GET|HEAD)$/,Lb=/^\/\//,Mb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Nb={},Ob={},Pb="*/".concat("*"),Qb=Cb.href,Rb=Mb.exec(Qb.toLowerCase())||[];function Sb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Tb(a,b,c,d){var e={},f=a===Ob;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ub(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Vb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Wb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Qb,type:"GET",isLocal:Jb.test(Rb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ub(Ub(a,n.ajaxSettings),b):Ub(n.ajaxSettings,a)},ajaxPrefilter:Sb(Nb),ajaxTransport:Sb(Ob),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Ib.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Qb)+"").replace(Gb,"").replace(Lb,Rb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Mb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Rb[1]&&d[2]===Rb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Rb[3]||("http:"===Rb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Tb(Nb,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Kb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Eb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Hb.test(f)?f.replace(Hb,"$1_="+Db++):f+(Eb.test(f)?"&":"?")+"_="+Db++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Pb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Tb(Ob,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Vb(l,w,d)),v=Wb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Xb(a){return a.style&&a.style.display||n.css(a,"display")}function Yb(a){while(a&&1===a.nodeType){if("none"===Xb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Yb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Zb=/%20/g,$b=/\[\]$/,_b=/\r?\n/g,ac=/^(?:submit|button|image|reset|file)$/i,bc=/^(?:input|select|textarea|keygen)/i;function cc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||$b.test(a)?d(a,e):cc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)cc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)cc(c,a[c],b,e);return d.join("&").replace(Zb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&bc.test(this.nodeName)&&!ac.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(_b,"\r\n")}}):{name:b.name,value:c.replace(_b,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?hc():d.documentMode>8?gc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&gc()||hc()}:gc;var dc=0,ec={},fc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in ec)ec[a](void 0,!0)}),l.cors=!!fc&&"withCredentials"in fc,fc=l.ajax=!!fc,fc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++dc;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete ec[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=ec[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function gc(){try{return new a.XMLHttpRequest}catch(b){}}function hc(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ic=[],jc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ic.pop()||n.expando+"_"+Db++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(jc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&jc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(jc,"$1"+e):b.jsonp!==!1&&(b.url+=(Eb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ic.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){if(!d.implementation.createHTMLDocument)return!1;var a=d.implementation.createHTMLDocument("");return a.body.innerHTML="<form></form><form></form>",2===a.body.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var kc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&kc)return kc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function lc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=lc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0)-a.scrollTop(),c.left+=n.css(a[0],"borderLeftWidth",!0)-a.scrollLeft()),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=lc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){
+n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var mc=a.jQuery,nc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=nc),b&&a.jQuery===n&&(a.jQuery=mc),n},b||(a.jQuery=a.$=n),n});
diff --git a/src/usr/local/www/jquery/jquery-ui-1.11.2.min.js b/src/usr/local/www/jquery/jquery-ui-1.11.2.min.js
deleted file mode 100644
index 17eab79..0000000
--- a/src/usr/local/www/jquery/jquery-ui-1.11.2.min.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/*! jQuery UI - v1.11.2 - 2014-10-16
-* http://jqueryui.com
-* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
-* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
-
-(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return n=!a&&o.length?e.widget.extend.apply(null,[n].concat(o)):n,a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))}),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,M=e.extend({},y),C=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=d:"center"===n.my[0]&&(M.left-=d/2),"bottom"===n.my[1]?M.top-=c:"center"===n.my[1]&&(M.top-=c/2),M.left+=C[0],M.top+=C[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+C[0],p[1]+C[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-d,s=v.top-M.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,e.top+p+f+m>u&&(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>d&&(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=h&&l.down||l,d=function(){o._toggleComplete(i)};return"number"==typeof u&&(a=u),"string"==typeof u&&(n=u),n=n||u.easing||l.easing,a=a||u.duration||l.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:d,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?r+=i.now:"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,d):e.animate(this.showProps,a,n,d)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)
-}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.2"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0
-},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,C,N,A,P,I,z,H,F,E,O,j,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="<div class='ui-datepicker-group",K[1]>1)switch(T){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",C=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)N=(x+u)%7,C+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[N]+"'>"+p[N]+"</span></th>";for(M+=C+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),z=Q?this.maxRows>I?this.maxRows:I:I,this.maxRows=z,H=this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;z>F;F++){for(M+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(H)+"</td>":"",x=0;7>x;x++)O=g?g.apply(e.input?e.input[0]:null,[H]):[!0,""],j=H.getMonth()!==Z,W=j&&!y||!O[0]||X&&X>H||$&&H>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(j?" ui-datepicker-other-month":"")+(H.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===H.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(j&&!v?"":" "+O[1]+(H.getTime()===G.getTime()?" "+this._currentClass:"")+(H.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(j&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(W?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(j&&!v?"&#xa0;":W?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===R.getTime()?" ui-state-highlight":"")+(H.getTime()===G.getTime()?" ui-state-active":"")+(j?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(Q?"</div>"+(K[0]>0&&T===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.2",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)
-},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=this.element.children(this.handles[i]).first().show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=u-t.height,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.2",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;
-if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.2",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};
-f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.2",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.2",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this,i=this.element.attr("tabindex");this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:i||this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger("focus",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr("aria-activedescendant",t.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n="";e.each(i,function(i,a){a.optgroup!==n&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:a.optgroup}).appendTo(t),n=a.optgroup),s._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var s=e("<li>");return i.disabled&&s.addClass("ui-state-disabled"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=":not(.ui-state-disabled)"),s="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&this._resizeButton()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),a=n.parent("optgroup");i.push({element:n,index:t,value:n.attr("value"),label:n.text(),optgroup:a.attr("label")||"",disabled:a.prop("disabled")||n.prop("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=(this.options.max-this._valueMin())%this.options.step;this.max=this.options.max-e},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===e.axis||this._isFloating(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));
-return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-e(document).scrollTop()<o.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<o.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+o.scrollSpeed)),t.pageX-e(document).scrollLeft()<o.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<o.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]
-}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){o.html(e),s._trigger("load",i,r)},1)}).complete(function(e,t){setTimeout(function(){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.2",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){e.data("ui-tooltip-open")&&n._delay(function(){t&&(t.type=a),this._open(t,e,i)})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){u.of=e,o.is(":hidden")||o.position(u)}var a,o,r,h,l,u=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(l=s.clone(),l.removeAttr("id").find("[id]").removeAttr("id")):l=s,e("<div>").html(l).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(u.of),clearInterval(h))},e.fx.interval)),this._trigger("open",t,{tooltip:o}),r={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}},i[0]!==this.element[0]&&(r.remove=function(){this._removeTooltip(o)}),t&&"mouseover"!==t.type||(r.mouseleave="close"),t&&"focusin"!==t.type||(r.focusout="close"),this._on(!0,i,r)}},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);a&&(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)))},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}); \ No newline at end of file
diff --git a/src/usr/local/www/jquery/jquery-ui-1.11.4.min.js b/src/usr/local/www/jquery/jquery-ui-1.11.4.min.js
new file mode 100644
index 0000000..5824d12
--- /dev/null
+++ b/src/usr/local/www/jquery/jquery-ui-1.11.4.min.js
@@ -0,0 +1,13 @@
+/*! jQuery UI - v1.11.4 - 2015-03-11
+* http://jqueryui.com
+* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,M=e.extend({},y),C=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=d:"center"===n.my[0]&&(M.left-=d/2),"bottom"===n.my[1]?M.top-=c:"center"===n.my[1]&&(M.top-=c/2),M.left+=C[0],M.top+=C[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+C[0],p[1]+C[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-d,s=v.top-M.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},d=l&&u.down||u,c=function(){o._toggleComplete(i)};return"number"==typeof d&&(a=d),"string"==typeof d&&(n=d),n=n||d.easing||u.easing,a=a||d.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,c):e.animate(this.showProps,a,n,c)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);
+i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);
+return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,C,N,A,P,I,H,z,F,E,O,j,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="<div class='ui-datepicker-group",K[1]>1)switch(T){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",C=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)N=(x+u)%7,C+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[N]+"'>"+p[N]+"</span></th>";for(M+=C+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=Q?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(M+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)O=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],j=z.getMonth()!==Z,W=j&&!y||!O[0]||X&&X>z||$&&z>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(j?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(j&&!v?"":" "+O[1]+(z.getTime()===G.getTime()?" "+this._currentClass:"")+(z.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(j&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(W?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(j&&!v?"&#xa0;":W?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===R.getTime()?" ui-state-highlight":"")+(z.getTime()===G.getTime()?" ui-state-active":"")+(j?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(Q?"</div>"+(K[0]>0&&T===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)
+},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;
+if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};
+f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this;this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger("focus",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr("aria-activedescendant",t.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n="";e.each(i,function(i,a){a.optgroup!==n&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:a.optgroup}).appendTo(t),n=a.optgroup),s._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var s=e("<li>");return i.disabled&&s.addClass("ui-state-disabled"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=":not(.ui-state-disabled)"),s="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&this._resizeButton()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),a=n.parent("optgroup");i.push({element:n,index:t,value:n.val(),label:n.text(),optgroup:a.attr("label")||"",disabled:a.prop("disabled")||n.prop("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));
+return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;
+this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}); \ No newline at end of file
diff --git a/src/usr/local/www/jquery/pfSenseHelpers.js b/src/usr/local/www/jquery/pfSenseHelpers.js
index 1959301..76aaf51 100644
--- a/src/usr/local/www/jquery/pfSenseHelpers.js
+++ b/src/usr/local/www/jquery/pfSenseHelpers.js
@@ -274,10 +274,21 @@ function renumber() {
});
}
-function delete_row(row) {
- $('#' + row).parent('div').parent('div').remove();
+function delete_row(rowDelBtn) {
+ var rowLabel;
+
+ // If we are deleting row zero, we need to save/restore the label
+ if (rowDelBtn == "deleterow0") {
+ rowLabel = $('#' + rowDelBtn).parent('div').parent('div').find('label').text();
+ }
+
+ $('#' + rowDelBtn).parent('div').parent('div').remove();
renumber();
checkLastRow();
+
+ if (rowDelBtn == "deleterow0") {
+ $('#' + rowDelBtn).parent('div').parent('div').find('label').text(rowLabel);
+ }
}
function checkLastRow() {
@@ -384,23 +395,35 @@ $('[id^=delete]').click(function(event) {
alert('You may not delete the last row!');
});
-// "More information" handlers
+// "More information" handlers --------------------------------------------------------------------
// If there is an infoblock, automatically add an info icon that toggles its display
-if($('#infoblock').length != 0) {
- $('#infoblock').before('<i class="fa fa-info-circle icon-pointer" style="color: #337AB7;; font-size:20px; margin-left: 10px; margin-bottom: 10px;" id="showinfo" title="More information"></i>');
- // and remove the 'X' button from the last text box (Which we assume to be the infoblock)
- $('.close :last').remove();
-}
+var sfx = 0;
-// Hide information on page load
-$('#infoblock').hide();
+$('.infoblock').each(function() {
+ // If the block has the class "blockopen" it is initially open
+ if (! $(this).hasClass("blockopen")) {
+ $(this).hide();
+ } else {
+ $(this).removeClass("blockopen");
+ }
+
+ // Add the "i" icon before the infoblock, incrementing the icon id for each block (in case there are multiple infoblocks on a page)
+ $(this).before('<i class="fa fa-info-circle icon-pointer" style="color: #337AB7; font-size:20px; margin-left: 10px; margin-bottom: 10px;" id="showinfo' + sfx.toString() + '" title="More information"></i>');
+ $(this).removeClass("infoblock");
+ $(this).addClass("infoblock" + sfx.toString());
+ sfx++;
+});
// Show the help on clicking the info icon
-$('#showinfo').click(function() {
- $('#infoblock').toggle();
+$('[id^="showinfo"]').click(function() {
+ var id = $(this).attr("id");
+
+ $('.' + "infoblock" + id.substr(8)).toggle();
+ document.getSelection().removeAllRanges(); // Ensure the text is un-selected (Chrome browser quirk)
});
+// ------------------------------------------------------------------------------------------------
// Put a dummy row into any empty table to keep IE happy
$('tbody').each(function(){
@@ -441,4 +464,160 @@ $('.container .panel-heading a[data-toggle="collapse"]').each(function (idx, el)
updateWidgets();
}
});
-}); \ No newline at end of file
+});
+
+ // Separator bar stuff ------------------------------------------------------------------------
+
+ // Globals
+ gColor = 'bg-info';
+ newSeperator = false;
+ saving = false;
+ dirty = false;
+
+ $("#addsep").prop('type' ,'button');
+
+ $("#addsep").click(function() {
+ if (newSeperator) {
+ return(false);
+ }
+
+ gColor = 'bg-info';
+ // Inset a temporary bar in which the user can enter some optional text
+ sepcols = $( "#ruletable tr th" ).length - 2;
+
+ $('#ruletable > tbody:last').append('<tr>' +
+ '<td class="' + gColor + '" colspan="' + sepcols + '"><input id="newsep" placeholder="' + svbtnplaceholder + '" class="col-md-12" type="text" /></td>' +
+ '<td class="' + gColor + '" colspan="2"><button class="btn btn-default btn-sm" id="btnnewsep">' + svtxt + '</button>' +
+ '<button class="btn btn-default btn-sm" id="btncncsep">' + cncltxt + '</button>' +
+ '&nbsp;&nbsp;&nbsp;&nbsp;' +
+ '&nbsp;&nbsp;<a id="sepclrblue" value="bg-info"><i class="fa fa-circle text-info icon-pointer"></i></a>' +
+ '&nbsp;&nbsp;<a id="sepclrred" value="bg-danger"><i class="fa fa-circle text-danger icon-pointer"></i></a>' +
+ '&nbsp;&nbsp;<a id="sepclrgreen" value="bg-success"><i class="fa fa-circle text-success icon-pointer"></i></a>' +
+ '&nbsp;&nbsp;<a id="sepclrorange" value="bg-warning"><i class="fa fa-circle text-warning icon-pointer"></i></button>' +
+ '</td></tr>');
+
+ $('#newsep').focus();
+ newSeperator = true;
+
+ $("#btnnewsep").prop('type' ,'button');
+
+ // Watch escape and enter keys
+ $('#newsep').keyup(function(e) {
+ if(e.which == 27) {
+ $('#btncncsep').trigger('click');
+ }
+ });
+
+ $('#newsep').keypress(function(e) {
+ if(e.which == 13) {
+ $('#btnnewsep').trigger('click');
+ }
+ });
+
+ handle_colors();
+
+ // Remove the temporary separator bar and replace it with the final version containing the
+ // user's text and a delete icon
+ $("#btnnewsep").click(function() {
+ var septext = escapeHtml($('#newsep').val());
+ sepcols = $( "#ruletable tr th" ).length - 1;
+
+ $('#ruletable > tbody:last >tr:last').remove();
+ $('#ruletable > tbody:last').append('<tr class="ui-sortable-handle separator">' +
+ '<td class="' + gColor + '" colspan="' + sepcols + '">' + '<span class="' + gColor + '">' + septext + '</span></td>' +
+ '<td class="' + gColor + '"><a href="#"><i class="fa fa-trash sepdel"></i></a>' +
+ '</td></tr>');
+
+ $('#order-store').removeAttr('disabled');
+ newSeperator = false;
+ dirty = true;
+ });
+
+ // Cancel button
+ $('#btncncsep').click(function(e) {
+ e.preventDefault();
+ $(this).parents('tr').remove();
+ newSeperator = false;
+ });
+ });
+
+ // Delete a separator row
+ $(function(){
+ $('table').on('click','tr a .sepdel',function(e){
+ e.preventDefault();
+ $(this).parents('tr').remove();
+ $('#order-store').removeAttr('disabled');
+ dirty = true;
+ });
+ });
+
+ // Compose an inout array containing the row #, color and text for each separator
+ function save_separators() {
+ var seprow = 0;
+ var sepinput;
+ var sepnum = 0;
+
+ $('#ruletable > tbody > tr').each(function() {
+ if ($(this).hasClass('separator')) {
+ seprow = $(this).prev('tr').attr("id");
+ if (seprow == undefined) {
+ seprow = "fr-1";
+ }
+
+ sepinput = '<input type="hidden" name="separator[' + sepnum + '][row]" value="' + seprow + '"></input>';
+ $('form').append(sepinput);
+ sepinput = '<input type="hidden" name="separator[' + sepnum + '][text]" value="' + escapeHtml($(this).find('td').text()) + '"></input>';
+ $('form').append(sepinput);
+ sepinput = '<input type="hidden" name="separator[' + sepnum + '][color]" value="' + $(this).find('td').prop('class') + '"></input>';
+ $('form').append(sepinput);
+ sepinput = '<input type="hidden" name="separator[' + sepnum + '][if]" value="' + iface + '"></input>';
+ $('form').append(sepinput);
+ sepnum++;
+ }
+
+ if ($(this).parent('tbody').hasClass('user-entries')) {
+ seprow++;
+ }
+ });
+ }
+
+ function reindex_rules(section) {
+ var row = 0;
+
+ section.find('tr').each(function() {
+ if(this.id) {
+ $(this).attr("id", "fr" + row);
+ row++;
+ }
+ })
+ }
+
+ function handle_colors() {
+ $('[id^=sepclr]').prop("type", "button");
+
+ $('[id^=sepclr]').click(function () {
+ var color = $(this).attr('value');
+ // Clear all the color classes
+ $(this).parent('td').prop('class', '');
+ $(this).parent('td').prev('td').prop('class', '');
+ // Install our new color class
+ $(this).parent('td').addClass(color);
+ $(this).parent('td').prev('td').addClass(color);
+ // Set the global color
+ gColor = color;
+ });
+ }
+
+ //JS equivalent to PHP htmlspecialchars()
+ function escapeHtml(text) {
+ var map = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#039;'
+ };
+
+ return text.replace(/[&<>"']/g, function(m) { return map[m]; });
+ }
+ // --------------------------------------------------------------------------------------------
diff --git a/src/usr/local/www/license.php b/src/usr/local/www/license.php
index 255f0ed..da79e4a 100644
--- a/src/usr/local/www/license.php
+++ b/src/usr/local/www/license.php
@@ -64,7 +64,7 @@ require("guiconfig.inc");
include("head.inc");
?>
<div class="panel panel-default">
- <div class="panel-heading"><h4><?=gettext("License")?></h4></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("License")?></h2></div>
<div class="panel-body">
<p>
<strong><?=$g['product_name']?><?=gettext(" is Copyright")?> &copy; <?=$g['product_copyright_years']?><?=gettext(" by ")?><?=$g['product_copyright']?><br />
@@ -118,11 +118,11 @@ include("head.inc");
FreeBSD (<a href="http://www.freebsd.org" target="_blank">http://www.freebsd.org</a>)<br />
<?=gettext("Copyright")?> &copy;<?=gettext("1992-2015 The FreeBSD Project. All rights reserved")?>.<br />
<br />
- <?=gettext("This product includes PHP, freely available from")?><a href="http://www.php.net/" target="_blank">http://www.php.net</a>.<br />
- <?=gettext("Copyright"); ?> &copy; <?=gettext("1999-2015 The PHP Group. All rights reserved.")?>.<br />
+ <?=gettext("This product includes PHP, freely available from")?> <a href="http://www.php.net/" target="_blank">http://www.php.net</a>.<br />
+ <?=gettext("Copyright"); ?> &copy; <?=gettext("1999-2015 The PHP Group. All rights reserved.")?><br />
<br />
- <?=gettext("LightTPD"); ?> (<a href="http://www.lighttpd.net" target="_blank">http://www.lighttpd.net)</a><br />
- <?=gettext("Copyright"); ?> &copy;<?=gettext("2004, Jan Knescke, incremental")?><jan@kneschke.de>
+ <?=gettext("nginx"); ?> (<a href="http://www.nginx.org" target="_blank">http://www.nginx.org)</a><br />
+ <?=gettext("Copyright"); ?> &copy;<?=gettext("2011-2015 Nginx, Inc.")?>
<?=gettext("All rights reserved.")?><br />
<br />
<?=gettext("ISC DHCP server ")?>(<a href="http://www.isc.org/products/DHCP/" target="_blank">http://www.isc.org/products/DHCP</a>)<br />
diff --git a/src/usr/local/www/load_balancer_monitor.php b/src/usr/local/www/load_balancer_monitor.php
index 89251ee..bdcfac8 100644
--- a/src/usr/local/www/load_balancer_monitor.php
+++ b/src/usr/local/www/load_balancer_monitor.php
@@ -118,7 +118,7 @@ if ($savemsg) {
}
if (is_subsystem_dirty('loadbalancer')) {
- print_info_box_np(gettext("The load balancer configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The load balancer configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
/* active tabs */
@@ -140,7 +140,7 @@ display_top_tabs($tab_array);
<th><?=gettext('Name')?></th>
<th><?=gettext('Type')?></th>
<th><?=gettext('Description')?></th>
- <th><?=gettext('Action')?></th>
+ <th><?=gettext('Actions')?></th>
</tr>
</thead>
<tbody>
diff --git a/src/usr/local/www/load_balancer_monitor_edit.php b/src/usr/local/www/load_balancer_monitor_edit.php
index 615064f..6ba0907 100644
--- a/src/usr/local/www/load_balancer_monitor_edit.php
+++ b/src/usr/local/www/load_balancer_monitor_edit.php
@@ -89,6 +89,10 @@ if (isset($id) && $a_monitor[$id]) {
$pconfig['options']['code'] = 200;
}
+if ($_GET['act'] = "dup") {
+ unset($id);
+}
+
$changedesc = gettext("Load Balancer: Monitor:") . " ";
$changecount = 0;
diff --git a/src/usr/local/www/load_balancer_pool.php b/src/usr/local/www/load_balancer_pool.php
index fee5f4b..183775a 100644
--- a/src/usr/local/www/load_balancer_pool.php
+++ b/src/usr/local/www/load_balancer_pool.php
@@ -128,11 +128,11 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
if (is_subsystem_dirty('loadbalancer')) {
- print_info_box_np(sprintf(gettext("The load balancer configuration has been changed%sYou must apply the changes in order for them to take effect."), "<br />"));
+ print_apply_box(gettext("The load balancer configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
/* active tabs */
@@ -157,7 +157,7 @@ display_top_tabs($tab_array);
<th><?=gettext('Port')?></th>
<th><?=gettext('Monitor')?></th>
<th><?=gettext('Description')?></th>
- <th></th>
+ <th><?=gettext('Actions')?></th>
</tr>
</thead>
<tbody>
diff --git a/src/usr/local/www/load_balancer_pool_edit.php b/src/usr/local/www/load_balancer_pool_edit.php
index b2ae2f4..b19cbe3 100644
--- a/src/usr/local/www/load_balancer_pool_edit.php
+++ b/src/usr/local/www/load_balancer_pool_edit.php
@@ -354,8 +354,8 @@ $section->addInput(new Form_Select(
'Mode',
$pconfig['mode'],
array(
- 'loadbalance' => 'Load Balance',
- 'failover' => 'Manual Failover'
+ 'loadbalance' => gettext('Load Balance'),
+ 'failover' => gettext('Manual Failover')
)
));
diff --git a/src/usr/local/www/load_balancer_setting.php b/src/usr/local/www/load_balancer_setting.php
index 57f96af..fe63c7d 100644
--- a/src/usr/local/www/load_balancer_setting.php
+++ b/src/usr/local/www/load_balancer_setting.php
@@ -131,8 +131,8 @@ if ($savemsg) {
}
if (is_subsystem_dirty('loadbalancer')) {
- print_info_box_np(gettext("The load balancer configuration has been changed") . ' ' .
- gettext("You must apply the changes in order for them to take effect."), 'Apply', null, false, 'danger');
+ print_apply_box(gettext("The load balancer configuration has been changed.") . ' ' .
+ gettext("You must apply the changes in order for them to take effect."));
}
/* active tabs */
diff --git a/src/usr/local/www/load_balancer_virtual_server.php b/src/usr/local/www/load_balancer_virtual_server.php
index f0fb0dd..b361106 100644
--- a/src/usr/local/www/load_balancer_virtual_server.php
+++ b/src/usr/local/www/load_balancer_virtual_server.php
@@ -128,11 +128,11 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
if (is_subsystem_dirty('loadbalancer')) {
- print_info_box_np(gettext("The virtual server configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The virtual server configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
/* active tabs */
@@ -158,7 +158,7 @@ display_top_tabs($tab_array);
<th><?=gettext('Pool'); ?></th>
<th><?=gettext('Fallback pool'); ?></th>
<th><?=gettext('Description'); ?></th>
- <th><!-- Action buttons --></th>
+ <th><?=gettext('Actions'); ?></th>
</tr>
</thead>
<tbody>
diff --git a/src/usr/local/www/pkg.php b/src/usr/local/www/pkg.php
index e08ca1c..8a26e20 100755
--- a/src/usr/local/www/pkg.php
+++ b/src/usr/local/www/pkg.php
@@ -71,21 +71,31 @@ $xml = $_REQUEST['xml'];
if ($xml == "") {
include("head.inc");
- print_info_box_np(gettext("ERROR: No valid package defined."));
+ print_info_box(gettext("ERROR: No valid package defined."));
include("foot.inc");
exit;
} else {
$pkg_xml_prefix = "/usr/local/pkg/";
$pkg_full_path = "{$pkg_xml_prefix}/{$xml}";
- if (substr_compare(realpath($pkg_full_path), $pkg_xml_prefix, 0, strlen($pkg_xml_prefix))) {
- print_info_box_np(gettext("ERROR: Invalid path specified."));
+ $pkg_realpath = realpath($pkg_full_path);
+ if (empty($pkg_realpath)) {
+ $path_error = sprintf(gettext("ERROR: Package path %s not found."), htmlspecialchars($pkg_full_path));
+ } else if (substr_compare($pkg_realpath, $pkg_xml_prefix, 0, strlen($pkg_xml_prefix))) {
+ $path_error = sprintf(gettext("ERROR: Invalid path %s specified."), htmlspecialchars($pkg_full_path));
+ }
+
+ if (!empty($path_error)) {
+ include("head.inc");
+ print_info_box($path_error . "<br />" . gettext("Try reinstalling the package."));
+ include("foot.inc");
die;
}
+
if (file_exists($pkg_full_path)) {
$pkg = parse_xml_config_pkg($pkg_full_path, "packagegui");
} else {
include("head.inc");
- print_info_box_np(gettext("File not found ") . htmlspecialchars($xml));
+ print_info_box(sprintf(gettext("File not found %s"), htmlspecialchars($xml)));
include("foot.inc");
exit;
}
@@ -254,7 +264,7 @@ if (isset($tab_array)) {
events.push(function() {
function setFilter(filtertext) {
- jQuery('#pkg_filter').val(filtertext);
+ $('#pkg_filter').val(filtertext);
document.pkgform.submit();
}
@@ -268,7 +278,7 @@ events.push(function() {
opacity: 0.8,
helper: function(e, ui) {
ui.children().each(function() {
- jQuery(this).width(jQuery(this).width());
+ $(this).width($(this).width());
});
return ui;
},
@@ -339,8 +349,8 @@ if ($savemsg) {
$display_maximum_rows = $field['display_maximum_rows'];
}
}
- echo "<tr><td colspan='$colspan' align='center'>";
- echo "Filter by: ";
+ echo "<tr><td colspan='$colspan' class='text-center'>";
+ echo gettext("Filter by: ");
$isfirst = true;
for ($char = 65; $char < 91; $char++) {
if (!$isfirst) {
@@ -350,9 +360,9 @@ if ($savemsg) {
$isfirst = false;
}
echo "</td></tr>";
- echo "<tr><td colspan='$colspan' align='center'>";
+ echo "<tr><td colspan='$colspan' class='text-center'>";
if ($field['sortablefields']) {
- echo "Filter field: <select name='pkg_filter_type'>";
+ echo gettext("Filter field: ") . "<select name='pkg_filter_type'>";
foreach ($field['sortablefields']['item'] as $si) {
if ($si['name'] == $_REQUEST['pkg_filter_type']) {
$SELECTED = "selected";
@@ -364,7 +374,7 @@ if ($savemsg) {
echo "</select>";
}
if ($include_filtering_inputbox) {
- echo "&nbsp;&nbsp;Filter text: <input id='pkg_filter' name='pkg_filter' value='" . $_REQUEST['pkg_filter'] . "' /><input type='submit' value='Filter' />";
+ echo "&nbsp;&nbsp;" . gettext("Filter text: ") . "<input id='pkg_filter' name='pkg_filter' value='" . $_REQUEST['pkg_filter'] . "' /><input type='submit' value='Filter' />";
}
echo "</td></tr><tr><td><font size='-3'>&nbsp;</font></td></tr>";
}
@@ -395,8 +405,8 @@ if ($savemsg) {
echo "<tr><th colspan='" . count($pkg['adddeleteeditpagefields']['columnitem']) . "'>";
echo "<table width='100%' summary=''>";
echo "<tr>";
- echo "<td align='left'>Displaying page $page of $totalpages</b></td>";
- echo "<td align='right'>Rows per page: <select onchange='document.pkgform.submit();' name='display_maximum_rows'>";
+ echo "<td class='text-left'>" . sprintf(gettext('Displaying page %1$s of %2$s'), $page, $totalpages) . "</b></td>";
+ echo "<td class='text-right'>" . gettext("Rows per page: ") . "<select onchange='document.pkgform.submit();' name='display_maximum_rows'>";
for ($x = 0; $x < 250; $x++) {
if ($x == $display_maximum_rows) {
$SELECTED = "selected";
@@ -524,14 +534,14 @@ if ($savemsg) {
<tr>
<?php
#Show custom description to edit button if defined
- $edit_msg=($pkg['adddeleteeditpagefields']['edittext']?$pkg['adddeleteeditpagefields']['edittext']:"Edit this item");
+ $edit_msg=($pkg['adddeleteeditpagefields']['edittext']?$pkg['adddeleteeditpagefields']['edittext']:gettext("Edit this item"));
?>
<td><a class="fa fa-pencil" href="pkg_edit.php?xml=<?=$xml?>&amp;act=edit&amp;id=<?=$i?>" title="<?=$edit_msg?>"></a></td>
<?php
#Show custom description to delete button if defined
- $delete_msg=($pkg['adddeleteeditpagefields']['deletetext']?$pkg['adddeleteeditpagefields']['deletetext']:"Delete this item");
+ $delete_msg=($pkg['adddeleteeditpagefields']['deletetext']?$pkg['adddeleteeditpagefields']['deletetext']:gettext("Delete this item"));
?>
- <td>&nbsp;<a class="fa fa-trash" href="pkg.php?xml=<?=$xml?>&amp;act=del&amp;id=<?=$i?>" title="<?=gettext("Delete")?>"></a></td>
+ <td>&nbsp;<a class="fa fa-trash" href="pkg.php?xml=<?=$xml?>&amp;act=del&amp;id=<?=$i?>" title="<?=$delete_msg?>"></a></td>
</tr>
</tbody>
</table>
@@ -546,27 +556,27 @@ if ($savemsg) {
$final_footer = "";
$final_footer .= "<tr><td colspan='$colcount'>";
$final_footer .= "<table width='100%' summary=''><tr>";
- $final_footer .= "<td align='left'>";
+ $final_footer .= "<td class='text-left'>";
$startingat = $startdisplayingat - $display_maximum_rows;
if ($startingat > -1) {
$final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat={$startingat}&amp;display_maximum_rows={$display_maximum_rows}'>";
} else if ($startdisplayingat > 1) {
$final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat=0&amp;display_maximum_rows={$display_maximum_rows}'>";
}
- $final_footer .= "<font size='2'><< Previous page</font></a>";
+ $final_footer .= "<font size='2'><< " . gettext("Previous page") . "</font></a>";
if ($tmppp + $display_maximum_rows > count($evaledvar)) {
$endingrecord = count($evaledvar);
} else {
$endingrecord = $tmppp + $display_maximum_rows;
}
- $final_footer .= "</td><td align='center'>";
+ $final_footer .= "</td><td class='text-center'>";
$tmppp++;
$final_footer .= "<font size='2'>Displaying {$tmppp} - {$endingrecord} / " . count($evaledvar) . " records";
- $final_footer .= "</font></td><td align='right'>&nbsp;";
+ $final_footer .= "</font></td><td class='text-right'>&nbsp;";
if (($i+1) < count($evaledvar)) {
$final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat=" . ($startdisplayingat + $display_maximum_rows) . "&amp;display_maximum_rows={$display_maximum_rows}'>";
}
- $final_footer .= "<font size='2'>Next page >></font></a>";
+ $final_footer .= "<font size='2'>" . gettext("Next page") . " >></font></a>";
$final_footer .= "</td></tr></table></td></tr>";
$i = count($evaledvar);
break;
@@ -584,9 +594,9 @@ if ($savemsg) {
<tr>
<?php
#Show custom description to add button if defined
- $add_msg=($pkg['adddeleteeditpagefields']['addtext']?$pkg['adddeleteeditpagefields']['addtext']:"Add a new item");
+ $add_msg=($pkg['adddeleteeditpagefields']['addtext']?$pkg['adddeleteeditpagefields']['addtext']:gettext("Add a new item"));
?>
- <td><a href="pkg_edit.php?xml=<?=$xml?>&amp;id=<?=$i?>" class="btn btn-sm btn-success"><?=gettext('Add')?></a></td>
+ <td><a href="pkg_edit.php?xml=<?=$xml?>&amp;id=<?=$i?>" class="btn btn-sm btn-success" title="<?=$add_msg?>"><?=gettext('Add')?></a></td>
<?php
#Show description button and info if defined
if ($pkg['adddeleteeditpagefields']['description']) {
diff --git a/src/usr/local/www/pkg_edit.php b/src/usr/local/www/pkg_edit.php
index 42ccc0a..2db6b6e 100644
--- a/src/usr/local/www/pkg_edit.php
+++ b/src/usr/local/www/pkg_edit.php
@@ -82,7 +82,7 @@ $xml_fullpath = realpath('/usr/local/pkg/' . $xml);
if ($xml == "" || $xml_fullpath === false || substr($xml_fullpath, 0, strlen('/usr/local/pkg/')) != '/usr/local/pkg/') {
include("head.inc");
- print_info_box_np(gettext("ERROR: No valid package defined."));
+ print_info_box(gettext("ERROR: No valid package defined."));
include("foot.inc");
die;
} else {
@@ -360,8 +360,8 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $description,
$grp->setHelp($description);
- if ($width) {
- $grp->setWidth($width);
+ if ($ewidth) {
+ $grp->setWidth($ewidth);
}
$group->add($grp);
@@ -624,7 +624,7 @@ if ($pkg['savetext'] != "") {
$savevalue = $pkg['savetext'];
}
-$savehelp = gettext("");
+$savehelp = "";
if ($pkg['savehelp'] != "") {
$savehelp = $pkg['savehelp'];
}
@@ -666,6 +666,9 @@ $js_array = array();
// Now loop through all of the fields defined in the XML
foreach ($pkg['fields']['field'] as $pkga) {
+ $action = "";
+ $uid = "";
+
if ($pkga['type'] == "sorting") {
continue;
}
@@ -684,7 +687,19 @@ foreach ($pkg['fields']['field'] as $pkga) {
$form->add($section);
}
- $section = new Form_Section(strip_tags($pkga['name']));
+ if (isset($pkga['collapse'])) {
+ $uid = uniqid("section");
+
+ $action = COLLAPSIBLE;
+
+ if ($pkga['collapse'] == "open") {
+ $action |= SEC_OPEN;
+ } else {
+ $action |= SEC_CLOSED;
+ }
+ }
+
+ $section = new Form_Section(strip_tags($pkga['name']), $uid, $action);
}
continue;
@@ -731,28 +746,26 @@ foreach ($pkg['fields']['field'] as $pkga) {
$value = base64_decode($value);
}
- if ($grouping) {
- $group->add(new Form_Input(
+ $grp = new Form_Input(
$pkga['fieldname'],
$pkga['fielddescr'],
'text',
$value
- ))->setHelp($pkga['description']);
+ );
+
+ $grp->setHelp($pkga['description']);
+
+ if ($pkga['width']) {
+ $grp->setWidth($pkga['width']);
+ }
+
+ if ($grouping) {
+ $group->add($grp);
} else {
if (isset($pkga['advancedfield']) && isset($advfield_count)) {
- $advanced->addInput(new Form_Input(
- $pkga['fieldname'],
- $pkga['fielddescr'],
- 'text',
- $value
- ))->setHelp($pkga['description']);
+ $advanced->addInput($grp);
} else {
- $section->addInput(new Form_Input(
- $pkga['fieldname'],
- $pkga['fielddescr'],
- 'text',
- $value
- ))->setHelp($pkga['description']);
+ $section->addInput($grp);
}
}
@@ -887,6 +900,9 @@ foreach ($pkg['fields']['field'] as $pkga) {
eval("\$pkg_source_txt = &$source_url;");
#check if show disable option is present on xml
+ if (!is_array($pkg_source_txt)) {
+ $pkg_source_txt = array();
+ }
if (isset($pkga['show_disable_value'])) {
array_push($pkg_source_txt,
array(($pkga['source_name']? $pkga['source_name'] : $pkga['name'])=> $pkga['show_disable_value'], ($pkga['source_value']? $pkga['source_value'] : $pkga['value'])=> $pkga['show_disable_value']));
@@ -1073,7 +1089,6 @@ foreach ($pkg['fields']['field'] as $pkga) {
$a_aliases = &$config['aliases']['alias'];
$addrisfirst = 0;
$aliasesaddr = "";
- $value = "value='{$value}'";
if (isset($a_aliases)) {
if (!empty($pkga['typealiases'])) {
@@ -1097,28 +1112,26 @@ foreach ($pkg['fields']['field'] as $pkga) {
}
}
- if (grouping) {
- $group->add(new Form_Input(
+ $grp = new Form_Input(
$pkga['fieldname'],
$pkga['fielddescr'],
'text',
$value
- ))->setHelp($pkga['description']);
+ );
+
+ $grp->setHelp($pkga['description']);
+
+ if ($pkga['width']) {
+ $grp->setWidth($pkga['width']);
+ }
+
+ if (grouping) {
+ $group->add($grp);
} else {
if (isset($pkga['advancedfield']) && isset($advfield_count)) {
- $advanced->addInput(new Form_Input(
- $pkga['fieldname'],
- $pkga['fielddescr'],
- 'text',
- $value
- ))->setHelp($pkga['description']);
+ $advanced->addInput($grp);
} else {
- $section->addInput(new Form_Input(
- $pkga['fieldname'],
- $pkga['fielddescr'],
- 'text',
- $value
- ))->setHelp($pkga['description']);
+ $section->addInput($grp);
}
}
@@ -1180,11 +1193,12 @@ foreach ($pkg['fields']['field'] as $pkga) {
sort($ips);
if (isset($pkga['showlistenall'])) {
- array_unshift($ips, array('ip' => 'All', 'description' => 'Listen on All interfaces/ip addresses '));
+ array_unshift($ips, array('ip' => gettext('All'), 'description' => gettext('Listen on All interfaces/ip addresses ')));
}
if (!preg_match("/$interface_regex/", "loopback")) {
- $iface_description=(isset($pkga['showips']) ? "127.0.0.1 (loopback)" : "loopback");
+ $loopback_text = gettext("loopback");
+ $iface_description=(isset($pkga['showips']) ? "127.0.0.1 (" . $loopback_text . ")" : $loopback_text);
array_push($ips, array('ip' => 'lo0', 'description' => $iface_description));
}
@@ -1476,7 +1490,7 @@ if (!empty($advanced)) {
print($form);
if ($pkg['note'] != "") {
- print_info_box($pkg['note']);
+ print_info_box($pkg['note'], 'info');
}
if ($pkg['custom_php_after_form_command']) {
@@ -1520,20 +1534,20 @@ if ($pkg['fields']['field'] != "") { ?>
<?php
foreach ($pkg['fields']['field'] as $field) {
if (isset($field['enablefields']) or isset($field['checkenablefields'])) {
- echo "\tif (jQuery('input[name=\"{$field['fieldname']}\"]').prop('checked') == false) {\n";
+ echo "\tif ($('input[name=\"{$field['fieldname']}\"]').prop('checked') == false) {\n";
if (isset($field['enablefields'])) {
foreach (explode(',', $field['enablefields']) as $enablefield) {
- echo "\t\tif (jQuery('input[name=\"{$enablefield}\"]').length > 0) {\n";
- echo "\t\t\tjQuery('input[name=\"{$enablefield}\"]').prop('disabled',true);\n";
+ echo "\t\tif ($('input[name=\"{$enablefield}\"]').length > 0) {\n";
+ echo "\t\t\t$('input[name=\"{$enablefield}\"]').prop('disabled',true);\n";
echo "\t\t}\n";
}
}
if (isset($field['checkenablefields'])) {
foreach (explode(',', $field['checkenablefields']) as $checkenablefield) {
- echo "\t\tif (jQuery('input[name=\"{$checkenablefield}\"]').length > 0) {\n";
- echo "\t\t\tjQuery('input[name=\"{$checkenablefield}\"]').prop('checked',true);\n";
+ echo "\t\tif ($('input[name=\"{$checkenablefield}\"]').length > 0) {\n";
+ echo "\t\t\t$('input[name=\"{$checkenablefield}\"]').prop('checked',true);\n";
echo "\t\t}\n";
}
}
@@ -1542,16 +1556,16 @@ if ($pkg['fields']['field'] != "") { ?>
if (isset($field['enablefields'])) {
foreach (explode(',', $field['enablefields']) as $enablefield) {
- echo "\t\tif (jQuery('input[name=\"{$enablefield}\"]').length > 0) {\n";
- echo "\t\t\tjQuery('input[name=\"{$enablefield}\"]').prop('disabled',false);\n";
+ echo "\t\tif ($('input[name=\"{$enablefield}\"]').length > 0) {\n";
+ echo "\t\t\t$('input[name=\"{$enablefield}\"]').prop('disabled',false);\n";
echo "\t\t}\n";
}
}
if (isset($field['checkenablefields'])) {
foreach (explode(',', $field['checkenablefields']) as $checkenablefield) {
- echo "\t\tif (jQuery('input[name=\"{$checkenablefield}\"]').length > 0) {\n";
- echo "\t\t\tjQuery('input[name=\"{$checkenablefield}\"]').prop('checked',false);\n";
+ echo "\t\tif ($('input[name=\"{$checkenablefield}\"]').length > 0) {\n";
+ echo "\t\t\t$('input[name=\"{$checkenablefield}\"]').prop('checked',false);\n";
echo "\t\t}\n";
}
}
diff --git a/src/usr/local/www/pkg_mgr.php b/src/usr/local/www/pkg_mgr.php
index 5f25564..ecc4cad 100644
--- a/src/usr/local/www/pkg_mgr.php
+++ b/src/usr/local/www/pkg_mgr.php
@@ -67,88 +67,122 @@ require_once("globals.inc");
require_once("guiconfig.inc");
require_once("pkg-utils.inc");
-/* if upgrade in progress, alert user */
+// if upgrade in progress, alert user
if (is_subsystem_dirty('packagelock')) {
$pgtitle = array(gettext("System"), gettext("Package Manager"));
include("head.inc");
- print_info_box_np("Please wait while packages are reinstalled in the background.");
+ print_info_box("Please wait while packages are reinstalled in the background.");
include("foot.inc");
exit;
}
-$pkg_info = get_pkg_info();
+// We are being called only to get the pacakge data, not to display anything
+if (($_REQUEST) && ($_REQUEST['ajax'])) {
+ print(get_pkg_table());
+ exit;
+}
-$pgtitle = array(gettext("System"), gettext("Package Manager"), gettext("Available Packages"));
+// THe content for the table of packages is created here and fetched by Ajax. This allows us to draw the page and dispay
+// any required messages while the table it being downloaded/populated. On very small/slow systems, that can take a while
+function get_pkg_table() {
-include("head.inc");
+ $pkg_info = get_pkg_info();
-$tab_array = array();
-$tab_array[] = array(gettext("Available Packages"), true, "pkg_mgr.php");
-$tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php");
-display_top_tabs($tab_array);
+ if (!$pkg_info) {
+ print("error");
+ exit;
+ }
-if ($pkg_info) {
- //Check categories
- $categories=array();
- foreach ($pkg_info as $pkg_data) {
- if (isset($pkg_data['categories'][0])) {
- $categories[$pkg_data['categories'][0]]++;
+ $pkgtbl = '<table id="pkgtable" class="table table-striped table-hover">' . "\n";
+ $pkgtbl .= '<thead>' . "\n";
+ $pkgtbl .= '<tr>' . "\n";
+ $pkgtbl .= '<th>' . gettext("Name") . "</th>\n";
+ $pkgtbl .= '<th>' . gettext("Version") . "</th>\n";
+ $pkgtbl .= '<th>' . gettext("Description") . "</th>\n";
+ $pkgtbl .= '<th></th>' . "\n";
+ $pkgtbl .= '</tr>' . "\n";
+ $pkgtbl .= '</thead>' . "\n";
+ $pkgtbl .= '<tbody>' . "\n";
+
+ foreach ($pkg_info as $index) {
+ if (isset($index['installed'])) {
+ continue;
}
- }
- ksort($categories, SORT_STRING|SORT_FLAG_CASE);
- $cm_count=0;
- $tab_array = array();
- $visible_categories=array();
- $categories_min_count=($g['pkg_categories_min_count'] ? $g['pkg_categories_min_count'] : 3);
- $categories_max_display=($g['pkg_categories_max_display'] ? $g['pkg_categories_max_display'] : 6);
-
- /* check selected category or define default category to show */
- if (isset($_REQUEST['category'])) {
- $menu_category = $_REQUEST['category'];
- } else if (isset($g['pkg_default_category'])) {
- $menu_category = $g['pkg_default_category'];
- } else {
- $menu_category = "All";
- }
+ $pkgtbl .= '<tr>' . "\n";
+ $pkgtbl .= '<td>' . "\n";
+
+ if ($index['www']) {
+ $pkgtbl .= '<a title="' . gettext("Visit official website") . '" target="_blank" href="' . htmlspecialchars($index['www']) . '">' . "\n";
+ }
+
+ $pkgtbl .= htmlspecialchars($index['shortname']);
+ $pkgtbl .= '</a>' . "\n";
+ $pkgtbl .= '</td>' . "\n";
+ $pkgtbl .= '<td>' . "\n";
- $menu_category = (isset($_REQUEST['category']) ? $_REQUEST['category'] : "All");
- $show_category = ($menu_category == "Other" || $menu_category == "All");
+ if (!$g['disablepackagehistory']) {
+ $pkgtbl .= '<a target="_blank" title="' . gettext("View changelog") . '" href="' . htmlspecialchars($index['changeloglink']) . '">' . "\n";
+ $pkgtbl .= htmlspecialchars($index['version']) . '</a>' . "\n";
+ } else {
+ $pkgtbl .= htmlspecialchars($index['version']);
+ }
+
+ $pkgtbl .= '</td>' . "\n";
+ $pkgtbl .= '<td>' . "\n";
+ $pkgtbl .= $index['desc'];
+
+ if (is_array($index['deps']) && count($index['deps'])) {
+ $pkgtbl .= '<br /><br />' . gettext("Package Dependencies") . ":<br/>\n";
+
+ foreach ($index['deps'] as $pdep) {
+ $pkgtbl .= '<a target="_blank" href="https://freshports.org/' . $pdep['origin'] . '">&nbsp;<i class="fa fa-paperclip"></i> ' . basename($pdep['origin']) . '-' . $pdep['version'] . '</a>&emsp;' . "\n";
+ }
+
+ $pkgtbl .= "\n";
+ }
+
+ $pkgtbl .= '</td>' . "\n";
+ $pkgtbl .= '<td>' . "\n";
+ $pkgtbl .= '<a title="' . gettext("Click to install") . '" href="pkg_mgr_install.php?id=' . $index['name'] . '" class="btn btn-success btn-sm">install</a>' . "\n";
- $tab_array[] = array(gettext("All"), $menu_category == "All" ? true : false, "pkg_mgr.php?category=All");
- foreach ($categories as $category => $c_count) {
- if ($c_count >= $categories_min_count && $cm_count <= $categories_max_display) {
- $tab_array[] = array(gettext($category) , $menu_category == $category ? true : false, "pkg_mgr.php?category={$category}");
- $visible_categories[]=$category;
- $cm_count++;
+ if (!$g['disablepackageinfo'] && $index['pkginfolink'] && $index['pkginfolink'] != $index['www']) {
+ $pkgtbl .= '<a target="_blank" title="' . gettext("View more information") . '" href="' . htmlspecialchars($index['pkginfolink']) . '" class="btn btn-default btn-sm">info</a>' . "\n";
}
+
+ $pkgtbl .= '</td>' . "\n";
+ $pkgtbl .= '</tr>' . "\n";
}
- $tab_array[] = array(gettext("Other Categories"), $menu_category == "Other" ? true : false, "pkg_mgr.php?category=Other");
+ $pkgtbl .= '</tbody>' . "\n";
+ $pkgtbl .= '</table>' . "\n";
-// if (count($categories) > 1)
-// display_top_tabs($tab_array);
+ return ($pkgtbl);
}
-if (!$pkg_info || !is_array($pkg_info)):
+$pgtitle = array(gettext("System"), gettext("Package Manager"), gettext("Available Packages"));
+include("head.inc");
+
+$tab_array = array();
+$tab_array[] = array(gettext("Available Packages"), true, "pkg_mgr.php");
+$tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php");
+display_top_tabs($tab_array);
?>
-<div class="alert alert-warning">
- <?=gettext("There are currently no packages available for installation.")?>
-</div>
-<?php else: ?>
-
-<div class="panel panel-default" id="search-panel">
- <div class="panel-heading"><?=gettext('Search')?>
- <span class="widget-heading-icon pull-right">
- <a data-toggle="collapse" href="#search-panel .panel-body" name="search-panel">
- <i class="fa fa-plus-circle"></i>
- </a>
- </span>
+<div class="panel panel-default" id="search-panel" style="display: none;">
+ <div class="panel-heading">
+ <h2 class="panel-title">
+ <?=gettext('Search')?>
+ <span class="widget-heading-icon pull-right">
+ <a data-toggle="collapse" href="#search-panel_panel-body">
+ <i class="fa fa-plus-circle"></i>
+ </a>
+ </span>
+ </h2>
</div>
- <div class="panel-body collapse in">
+ <div id="search-panel_panel-body" class="panel-body collapse in">
<div class="form-group">
<label class="col-sm-2 control-label">
- Search term
+ <?=gettext("Search term")?>
</label>
<div class="col-sm-5"><input class="form-control" name="searchstr" id="searchstr" type="text"/></div>
<div class="col-sm-2">
@@ -159,11 +193,11 @@ if (!$pkg_info || !is_array($pkg_info)):
</select>
</div>
<div class="col-sm-3">
- <a id="btnsearch" type="button" title="<?=gettext("Search")?>" class="btn btn-primary btn-sm"><?=gettext("Search")?></a>
- <a id="btnclear" type="button" title="<?=gettext("Clear")?>" class="btn btn-default btn-sm"><?=gettext("Clear")?></a>
+ <a id="btnsearch" title="<?=gettext("Search")?>" class="btn btn-primary btn-sm"><?=gettext("Search")?></a>
+ <a id="btnclear" title="<?=gettext("Clear")?>" class="btn btn-default btn-sm"><?=gettext("Clear")?></a>
</div>
<div class="col-sm-10 col-sm-offset-2">
- <span class="help-block">Enter a search string or *nix regular expression to search package names and descriptions.</span>
+ <span class="help-block"><?=gettext('Enter a search string or *nix regular expression to search package names and descriptions.')?></span>
</div>
</div>
</div>
@@ -171,81 +205,20 @@ if (!$pkg_info || !is_array($pkg_info)):
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?=gettext('Packages')?></h2></div>
- <div class="panel-body table-responsive">
- <table id="pkgtable" class="table table-striped table-hover">
- <thead>
- <tr>
- <th><?=gettext("Name")?></th>
-<?php if (!$g['disablepackagehistory']):?>
- <th><?=gettext("Version")?></th>
-<?php endif;?>
-
- <th><?=gettext("Description")?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
-<?php
-
- foreach ($pkg_info as $index):
- if (isset($index['installed'])) {
- continue;
- }
-
- if ($menu_category != "All" && $index['categories'][0] != $menu_category && !($menu_category == "Other" && !in_array($index['categories'][0], $visible_categories))) {
- continue;
- }
-
-?>
- <tr>
- <td>
-<?php if ($index['www']):?>
- <a title="<?=gettext("Visit official website")?>" target="_blank" href="<?=htmlspecialchars($index['www'])?>">
-<?php endif; ?>
- <?=htmlspecialchars($index['shortname'])?>
- </a>
- </td>
+ <div id="pkgtbl" class="panel-body table-responsive">
+ <div id="waitmsg">
+ <?=print_info_box(gettext("Please wait while the list of packages is retrieved and formatted") . '&nbsp;<i class="fa fa-cog fa-spin"></i>')?>
+ </div>
-<?php
- if (!$g['disablepackagehistory']):
-?>
- <td>
- <?=htmlspecialchars($index['version'])?>
- </td>
-<?php
- endif;
-?>
- <td>
- <?=$index['desc']?>
-<?php if (is_array($index['deps']) && count($index['deps'])): ?>
- <br /><br /><?= gettext("Package Dependencies") ?>:
- <?php foreach ($index['deps'] as $pdep): ?>
- <br /><i class="fa fa-paperclip"></i> <?= basename($pdep['origin']) ?>-<?= $pdep['version'] ?>
- <?php endforeach; ?>
-<?php endif; ?>
- </td>
- <td>
- <a title="<?=gettext("Click to install")?>" href="pkg_mgr_install.php?id=<?=$index['name']?>" class="btn btn-success btn-sm">install</a>
-<?php
- if (!$g['disablepackageinfo'] && $index['pkginfolink'] && $index['pkginfolink'] != $index['www']):
-?>
- <a target="_blank" title="<?=gettext("View more information")?>" href="<?=htmlspecialchars($index['pkginfolink'])?>" class="btn btn-default btn-sm">info</a>
-<?php
- endif;
-?>
- </td>
- </tr>
-<?php
- endforeach;
-endif;
-?>
- </tbody>
- </table>
+ <div id="errmsg" style="display: none;">
+ <?=print_info_box("<ul><li>" . gettext("Error: Unable to retrieve package information.") . "</li></ul>", 'danger')?>
+ </div>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
+
events.push(function() {
// Initial state & toggle icons of collapsed panel
@@ -285,7 +258,7 @@ events.push(function() {
$(this).show();
}
} else {
- $(this).show(); // A blank search string shows all
+ $(this).show(); // A blank search string shows all
}
});
});
@@ -307,8 +280,33 @@ events.push(function() {
$("#btnsearch").get(0).click();
}
});
+
+ // Retrieve the table formatted pacakge information and display it in the "Packages" panel
+ // (Or display an appropriate error message)
+ var ajaxRequest;
+
+ $.ajax({
+ url: "/pkg_mgr.php",
+ type: "post",
+ data: { ajax: "ajax"},
+ success: function(data) {
+ if (data == "error") {
+ $('#waitmsg').hide();
+ $('#errmsg').show();
+ } else {
+ $('#pkgtbl').html(data);
+ $('#search-panel').show();
+ }
+ },
+ error: function() {
+ $('#waitmsg').hide();
+ $('#errmsg').show();
+ }
+ });
+
});
//]]>
</script>
<?php include("foot.inc");
+?>
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php
index d702beb..1518ec0 100644
--- a/src/usr/local/www/pkg_mgr_install.php
+++ b/src/usr/local/www/pkg_mgr_install.php
@@ -123,21 +123,31 @@ if ($_REQUEST['ajax']) {
if ($logfile != FALSE) {
$resparray = array();
$statusarray = array();
+ $code = array();
// Log file is read a line at a time so that we can detect/modify certain entries
while (($logline = fgets($logfile)) !== false) {
// Check for return codes and replace with suitable strings
- if (strpos($logline, "_RC=") != false) {
- $code = str_replace("__RC=", "", $logline);
+ if (strpos($logline, "__RC=") !== false) {
+ $code = explode(" ", $logline);
- if ($code == 0) {
+ $rc = str_replace("__RC=", "", $code[0]);
+
+ if (count($code) > 1 &&
+ strpos($code[1], "REBOOT_AFTER") !== false) {
+ $statusarray['reboot_needed'] = "yes";
+ } else {
+ $statusarray['reboot_needed'] = "no";
+ }
+
+ if ($rc == 0) {
$logline = gettext("Success") . "\n";
} else {
$logline = gettext("Failed") . "\n";
}
$response .= $logline;
- $statusarray = array('exitstatus' => $code);
+ $statusarray['exitstatus'] = $rc;
} else {
$response .= htmlspecialchars($logline);
}
@@ -224,7 +234,7 @@ if ($_POST) {
case 'reinstallall':
$headline = gettext("Reinstall all packages");
case 'reinstallpkg':
- if ($_GET['from'] && $_GET['from']) {
+ if ($_GET['from'] && $_GET['to']) {
$headline = gettext("Upgrade package");
} else {
$headline = gettext("Reinstall package");
@@ -243,13 +253,13 @@ if ($_POST) {
if ($_GET && $_GET['id'] == "firmware") {
$firmwareupdate = true;
$firmwareversion = get_system_pkg_version();
- $headline = gettext("System update") ;
+ $headline = gettext("System Update") ;
}
$tab_array = array();
-if ($firmwareupdate) {
- $pgtitle = array(gettext("System"), gettext("Update"), $headline);
+if ($firmwareupdate || ($_POST['id'] == "firmware")) {
+ $pgtitle = array(gettext("System"), gettext("Update"));
$tab_array[] = array(gettext("System Update"), true, "");
$tab_array[] = array(gettext("Update Settings"), false, "system_update_settings.php");
} else {
@@ -282,38 +292,41 @@ if ($input_errors) {
switch ($pkgmode) {
case 'reinstallpkg':
- $pkgtxt = 'reinstalled';
+ $pkgtxt = sprintf(gettext('Package <b>%s</b> will be reinstalled'), $pkgname);
break;
case 'delete':
- $pkgtxt = 'removed';
+ $pkgtxt = sprintf(gettext('Package <b>%s</b> will be removed'), $pkgname);
break;
+ case 'installed':
default:
- $pkgtxt = $pkgmode;
+ $pkgtxt = sprintf(gettext('Package <b>%s</b> will be installed'), $pkgname);
break;
}
?>
<br />
<div class="panel panel-default">
<div class="panel-heading">
+ <h2 class="panel-title">
<?php
if ($pkgmode == 'reinstallall') {
?>
<?=gettext("All packages will be reinstalled.");?>
<?php
- } else if ($_GET['from'] && $_GET['from']) {
+ } else if ($_GET['from'] && $_GET['to']) {
?>
- Package: <b><?=$pkgname;?></b> will be upgraded from <b><?=$_GET['from']?></b> to <b><?=$_GET['to']?></b>.
+ <?=sprintf(gettext('Package: %1$s will be upgraded from %2$s to %3$s.'), '<b>' . $pkgname . '</b>', '<b>' . $_GET['from'] . '</b>', '<b>' . $_GET['to'] . '</b>')?>
<?php
} else if ($firmwareupdate) {
?>
- <?=$g['product_name']?> <?=gettext(" system update")?>
+ <?=$g['product_name']?> <?=gettext(" System Update")?>
<?php
} else {
?>
- Package: <b><?=$pkgname;?></b> will be <?=$pkgtxt;?>.
+ <?=$pkgtxt;?>.
<?php
}
?>
+ </h2>
</div>
<div class="panel-body">
<br />
@@ -343,7 +356,7 @@ if ($input_errors) {
?>
<div class="form-group">
<label class="col-sm-2 control-label">
- <?=gettext("Confirm Upgrade")?>
+ <?=gettext("Confirm Update")?>
</label>
<div class="col-sm-10">
<input type="hidden" name="id" value="firmware" />
@@ -374,15 +387,33 @@ if ($input_errors) {
<?php endif;
if ($firmwareupdate && !$firmwareversion) {
- print_info_box(gettext("Unable to retrieve system versions"), danger);
+ print_info_box(gettext("Unable to retrieve system versions"), 'danger');
+}
+
+if ($_POST) {
+ $pkgid = str_replace(array("<", ">", ";", "&", "'", '"', '.', '/'), "", htmlspecialchars_decode($_POST['id'], ENT_QUOTES | ENT_HTML401));
+ if ($pkgid == "firmware") {
+ $logfilename = $g['cf_conf_path'] . '/upgrade_log';
+ } else {
+ $logfilename = $g['cf_conf_path'] . '/pkg_log_' . $pkgid;
+ }
}
if ($_POST['mode'] == 'delete') {
- $modetxt = gettext("removal");
+ $panel_heading_txt = gettext("Package removal");
+ $pkg_success_txt = sprintf(gettext('<b>%1$s</b> removal successfully completed'), $pkgid);
+ $pkg_fail_txt = sprintf(gettext('<b>%1$s</b> removal failed!'), $pkgid);
+ $pkg_wait_txt = sprintf(gettext('Please wait while the removal of <b>%1$s</b> completes.'), $pkgid);
} else if (($_POST['mode'] == 'reinstallpkg') || ($_POST['mode'] == 'reinstallall')) {
- $modetxt = gettext("reinstallation");
+ $panel_heading_txt = gettext("Package reinstallation");
+ $pkg_success_txt = sprintf(gettext('<b>%1$s</b> reinstallation successfully completed'), $pkgid);
+ $pkg_fail_txt = sprintf(gettext('<b>%1$s</b> reinstallation failed!'), $pkgid);
+ $pkg_wait_txt = sprintf(gettext('Please wait while the reinstallation of <b>%1$s</b> completes.'), $pkgid);
} else {
- $modetxt = gettext("installation");
+ $panel_heading_txt = gettext("Package installation");
+ $pkg_success_txt = sprintf(gettext('<b>%1$s</b> installation successfully completed'), $pkgid);
+ $pkg_fail_txt = sprintf(gettext('<b>%1$s</b> installation failed!'), $pkgid);
+ $pkg_wait_txt = sprintf(gettext('Please wait while the installation of <b>%1$s</b> completes.'), $pkgid);
}
if (!empty($_POST['id']) || $_POST['mode'] == "reinstallall"):
@@ -396,6 +427,7 @@ if (!empty($_POST['id']) || $_POST['mode'] == "reinstallall"):
<input type="hidden" name="id" value="<?=htmlspecialchars($_POST['id'])?>" />
<input type="hidden" name="mode" value="<?=htmlspecialchars($_POST['mode'])?>" />
<input type="hidden" name="completed" value="true" />
+ <input type="hidden" id="reboot_needed" name="reboot_needed" value="no" />
<div id="countdown" class="text-center"></div>
@@ -410,7 +442,7 @@ if (!empty($_POST['id']) || $_POST['mode'] == "reinstallall"):
<h2 class="panel-title" id="status"><?=gettext("Updating system")?></h2>
<?php } else {
?>
- <h2 class="panel-title" id="status"><?=gettext("Package") . " " . $modetxt?></h2>
+ <h2 class="panel-title" id="status"><?=$panel_heading_txt?></h2>
<?php } ?>
</div>
@@ -428,16 +460,12 @@ if (!empty($_POST['id']) || $_POST['mode'] == "reinstallall"):
ob_flush();
-if ($_POST) {
- $pkgid = str_replace(array("<", ">", ";", "&", "'", '"', '.', '/'), "", htmlspecialchars_decode($_POST['id'], ENT_QUOTES | ENT_HTML401));
-}
-
if ($_POST && ($_POST['completed'] != "true")) {
/* Write out configuration to create a backup prior to pkg install. */
write_config(gettext("Creating restore point before package installation."));
$progbar = true;
- $upgrade_script = "/usr/local/sbin/{$g['product_name']}-upgrade -y -l {$g['tmp_path']}/webgui-log.txt -p {$g['tmp_path']}/webgui-log.sock";
+ $upgrade_script = "/usr/local/sbin/{$g['product_name']}-upgrade -y -l {$logfilename}.txt -p {$g['tmp_path']}/{$g['product_name']}-upgrade.sock";
switch ($_POST['mode']) {
case 'delete':
@@ -473,7 +501,8 @@ if ($_POST && ($_POST['completed'] != "true")) {
// $_POST['completed'] just means that we are refreshing the page to update any new menu items
// that were installed
if ($_POST && $_POST['completed'] == "true"):
- if ($pkgid == 'firmware'):
+ unlink_if_exists($logfilename . ".json");
+ if (($pkgid == 'firmware') && ($_POST['reboot_needed'] == "yes")):
?>
<script>
//<![CDATA[
@@ -507,9 +536,9 @@ function show_success() {
$('#final').removeClass("alert-info").addClass("alert-success");
if ("<?=$_POST['mode']?>" != "reinstallall") {
if ("<?=$pkgid?>" == "firmware") {
- $('#final').html("<b>" + "System update" + " " + "<?=gettext(' successfully completed')?>");
+ $('#final').html("<b>" + "<?=gettext('System update successfully completed')?>" + "</b>");
} else {
- $('#final').html("<b>" + "<?=$pkgid?>" + " </b>" + "<?=$modetxt?>" + " " + "<?=gettext(' successfully completed')?>");
+ $('#final').html("<?=$pkg_success_txt?>");
}
} else {
$('#final').html("<?=gettext('Reinstallation of all packages successfully completed')?>");
@@ -520,9 +549,10 @@ function show_success() {
// Display a failure banner
function show_failure() {
+ $('#final').removeClass("alert-info");
$('#final').addClass("alert-danger");
if ("<?=$_POST['mode']?>" != "reinstallall") {
- $('#final').html("<?=$pkgid?>" + " " + "<?=$modetxt?>" + " " + "<?=gettext(' failed!')?>");
+ $('#final').html("<?=$pkg_fail_txt?>");
} else {
$('#final').html("<?=gettext('Reinstallation of all packages failed')?>");
}
@@ -533,10 +563,10 @@ function show_failure() {
function show_info() {
$('#final').addClass("alert-info");
if ("<?=$_POST['mode']?>" != "reinstallall") {
- $('#final').html("Please wait while the " + "<?=$modetxt?>" + " of " + "<?=$pkgid?>" + " " + "completes." + "<br />" +
+ $('#final').html("<?=$pkg_wait_txt?>" + "<br />" +
"<?=gettext("(Some packages may take several minutes!)")?>");
} else {
- $('#final').html("Please wait while the reinstallation of all packages completes." + "<br />" +
+ $('#final').html("<?=gettext('Please wait while the reinstallation of all packages completes.')?>" + "<br />" +
"<?=gettext("(Some packages may take several minutes!)")?>");
}
$('#final').show();
@@ -553,7 +583,7 @@ function getLogsStatus() {
url: "pkg_mgr_install.php",
type: "post",
data: { ajax: "ajax",
- logfilename: "<?=$g['tmp_path'];?>/webgui-log",
+ logfilename: "<?=$logfilename?>",
next_log_line: "0"
}
});
@@ -564,6 +594,8 @@ function getLogsStatus() {
json = jQuery.parseJSON(response);
+// alert("JSON data: " + JSON.stringify(json));
+
if (json.log != "not ready") {
// Write the log file to the "output" textarea
$('#output').html(json.log);
@@ -595,6 +627,11 @@ function getLogsStatus() {
if ((json.pid == "stopped") && (progress == 0) && (json.exitstatus == 0)) {
show_success();
repeat = false;
+
+ if (json.reboot_needed == "yes") {
+ $('#reboot_needed').val("yes");
+ }
+
$('form').submit();
}
@@ -615,7 +652,6 @@ function scrollToBottom() {
$('#output').scrollTop($('#output')[0].scrollHeight);
}
-var timeoutmsg = '<h4>Rebooting<br />Page will automatically reload in ';
var time = 0;
function checkonline() {
@@ -630,17 +666,23 @@ function checkonline() {
function startCountdown() {
setInterval(function() {
+ if (time == "<?=$guitimeout?>") {
+ $('#countdown').html('<h4><?=sprintf(gettext("Rebooting%sPage will automatically reload in %s seconds"), "<br />", "<span id=\"secs\"></span>");?></h4>');
+ }
+
if (time > 0) {
- $('#countdown').html(timeoutmsg + time + ' seconds.</h4>');
+ $('#secs').html(time);
time--;
} else {
time = "<?=$guiretry?>";
- timeoutmsg = '<h4>Not yet ready<br />Retrying in another ';
+ $('#countdown').html('<h4><?=sprintf(gettext("Not yet ready%s Retrying in another %s seconds"), "<br />", "<span id=\"secs\"></span>");?></h4>');
+ $('#secs').html(time);
checkonline();
}
}, 1000);
}
+
events.push(function() {
if ("<?=$start_polling?>") {
setTimeout(getLogsStatus, 1000);
@@ -651,6 +693,7 @@ events.push(function() {
// we only meed to re-populate the progress indicator and the status banner
if ("<?=$_POST['completed']?>" == "true") {
setProgress('progressbar', 100, false);
+ $('#progressbar').addClass("progress-bar-success");
show_success();
setTimeout(scrollToBottom, 200);
}
diff --git a/src/usr/local/www/pkg_mgr_installed.php b/src/usr/local/www/pkg_mgr_installed.php
index 604ad92..93fd475 100644
--- a/src/usr/local/www/pkg_mgr_installed.php
+++ b/src/usr/local/www/pkg_mgr_installed.php
@@ -67,13 +67,12 @@ require_once("pkg-utils.inc");
if (is_subsystem_dirty('packagelock')) {
$pgtitle = array(gettext("System"), gettext("Package Manager"));
include("head.inc");
- print_info_box_np("Please wait while packages are reinstalled in the background.");
+ print_info_box("Please wait while packages are reinstalled in the background.");
include("foot.inc");
exit;
}
$pgtitle = array(gettext("System"), gettext("Package Manager"), gettext("Installed Packages"));
-
include("head.inc");
$tab_array = array();
@@ -94,9 +93,9 @@ if (empty($installed_packages)):?>
<div class="alert alert-warning">
<?=gettext("There are no packages currently installed.")?>
</div>
-<?php else: ?>
+<?php else:?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title"><?=gettext('Installed packages')?></h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Installed Packages')?></h2></div>
<div class="table-responsive">
<table class="table table-striped table-hover table-condensed">
<thead>
@@ -126,40 +125,40 @@ if (empty($installed_packages)):?>
// package is configured, but does not exist in the system
$txtcolor = "text-danger";
$missing = true;
- $status = 'Package is configured, but not installed!';
+ $status = gettext('Package is configured, but not installed!');
} else if (isset($pkg['installed_version']) && isset($pkg['version'])) {
$version_compare = pkg_version_compare($pkg['installed_version'], $pkg['version']);
if ($version_compare == '>') {
// we're running a newer version of the package
- $status = 'Newer than available ('. $pkg['version'] .')';
+ $status = sprintf(gettext('Newer than available (%s)'), $pkg['version']);
} else if ($version_compare == '<') {
// we're running an older version of the package
- $status = 'Upgrade available to '.$pkg['version'];
+ $status = sprintf(gettext('Upgrade available to %s'), $pkg['version']);
$txtcolor = "text-warning";
$upgradeavail = true;
$vergetstr = '&amp;from=' . $pkg['installed_version'] . '&amp;to=' . $pkg['version'];
} else if ($version_compare == '=') {
// we're running the current version
- $status = 'Up-to-date';
+ $status = gettext('Up-to-date');
} else {
- $status = 'Error comparing version';
+ $status = gettext('Error comparing version');
}
} else {
// unknown available package version
- $status = 'Unknown';
+ $status = gettext('Unknown');
$statusicon = 'question';
}
?>
<tr>
<td>
-<?php if ($upgradeavail) { ?>
+<?php if ($upgradeavail):?>
<a title="<?=$status?>" href="pkg_mgr_install.php?mode=reinstallpkg&amp;pkg=<?=$pkg['name']?><?=$vergetstr?>" class="fa fa-refresh"></a>
-<?php } else if ($missing) { ?>
- <font color="red"><i title="<?=$status?>" class="fa fa-exclamation"></i></font>
-<?php } else { ?>
+<?php elseif ($missing):?>
+ <span class="text-danger"><i title="<?=$status?>" class="fa fa-exclamation"></i></span>
+<?php else:?>
<i title="<?=$status?>" class="fa fa-check"></i>
-<?php } ?>
+<?php endif;?>
</td>
<td>
<span class="<?=$txtcolor?>"><?=$pkg['shortname']?></span>
@@ -170,32 +169,33 @@ if (empty($installed_packages)):?>
<td>
<?php if (!$g['disablepackagehistory']):?>
<a target="_blank" title="<?=gettext("View changelog")?>" href="<?=htmlspecialchars($pkg['changeloglink'])?>">
-<?php endif;?>
+ <?=htmlspecialchars($pkg['installed_version'])?></a>
+<?php else:?>
<?=htmlspecialchars($pkg['installed_version'])?>
-<?php if (!$g['disablepackagehistory']):?>
- </a>
<?php endif;?>
</td>
<td>
<?=$pkg['desc']?>
-<?php if (is_array($pkg['deps']) && count($pkg['deps'])): ?>
- <br /><br /><?= gettext("Package Dependencies") ?>:
- <?php foreach ($pkg['deps'] as $pdep): ?>
- <br /><i class="fa fa-paperclip"></i> <?= basename($pdep['origin']) ?>-<?= $pdep['version'] ?>
- <?php endforeach; ?>
-<?php endif; ?>
+<?php if (is_array($pkg['deps']) && count($pkg['deps'])):?>
+ <br /><br /><?= gettext("Package Dependencies")?>:<br/>
+ <?php foreach ($pkg['deps'] as $pdep):?>
+ <a target="_blank" href="https://freshports.org/<?=$pdep['origin']?>">&nbsp;<i class="fa fa-paperclip"></i> <?= basename($pdep['origin']) . '-' . $pdep['version']?></small></a>&emsp;
+ <?php endforeach;?>
+<?php endif;?>
</td>
<td>
- <a title="<?=gettext("Remove")?>" href="pkg_mgr_install.php?mode=delete&amp;pkg=<?=$pkg['name']?>" class="fa fa-trash"></a>
-<?php if ($upgradeavail) { ?>
- <a title="<?=gettext("Update")?>" href="pkg_mgr_install.php?mode=reinstallpkg&amp;pkg=<?=$pkg['name']?><?=$vergetstr?>" class="fa fa-refresh"></a>
-<?php } else { ?>
- <a title="<?=gettext("Reinstall")?>" href="pkg_mgr_install.php?mode=reinstallpkg&amp;pkg=<?=$pkg['name']?>" class="fa fa-retweet"></a>
-<?php } ?>
+ <div class="row">
+ <a title="<?=sprintf(gettext("Remove package %s"), $pkg['name'])?>" href="pkg_mgr_install.php?mode=delete&amp;pkg=<?=$pkg['name']?>" class="fa fa-trash"></a>
+<?php if ($upgradeavail):?>
+ <a title="<?=sprintf(gettext("Update package %s"), $pkg['name'])?>" href="pkg_mgr_install.php?mode=reinstallpkg&amp;pkg=<?=$pkg['name']?><?=$vergetstr?>" class="fa fa-refresh"></a>
+<?php else:?>
+ <a title="<?=sprintf(gettext("Reinstall package %s"), $pkg['name'])?>" href="pkg_mgr_install.php?mode=reinstallpkg&amp;pkg=<?=$pkg['name']?>" class="fa fa-retweet"></a>
+<?php endif;?>
<?php if (!isset($g['disablepackageinfo']) && $pkg['www'] != 'UNKNOWN'):?>
- <a target="_blank" title="<?=gettext("View more information")?>" href="<?=htmlspecialchars($pkg['www'])?>" class="fa fa-info"></a>
-<?php endif; ?>
+ <a target="_blank" title="<?=gettext("View more information")?>" href="<?=htmlspecialchars($pkg['www'])?>" class="fa fa-info"></a>
+<?php endif;?>
+ </div>
</td>
</tr>
<?php endforeach;?>
@@ -206,13 +206,13 @@ if (empty($installed_packages)):?>
<br />
<div class="text-center">
<p>
- <i class="fa fa-refresh"></i> = Update &nbsp;
- <i class="fa fa-check"></i> = Current &nbsp;
+ <i class="fa fa-refresh"></i> = <?=gettext('Update')?> &nbsp;
+ <i class="fa fa-check"></i> = <?=gettext('Current')?> &nbsp;
</p>
<p>
- <i class="fa fa-trash"></i> = Remove &nbsp;
- <i class="fa fa-info"></i> = Information &nbsp;
- <i class="fa fa-retweet"></i> = Reinstall
+ <i class="fa fa-trash"></i> = <?=gettext('Remove')?> &nbsp;
+ <i class="fa fa-info"></i> = <?=gettext('Information')?> &nbsp;
+ <i class="fa fa-retweet"></i> = <?=gettext('Reinstall')?>
</p>
<p><span class="text-warning"><?=gettext("Newer version available")?></span></p>
<p><span class="text-danger"><?=gettext("Package is configured but not (fully) installed")?></span></p>
diff --git a/src/usr/local/www/services_captiveportal.php b/src/usr/local/www/services_captiveportal.php
index 5289cf1..21eacd2 100644
--- a/src/usr/local/www/services_captiveportal.php
+++ b/src/usr/local/www/services_captiveportal.php
@@ -93,7 +93,7 @@ if (!is_array($config['captiveportal'])) {
}
$a_cp =& $config['captiveportal'];
-$pgtitle = array(gettext("Services"), gettext("Captive Portal"), "Zone " . $a_cp[$cpzone]['zone'], gettext("Configuration"));
+$pgtitle = array(gettext("Services"), gettext("Captive Portal"), sprintf(gettext("Zone %s"), $a_cp[$cpzone]['zone']), gettext("Configuration"));
$shortcut_section = "captiveportal";
if ($_GET['act'] == "viewhtml") {
@@ -567,6 +567,7 @@ $tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_fil
display_top_tabs($tab_array, true);
$form = new Form();
+$form->setMultipartEncoding();
$section = new Form_Section('Captive Portal Configuration');
@@ -753,6 +754,7 @@ $section->addInput(new Form_Checkbox(
));
$group = new Form_Group('RADIUS protocol');
+$group->addClass("radiusproto");
$group->add(new Form_Checkbox(
'radius_protocol',
@@ -917,22 +919,33 @@ $group = new Form_Group('Accounting updates');
$group->add(new Form_Checkbox(
'reauthenticateacct',
null,
- 'No Accounting updates',
- !$pconfig['reauthenticateacct']
+ 'No updates',
+ $pconfig['reauthenticateacct'] == "",
+ ""
))->displayasRadio();
$group->add(new Form_Checkbox(
'reauthenticateacct',
null,
- 'Stop/start Accounting',
- $pconfig['reauthenticateacct'] == 'stopstart'
+ 'Stop/Start',
+ $pconfig['reauthenticateacct'] == 'stopstart',
+ "stopstart"
))->displayasRadio();
$group->add(new Form_Checkbox(
'reauthenticateacct',
null,
- 'Interim update',
- $pconfig['reauthenticateacct'] == 'interimupdate'
+ 'Stop/Start (FreeRADIUS)',
+ $pconfig['reauthenticateacct'] == 'stopstartfreeradius',
+ "stopstartfreeradius"
+))->displayasRadio();
+
+$group->add(new Form_Checkbox(
+ 'reauthenticateacct',
+ null,
+ 'Interim',
+ $pconfig['reauthenticateacct'] == 'interimupdate',
+ "interimupdate"
))->displayasRadio();
$section->add($group);
@@ -983,7 +996,7 @@ $section->addInput(new Form_Select(
'radiusvendor',
'Type',
$pconfig['radiusvendor'],
- ['default' => 'default', 'cisco' => 'cisco']
+ ['default' => gettext('default'), 'cisco' => 'cisco']
))->setHelp('If RADIUS type is set to Cisco, in Access-Requests the value of Calling-Station-ID will be set to the client\'s IP address and the ' .
'Called-Station-Id to the client\'s MAC address. Default behavior is Calling-Station-Id = client\'s MAC address and ' .
'Called-Station-ID = pfSense\'s WAN IP address.');
@@ -1007,7 +1020,7 @@ $section->addInput(new Form_Select(
'radmac_format',
'MAC address format',
$pconfig['radmac_format'],
- ['default' => 'Default', 'singledash' => 'Single dash', 'ietf' => 'IETF', 'cisco' => 'Cisco', 'unformatted' => 'Unformatted']
+ ['default' => 'Default', 'singledash' => gettext('Single dash'), 'ietf' => 'IETF', 'cisco' => 'Cisco', 'unformatted' => gettext('Unformatted')]
))->setHelp('This option changes the MAC address format used in the whole RADIUS system. Change this if you also need to change the username format for ' .
'RADIUS MAC authentication.' . '<br />' .
'Default: 00:11:22:33:44:55' . '<br />' .
@@ -1077,24 +1090,34 @@ $section->addInput(new Form_Input(
&nbsp;&nbsp;&nbsp;&lt;input name=&quot;accept&quot; type=&quot;submit&quot; value=&quot;Continue&quot;&gt;<br />
&lt;/form&gt;')->addClass('btn btn-info btn-sm');
+list($host) = explode(":", $_SERVER['HTTP_HOST']);
+$zoneid = $pconfig['zoneid'] ? $pconfig['zoneid'] : 8000;
+if ($pconfig['httpslogin_enable']) {
+ $port = $pconfig['listenporthttps'] ? $pconfig['listenporthttps'] : ($zoneid + 8001);
+ $href = "https://{$host}:{$port}/?zone={$cpzone}";
+} else {
+ $port = $pconfig['listenporthttp'] ? $pconfig['listenporthttp'] : ($zoneid + 8000);
+ $href = "http://{$host}:{$port}/?zone={$cpzone}";
+}
+
if ($pconfig['page']['htmltext']) {
$section->addInput(new Form_Button(
'btnview',
'View current page',
$href
- ))->removeClass('btn-primary')->addClass('btn btn-default btn-xs');
+ ))->removeClass('btn-primary')->addClass('btn btn-default btn-xs')->setAttribute("target", "_blank");
$section->addInput(new Form_Button(
'btndownload',
'Download current page',
- '?zone=' . $cpzone . '&amp;act=gethtmlhtml'
- ))->removeClass('btn-primary')->addClass('btn btn-info btn-xs');
+ '?zone=' . $cpzone . '&act=gethtmlhtml'
+ ))->removeClass('btn-primary')->addClass('btn btn-info btn-xs')->setAttribute("target", "_blank");
$section->addInput(new Form_Button(
'btndownload',
'Restore default portal page',
- '?zone=' . $cpzone . '&amp;act=delhtmlhtml'
- ))->removeClass('btn-primary')->addClass('btn btn-danger btn-xs');
+ '?zone=' . $cpzone . '&act=delhtmlhtml'
+ ))->removeClass('btn-primary')->addClass('btn btn-danger btn-xs')->setAttribute("target", "_blank");
}
$section->addInput(new Form_Input(
@@ -1110,20 +1133,20 @@ if ($pconfig['page']['errtext']) {
$section->addInput(new Form_Button(
'btnview',
'View current page',
- '?zone=' . $cpzone . '&amp;act=viewerrhtml'
+ '?zone=' . $cpzone . '&act=viewerrhtml'
))->removeClass('btn-primary')->addClass('btn btn-default btn-xs');
$section->addInput(new Form_Button(
'btndownload',
'Download current page',
- '?zone=' . $cpzone . '&amp;act=geterrhtml'
- ))->removeClass('btn-primary')->addClass('btn btn-info btn-xs');
+ '?zone=' . $cpzone . '&act=geterrhtml'
+ ))->removeClass('btn-primary')->addClass('btn btn-info btn-xs')->setAttribute("target", "_blank");
$section->addInput(new Form_Button(
'btndownload',
'Restore default error page',
- '?zone=' . $cpzone . '&amp;act=delerrhtml'
- ))->removeClass('btn-primary')->addClass('btn btn-danger btn-xs');
+ '?zone=' . $cpzone . '&act=delerrhtml'
+ ))->removeClass('btn-primary')->addClass('btn btn-danger btn-xs')->setAttribute("target", "_blank");
}
$section->addInput(new Form_Input(
@@ -1137,20 +1160,20 @@ if ($pconfig['page']['logouttext']) {
$section->addInput(new Form_Button(
'btnview',
'View current page',
- '?zone=' . $cpzone . '&amp;act=viewlogouthtml'
- ))->removeClass('btn-primary')->addClass('btn btn-default btn-xs');
+ '?zone=' . $cpzone . '&act=viewlogouthtml'
+ ))->removeClass('btn-primary')->addClass('btn btn-default btn-xs')->setAttribute("target", "_blank");
$section->addInput(new Form_Button(
'btndownload',
'Download current page',
- '?zone=' . $cpzone . '&amp;act=getlogouthtml'
- ))->removeClass('btn-primary')->addClass('btn btn-info btn-xs');
+ '?zone=' . $cpzone . '&act=getlogouthtml'
+ ))->removeClass('btn-primary')->addClass('btn btn-info btn-xs')->setAttribute("target", "_blank");
$section->addInput(new Form_Button(
'btndownload',
'Restore default logout page',
- '?zone=' . $cpzone . '&amp;act=dellogouthtml'
- ))->removeClass('btn-primary')->addClass('btn btn-danger btn-xs');
+ '?zone=' . $cpzone . '&act=dellogouthtml'
+ ))->removeClass('btn-primary')->addClass('btn btn-danger btn-xs')->setAttribute("target", "_blank");
}
$section->addInput(new Form_Input(
'zone',
@@ -1192,7 +1215,7 @@ events.push(function() {
disableInput('localauth_priv', !($('input[name="auth_method"]:checked').val() == 'local'));
hideCheckbox('localauth_priv', !($('input[name="auth_method"]:checked').val() == 'local'));
- hideCheckbox('radius_protocol', !($('input[name="auth_method"]:checked').val() == 'radius'));
+ hideClass("radiusproto", !($('input[name="auth_method"]:checked').val() == 'radius'));
}
function hideHTTPS() {
diff --git a/src/usr/local/www/services_captiveportal_filemanager.php b/src/usr/local/www/services_captiveportal_filemanager.php
index 9ef63c8..cbe5896 100644
--- a/src/usr/local/www/services_captiveportal_filemanager.php
+++ b/src/usr/local/www/services_captiveportal_filemanager.php
@@ -96,7 +96,7 @@ if (!is_array($config['captiveportal'])) {
}
$a_cp =& $config['captiveportal'];
-$pgtitle = array(gettext("Services"), gettext("Captive Portal"), "Zone " . $a_cp[$cpzone]['zone'], gettext("File Manager"));
+$pgtitle = array(gettext("Services"), gettext("Captive Portal"), sprintf(gettext("Zone %s"), $a_cp[$cpzone]['zone']), gettext("File Manager"));
$shortcut_section = "captiveportal";
if (!is_array($a_cp[$cpzone]['element'])) {
@@ -132,8 +132,8 @@ if ($_POST) {
// check total file size
if (($total_size + $size) > $g['captiveportal_element_sizelimit']) {
- $input_errors[] = gettext("The total size of all files uploaded may not exceed ") .
- format_bytes($g['captiveportal_element_sizelimit']) . ".";
+ $input_errors[] = sprintf(gettext("The total size of all files uploaded may not exceed %s."),
+ format_bytes($g['captiveportal_element_sizelimit']));
}
if (!$input_errors) {
@@ -242,7 +242,7 @@ if (is_array($a_cp[$cpzone]['element'])):
?>
<tr>
<th>
- Total
+ <?=gettext("Total");?>
</th>
<th>
<?=format_bytes($total_size);?>
@@ -271,8 +271,8 @@ endif;
// The notes displayed on the page are large, the page content comparitively small. A "Note" button
// is provided so that you only see the notes if you ask for them
?>
-<div id="infoblock" class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Notes</h2></div>
+<div class="infoblock panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Notes");?></h2></div>
<div class="panel-body">
<?=gettext("Any files that you upload here with the filename prefix of captiveportal- will " .
"be made available in the root directory of the captive portal HTTP(S) server. " .
diff --git a/src/usr/local/www/services_captiveportal_hostname.php b/src/usr/local/www/services_captiveportal_hostname.php
index c40694a..70dc3b7 100644
--- a/src/usr/local/www/services_captiveportal_hostname.php
+++ b/src/usr/local/www/services_captiveportal_hostname.php
@@ -92,7 +92,7 @@ if (isset($cpzone) && !empty($cpzone) && isset($a_cp[$cpzone]['zoneid'])) {
$cpzoneid = $a_cp[$cpzone]['zoneid'];
}
-$pgtitle = array(gettext("Services"), gettext("Captive Portal"), "Zone " . $a_cp[$cpzone]['zone'], gettext("Allowed Hostnames"));
+$pgtitle = array(gettext("Services"), gettext("Captive Portal"), sprintf(gettext("Zone %s"), $a_cp[$cpzone]['zone']), gettext("Allowed Hostnames"));
$shortcut_section = "captiveportal";
if ($_GET['act'] == "del" && !empty($cpzone) && isset($cpzoneid)) {
@@ -131,7 +131,7 @@ if ($_GET['act'] == "del" && !empty($cpzone) && isset($cpzoneid)) {
include("head.inc");
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
@@ -196,8 +196,8 @@ endif;
</a>
</nav>
-<div id="infoblock">
- <?=print_info_box($notestr)?>
+<div class="infoblock">
+ <?=print_info_box($notestr, 'info', false)?>
</div>
<?php
diff --git a/src/usr/local/www/services_captiveportal_hostname_edit.php b/src/usr/local/www/services_captiveportal_hostname_edit.php
index 5d828d1..d36fc80 100644
--- a/src/usr/local/www/services_captiveportal_hostname_edit.php
+++ b/src/usr/local/www/services_captiveportal_hostname_edit.php
@@ -145,7 +145,7 @@ if ($_POST) {
}
if ($ipent['hostname'] == $_POST['hostname']) {
- $input_errors[] = sprintf("[%s] %s.", $_POST['hostname'], gettext("already allowed")) ;
+ $input_errors[] = sprintf(gettext("Hostname [%s] already allowed."), $_POST['hostname']) ;
break ;
}
}
diff --git a/src/usr/local/www/services_captiveportal_ip.php b/src/usr/local/www/services_captiveportal_ip.php
index 6d8c40b..9f90c9a 100644
--- a/src/usr/local/www/services_captiveportal_ip.php
+++ b/src/usr/local/www/services_captiveportal_ip.php
@@ -91,7 +91,7 @@ if (isset($cpzone) && !empty($cpzone) && isset($a_cp[$cpzone]['zoneid'])) {
$cpzoneid = $a_cp[$cpzone]['zoneid'];
}
-$pgtitle = array(gettext("Services"), gettext("Captive Portal"), "Zone " . $a_cp[$cpzone]['zone'], gettext("Allowed IP Addresses"));
+$pgtitle = array(gettext("Services"), gettext("Captive Portal"), sprintf(gettext("Zone %s"), $a_cp[$cpzone]['zone']), gettext("Allowed IP Addresses"));
$shortcut_section = "captiveportal";
if ($_GET['act'] == "del" && !empty($cpzone) && isset($cpzoneid)) {
@@ -124,7 +124,7 @@ if ($_GET['act'] == "del" && !empty($cpzone) && isset($cpzoneid)) {
include("head.inc");
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
@@ -192,9 +192,9 @@ endif;
</a>
</nav>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(gettext('Adding allowed IP addresses will allow IP access to/from these addresses through the captive portal without being taken to the portal page. ' .
- 'This can be used for a web server serving images for the portal page or a DNS server on another network, for example.'), info)?>
+ 'This can be used for a web server serving images for the portal page or a DNS server on another network, for example.'), 'info', false)?>
</div>
<?php
diff --git a/src/usr/local/www/services_captiveportal_mac.php b/src/usr/local/www/services_captiveportal_mac.php
index d9eb4be..b143190 100644
--- a/src/usr/local/www/services_captiveportal_mac.php
+++ b/src/usr/local/www/services_captiveportal_mac.php
@@ -88,11 +88,11 @@ if (!is_array($config['captiveportal'])) {
}
$a_cp =& $config['captiveportal'];
-$pgtitle = array(gettext("Services"), gettext("Captive Portal"), "Zone " . $a_cp[$cpzone]['zone'], gettext("MAC"));
+$pgtitle = array(gettext("Services"), gettext("Captive Portal"), sprintf(gettext("Zone %s"), $a_cp[$cpzone]['zone']), gettext("MAC"));
$shortcut_section = "captiveportal";
-$actsmbl = array('pass' => '<font color="green" size="4">&#x2714;</font>&nbsp;Pass',
- 'block' => '<font color="red" size="4">&#x2718;</font>&nbsp;Block');
+$actsmbl = array('pass' => '<font color="green" size="4">&#x2714;</font>&nbsp;' . gettext("Pass"),
+ 'block' => '<font color="red" size="4">&#x2718;</font>&nbsp;' . gettext("Block"));
if ($_POST) {
$pconfig = $_POST;
@@ -189,7 +189,7 @@ if ($savemsg) {
}
if (is_subsystem_dirty('passthrumac')) {
- print_info_box_np(gettext("The captive portal MAC address configuration has been changed.<br />You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The captive portal MAC address configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -255,8 +255,8 @@ endif;
</a>
</nav>
-<div id="infoblock">
- <?=print_info_box(gettext('Adding MAC addresses as "pass" MACs allows them access through the captive portal automatically without being taken to the portal page.'), info)?>
+<div class="infoblock">
+ <?=print_info_box(gettext('Adding MAC addresses as "pass" MACs allows them access through the captive portal automatically without being taken to the portal page.'), 'info', false)?>
</div>
<?php
include("foot.inc");
diff --git a/src/usr/local/www/services_captiveportal_mac_edit.php b/src/usr/local/www/services_captiveportal_mac_edit.php
index 762c608..35d796e 100644
--- a/src/usr/local/www/services_captiveportal_mac_edit.php
+++ b/src/usr/local/www/services_captiveportal_mac_edit.php
@@ -233,7 +233,7 @@ $section->addInput(new Form_Select(
'action',
'Action',
strtolower($pconfig['action']),
- array('pass' => 'Pass', 'block' => 'Block')
+ array('pass' => gettext('Pass'), 'block' => gettext('Block'))
))->setHelp('Choose what to do with packets coming from this MAC address.');
$macaddress = new Form_Input(
@@ -251,13 +251,20 @@ $btnmymac = new Form_Button(
$btnmymac->removeClass('btn-primary')->addClass('btn-success btn-sm');
-$group = new Form_Group('MAC controls');
+$group = new Form_Group('MAC Address');
$group->add($macaddress);
$group->add($btnmymac);
-$group->setHelp('MAC address (6 hex octets separated by colons)');
+$group->setHelp('6 hex octets separated by colons');
$section->add($group);
$section->addInput(new Form_Input(
+ 'descr',
+ 'Description',
+ 'text',
+ $pconfig['descr']
+))->setHelp('You may enter a description here for your reference (not parsed)');
+
+$section->addInput(new Form_Input(
'bw_up',
'Bandwidth up',
'text',
diff --git a/src/usr/local/www/services_captiveportal_vouchers.php b/src/usr/local/www/services_captiveportal_vouchers.php
index 73f7976..46588a6 100644
--- a/src/usr/local/www/services_captiveportal_vouchers.php
+++ b/src/usr/local/www/services_captiveportal_vouchers.php
@@ -103,12 +103,12 @@ if (!is_array($config['voucher'])) {
}
if (empty($a_cp[$cpzone])) {
- log_error("Submission on captiveportal page with unknown zone parameter: " . htmlspecialchars($cpzone));
+ log_error(sprintf(gettext("Submission on captiveportal page with unknown zone parameter: %s"), htmlspecialchars($cpzone)));
header("Location: services_captiveportal_zones.php");
exit;
}
-$pgtitle = array(gettext("Services"), gettext("Captive Portal"), "Zone " . $a_cp[$cpzone]['zone'], gettext("Vouchers"));
+$pgtitle = array(gettext("Services"), gettext("Captive Portal"), sprintf(gettext("Zone %s"), $a_cp[$cpzone]['zone']), gettext("Vouchers"));
$shortcut_section = "captiveportal-vouchers";
if (!is_array($config['voucher'][$cpzone]['roll'])) {
@@ -258,7 +258,7 @@ if ($_POST) {
$input_errors[] = gettext("Double quotes aren't allowed.");
}
if ($_POST['charset'] && (strpos($_POST['charset'], ",") > 0)) {
- $input_errors[] = "',' " . gettext("aren't allowed.");
+ $input_errors[] = gettext("',' aren't allowed.");
}
if ($_POST['rollbits'] && (!is_numeric($_POST['rollbits']) || ($_POST['rollbits'] < 1) || ($_POST['rollbits'] > 31))) {
$input_errors[] = gettext("# of Bits to store Roll Id needs to be between 1..31.");
@@ -278,6 +278,9 @@ if ($_POST) {
if ($_POST['vouchersyncdbip'] && (is_ipaddr_configured($_POST['vouchersyncdbip']))) {
$input_errors[] = gettext("You cannot sync the voucher database to this host (itself).");
}
+ if ($_POST['vouchersyncpass'] != $_POST['vouchersyncpass_confirm']) {
+ $input_errors[] = gettext("Password and confirmed password must match.");
+ }
}
if (!$input_errors) {
@@ -313,7 +316,11 @@ if ($_POST) {
$newvoucher['vouchersyncdbip'] = $_POST['vouchersyncdbip'];
$newvoucher['vouchersyncport'] = $_POST['vouchersyncport'];
$newvoucher['vouchersyncusername'] = $_POST['vouchersyncusername'];
- $newvoucher['vouchersyncpass'] = $_POST['vouchersyncpass'];
+ if ($_POST['vouchersyncpass'] != DMYPWD ) {
+ $newvoucher['vouchersyncpass'] = $_POST['vouchersyncpass'];
+ } else {
+ $newvoucher['vouchersyncpass'] = $config['voucher'][$cpzone]['vouchersyncpass'];
+ }
if ($newvoucher['vouchersyncpass'] && $newvoucher['vouchersyncusername'] &&
$newvoucher['vouchersyncport'] && $newvoucher['vouchersyncdbip']) {
// Synchronize the voucher DB from the master node
@@ -343,31 +350,31 @@ EOF;
XML_RPC_encode($execcmd)
);
$port = $newvoucher['vouchersyncport'];
- log_error("voucher XMLRPC sync data {$url}:{$port}.");
+ log_error(sprintf(gettext("voucher XMLRPC sync data %s:%d"), $url, $port));
$msg = new XML_RPC_Message('pfsense.exec_php', $params);
$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
$cli->setCredentials($newvoucher['vouchersyncusername'], $newvoucher['vouchersyncpass']);
$resp = $cli->send($msg, "250");
if (!is_object($resp)) {
- $error = "A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} (pfsense.exec_php).";
+ $error = sprintf(gettext("A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with %s:%d (pfsense.exec_php)."), $url, $port);
log_error($error);
- file_notice("CaptivePortalVoucherSync", $error, "Communications error occurred", "");
+ file_notice("CaptivePortalVoucherSync", $error, gettext("Communications error occurred"), "");
$input_errors[] = $error;
} elseif ($resp->faultCode()) {
$cli->setDebug(1);
$resp = $cli->send($msg, "250");
- $error = "An error code was received while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
+ $error = sprintf(gettext("An error code was received while attempting CaptivePortalVoucherSync XMLRPC sync with %s:%d - Code %d: %s"), $url, $port, $resp->faultCode(), $resp->faultString());
log_error($error);
- file_notice("CaptivePortalVoucherSync", $error, "Error code received", "");
+ file_notice("CaptivePortalVoucherSync", $error, gettext("Error code received"), "");
$input_errors[] = $error;
} else {
- log_error("The Captive Portal voucher database has been synchronized with {$url}:{$port} (pfsense.exec_php).");
+ log_error(sprintf(gettext("The Captive Portal voucher database has been synchronized with %s:%d (pfsense.exec_php)."), $url, $port));
}
if (!$input_errors) {
$toreturn = XML_RPC_Decode($resp->value());
if (!is_array($toreturn)) {
if ($toreturn == "Authentication failed") {
- $input_errors[] = "Could not synchronize the voucher database: Authentication Failed.";
+ $input_errors[] = gettext("Could not synchronize the voucher database: Authentication Failed.");
}
} else {
// If we received back the voucher roll and other information then store it.
@@ -401,7 +408,7 @@ EOF;
if ($toreturn['voucher']['descrmsgexpired']) {
$newvoucher['descrmsgexpired'] = $toreturn['voucher']['descrmsgexpired'];
}
- $savemsg = gettext("Voucher database has been synchronized from {$url}:{$port}");
+ $savemsg = sprintf(gettext('Voucher database has been synchronized from %1$s:%2$s'), $url, $port);
$config['voucher'][$cpzone] = $newvoucher;
write_config();
@@ -424,7 +431,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg. 'success');
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
@@ -439,15 +446,15 @@ display_top_tabs($tab_array, true);
// We draw a simple table first, then present the controls to work with it
?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Voucher Rolls</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Voucher Rolls");?></h2></div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-hover table-condensed">
<thead>
<tr>
- <th><?=gettext("Roll")?> #</th>
+ <th><?=gettext("Roll #")?></th>
<th><?=gettext("Minutes/Ticket")?></th>
- <th># <?=gettext("of Tickets")?></th>
+ <th><?=gettext("# of Tickets")?></th>
<th><?=gettext("Comment")?></th>
<th><?=gettext("Action")?></th>
</tr>
@@ -605,7 +612,7 @@ $section->addInput(new Form_Input(
$pconfig['vouchersyncusername']
))->setHelp('This is the username of the master voucher nodes webConfigurator.');
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'vouchersyncpass',
'Voucher sync password',
'password',
@@ -632,7 +639,7 @@ print($form);
<div class="rolledit">
<?php
print_info_box(gettext('Changing any Voucher parameter (apart from managing the list of Rolls) on this page will render existing vouchers useless if they were generated with different settings. ' .
- 'Specifying the Voucher Database Synchronization options will not record any other value from the other options. They will be retrieved/synced from the master.'), info);
+ 'Specifying the Voucher Database Synchronization options will not record any other value from the other options. They will be retrieved/synced from the master.'), 'info');
?>
</div>
@@ -667,7 +674,7 @@ events.push(function() {
// Set initial state
setShowHide($('#enable').is(":checked"));
- var generateButton = $('<a class="btn btn-xs btn-default">Generate new keys</a>');
+ var generateButton = $('<a class="btn btn-xs btn-default"><?=gettext("Generate new keys");?></a>');
generateButton.on('click', function() {
$.ajax({
type: 'get',
diff --git a/src/usr/local/www/services_captiveportal_zones.php b/src/usr/local/www/services_captiveportal_zones.php
index bcf15fc..53e7b4d 100644
--- a/src/usr/local/www/services_captiveportal_zones.php
+++ b/src/usr/local/www/services_captiveportal_zones.php
@@ -95,11 +95,11 @@ $shortcut_section = "captiveportal";
include("head.inc");
if ($savemsg) {
- print_info_box($savemsg, success);
+ print_info_box($savemsg, 'success');
}
if (is_subsystem_dirty('captiveportal')) {
- print_info_box_np(gettext("The Captive Portal entry list has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The Captive Portal entry list has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
?>
<form action="services_captiveportal_zones.php" method="post">
diff --git a/src/usr/local/www/services_captiveportal_zones_edit.php b/src/usr/local/www/services_captiveportal_zones_edit.php
index fb278bb..2b57d16 100644
--- a/src/usr/local/www/services_captiveportal_zones_edit.php
+++ b/src/usr/local/www/services_captiveportal_zones_edit.php
@@ -90,7 +90,7 @@ if ($_POST) {
foreach ($a_cp as $cpkey => $cpent) {
if ($cpent['zone'] == $_POST['zone']) {
- $input_errors[] = sprintf("[%s] %s.", $_POST['zone'], gettext("already exists"));
+ $input_errors[] = sprintf(gettext("Zone [%s] already exists."), $_POST['zone']);
break;
}
}
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php
index e0c2ca4..f77e780 100644
--- a/src/usr/local/www/services_dhcp.php
+++ b/src/usr/local/www/services_dhcp.php
@@ -136,6 +136,12 @@ if (is_array($config['dhcpd'][$if])) {
} else {
$dhcpdconf = &$config['dhcpd'][$if];
}
+
+ if (!is_array($config['dhcpd'][$if]['staticmap'])) {
+ $dhcpdconf['staticmap'] = array();
+ }
+
+ $a_maps = &$config['dhcpd'][$if]['staticmap'];
}
if (is_array($dhcpdconf)) {
// Global Options
@@ -156,12 +162,6 @@ if (is_array($dhcpdconf)) {
}
$pconfig['dhcpleaseinlocaltime'] = $dhcpleaseinlocaltime;
-
- if (!is_array($dhcpdconf['staticmap'])) {
- $dhcpdconf['staticmap'] = array();
- }
-
- $a_maps = &$dhcpdconf['staticmap'];
} else {
// Options that exist only in pools
$pconfig['descr'] = $dhcpdconf['descr'];
@@ -181,6 +181,7 @@ if (is_array($dhcpdconf)) {
list($pconfig['wins1'], $pconfig['wins2']) = $dhcpdconf['winsserver'];
list($pconfig['dns1'], $pconfig['dns2'], $pconfig['dns3'], $pconfig['dns4']) = $dhcpdconf['dnsserver'];
$pconfig['denyunknown'] = isset($dhcpdconf['denyunknown']);
+ $pconfig['nonak'] = isset($dhcpdconf['nonak']);
$pconfig['ddnsdomain'] = $dhcpdconf['ddnsdomain'];
$pconfig['ddnsdomainprimary'] = $dhcpdconf['ddnsdomainprimary'];
$pconfig['ddnsdomainkeyname'] = $dhcpdconf['ddnsdomainkeyname'];
@@ -230,7 +231,7 @@ if (isset($_POST['submit'])) {
$numbervalue = array();
$numbervalue['number'] = htmlspecialchars($_POST["number{$x}"]);
$numbervalue['type'] = htmlspecialchars($_POST["itemtype{$x}"]);
- $numbervalue['value'] = str_replace('&quot;', '"', htmlspecialchars($_POST["value{$x}"]));
+ $numbervalue['value'] = base64_encode($_POST["value{$x}"]);
$numberoptions['item'][] = $numbervalue;
}
}
@@ -292,7 +293,7 @@ if (isset($_POST['submit'])) {
}
if ($cpdata['timeout'] > $deftime) {
$input_errors[] = sprintf(gettext(
- "The Captive Portal zone '%s' has Hard Timeout parameter set to a value bigger than Default lease time (%s)."), $cpZone, $deftime);
+ 'The Captive Portal zone (%1$s) has Hard Timeout parameter set to a value bigger than Default lease time (%2$s).'), $cpZone, $deftime);
}
}
}
@@ -369,30 +370,31 @@ if (isset($_POST['submit'])) {
}
if ($_POST['staticarp'] && $noip) {
- $input_errors[] = "Cannot enable static ARP when you have static map entries without IP addresses. Ensure all static maps have IP addresses and try again.";
+ $input_errors[] = gettext("Cannot enable static ARP when you have static map entries without IP addresses. Ensure all static maps have IP addresses and try again.");
}
if (is_array($pconfig['numberoptions']['item'])) {
foreach ($pconfig['numberoptions']['item'] as $numberoption) {
- if ($numberoption['type'] == 'text' && strstr($numberoption['value'], '"')) {
+ $numberoption_value = base64_decode($numberoption['value']);
+ if ($numberoption['type'] == 'text' && strstr($numberoption_value, '"')) {
$input_errors[] = gettext("Text type cannot include quotation marks.");
- } else if ($numberoption['type'] == 'string' && !preg_match('/^"[^"]*"$/', $numberoption['value']) && !preg_match('/^[0-9a-f]{2}(?:\:[0-9a-f]{2})*$/i', $numberoption['value'])) {
+ } else if ($numberoption['type'] == 'string' && !preg_match('/^"[^"]*"$/', $numberoption_value) && !preg_match('/^[0-9a-f]{2}(?:\:[0-9a-f]{2})*$/i', $numberoption_value)) {
$input_errors[] = gettext("String type must be enclosed in quotes like \"this\" or must be a series of octets specified in hexadecimal, separated by colons, like 01:23:45:67:89:ab:cd:ef");
- } else if ($numberoption['type'] == 'boolean' && $numberoption['value'] != 'true' && $numberoption['value'] != 'false' && $numberoption['value'] != 'on' && $numberoption['value'] != 'off') {
+ } else if ($numberoption['type'] == 'boolean' && $numberoption_value != 'true' && $numberoption_value != 'false' && $numberoption_value != 'on' && $numberoption_value != 'off') {
$input_errors[] = gettext("Boolean type must be true, false, on, or off.");
- } else if ($numberoption['type'] == 'unsigned integer 8' && (!is_numeric($numberoption['value']) || $numberoption['value'] < 0 || $numberoption['value'] > 255)) {
+ } else if ($numberoption['type'] == 'unsigned integer 8' && (!is_numeric($numberoption_value) || $numberoption_value < 0 || $numberoption_value > 255)) {
$input_errors[] = gettext("Unsigned 8-bit integer type must be a number in the range 0 to 255.");
- } else if ($numberoption['type'] == 'unsigned integer 16' && (!is_numeric($numberoption['value']) || $numberoption['value'] < 0 || $numberoption['value'] > 65535)) {
+ } else if ($numberoption['type'] == 'unsigned integer 16' && (!is_numeric($numberoption_value) || $numberoption_value < 0 || $numberoption_value > 65535)) {
$input_errors[] = gettext("Unsigned 16-bit integer type must be a number in the range 0 to 65535.");
- } else if ($numberoption['type'] == 'unsigned integer 32' && (!is_numeric($numberoption['value']) || $numberoption['value'] < 0 || $numberoption['value'] > 4294967295)) {
+ } else if ($numberoption['type'] == 'unsigned integer 32' && (!is_numeric($numberoption_value) || $numberoption_value < 0 || $numberoption_value > 4294967295)) {
$input_errors[] = gettext("Unsigned 32-bit integer type must be a number in the range 0 to 4294967295.");
- } else if ($numberoption['type'] == 'signed integer 8' && (!is_numeric($numberoption['value']) || $numberoption['value'] < -128 || $numberoption['value'] > 127)) {
+ } else if ($numberoption['type'] == 'signed integer 8' && (!is_numeric($numberoption_value) || $numberoption_value < -128 || $numberoption_value > 127)) {
$input_errors[] = gettext("Signed 8-bit integer type must be a number in the range -128 to 127.");
- } else if ($numberoption['type'] == 'signed integer 16' && (!is_numeric($numberoption['value']) || $numberoption['value'] < -32768 || $numberoption['value'] > 32767)) {
+ } else if ($numberoption['type'] == 'signed integer 16' && (!is_numeric($numberoption_value) || $numberoption_value < -32768 || $numberoption_value > 32767)) {
$input_errors[] = gettext("Signed 16-bit integer type must be a number in the range -32768 to 32767.");
- } else if ($numberoption['type'] == 'signed integer 32' && (!is_numeric($numberoption['value']) || $numberoption['value'] < -2147483648 || $numberoption['value'] > 2147483647)) {
+ } else if ($numberoption['type'] == 'signed integer 32' && (!is_numeric($numberoption_value) || $numberoption_value < -2147483648 || $numberoption_value > 2147483647)) {
$input_errors[] = gettext("Signed 32-bit integer type must be a number in the range -2147483648 to 2147483647.");
- } else if ($numberoption['type'] == 'ip-address' && !is_ipaddrv4($numberoption['value']) && !is_hostname($numberoption['value'])) {
+ } else if ($numberoption['type'] == 'ip-address' && !is_ipaddrv4($numberoption_value) && !is_hostname($numberoption_value)) {
$input_errors[] = gettext("IP address or host type must be an IP address or host name.");
}
}
@@ -403,20 +405,17 @@ if (isset($_POST['submit'])) {
$subnet_start = ip2ulong(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)));
$subnet_end = ip2ulong(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))));
- if ((ip2ulong($_POST['range_from']) < $subnet_start) || (ip2ulong($_POST['range_from']) > $subnet_end) ||
- (ip2ulong($_POST['range_to']) < $subnet_start) || (ip2ulong($_POST['range_to']) > $subnet_end)) {
- $input_errors[] = gettext("The specified range lies outside of the current subnet.");
- }
-
if (ip2ulong($_POST['range_from']) > ip2ulong($_POST['range_to'])) {
$input_errors[] = gettext("The range is invalid (first element higher than second element).");
}
- if (is_numeric($pool) || ($act == "newpool")) {
- $rfrom = $config['dhcpd'][$if]['range']['from'];
- $rto = $config['dhcpd'][$if]['range']['to'];
+ if (ip2ulong($_POST['range_from']) < $subnet_start || ip2ulong($_POST['range_to']) > $subnet_end) {
+ $input_errors[] = gettext("The specified range lies outside of the current subnet.");
+ }
- if (is_inrange_v4($_POST['range_from'], $rfrom, $rto) || is_inrange_v4($_POST['range_to'], $rfrom, $rto)) {
+ if (is_numeric($pool) || ($act == "newpool")) {
+ if (!((ip2ulong($_POST['range_from']) > ip2ulong($config['dhcpd'][$if]['range']['to'])) ||
+ (ip2ulong($_POST['range_to']) < ip2ulong($config['dhcpd'][$if]['range']['from'])))) {
$input_errors[] = gettext("The specified range must not be within the DHCP range for this interface.");
}
}
@@ -426,8 +425,8 @@ if (isset($_POST['submit'])) {
continue;
}
- if (is_inrange_v4($_POST['range_from'], $p['range']['from'], $p['range']['to']) ||
- is_inrange_v4($_POST['range_to'], $p['range']['from'], $p['range']['to'])) {
+ if (!((ip2ulong($_POST['range_from']) > ip2ulong($p['range']['to'])) ||
+ (ip2ulong($_POST['range_to']) < ip2ulong($p['range']['from'])))) {
$input_errors[] = gettext("The specified range must not be within the range configured on a DHCP pool for this interface.");
break;
}
@@ -445,8 +444,8 @@ if (isset($_POST['submit'])) {
if (empty($map['ipaddr'])) {
continue;
}
- if ((ip2ulong($map['ipaddr']) > $dynsubnet_start) &&
- (ip2ulong($map['ipaddr']) < $dynsubnet_end)) {
+ if ((ip2ulong($map['ipaddr']) >= $dynsubnet_start) &&
+ (ip2ulong($map['ipaddr']) <= $dynsubnet_end)) {
$input_errors[] = sprintf(gettext("The DHCP range cannot overlap any static DHCP mappings."));
break;
}
@@ -539,6 +538,7 @@ if (isset($_POST['submit'])) {
$dhcpdconf['domain'] = $_POST['domain'];
$dhcpdconf['domainsearchlist'] = $_POST['domainsearchlist'];
$dhcpdconf['denyunknown'] = ($_POST['denyunknown']) ? true : false;
+ $dhcpdconf['nonak'] = ($_POST['nonak']) ? true : false;
$dhcpdconf['ddnsdomain'] = $_POST['ddnsdomain'];
$dhcpdconf['ddnsdomainprimary'] = $_POST['ddnsdomainprimary'];
$dhcpdconf['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname'];
@@ -660,7 +660,7 @@ function build_pooltable() {
$pooltbl .= '<th>' . gettext("Pool Start") . '</th>';
$pooltbl .= '<th>' . gettext("Pool End") . '</th>';
$pooltbl .= '<th>' . gettext("Description") . '</th>';
- $pooltbl .= '<th></th>';
+ $pooltbl .= '<th>' . gettext("Actions") . '</th>';
$pooltbl .= '</tr>';
$pooltbl .= '</thead>';
$pooltbl .= '<tbody>';
@@ -679,9 +679,9 @@ function build_pooltable() {
$pooltbl .= '<td ondblclick="document.location=\'services_dhcp.php?if=' . htmlspecialchars($if) . '&pool=' . $i . '\';">' .
htmlspecialchars($poolent['descr']) . '</td>';
- $pooltbl .= '<td><a class="btn btn-xs btn-info" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&pool=' . $i . '" />' . gettext('Edit') . '</a>';
+ $pooltbl .= '<td><a class="fa fa-pencil" title="'. gettext("Edit pool") . '" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&pool=' . $i . '"></a>';
- $pooltbl .= '<a class="btn btn-xs btn-danger" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&act=delpool&id=' . $i . '" />' . gettext('Delete') . '</a></td>';
+ $pooltbl .= ' <a class="fa fa-trash" title="'. gettext("Delete pool") . '" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&act=delpool&id=' . $i . '"></a></td>';
$pooltbl .= '</tr>';
}
$i++;
@@ -715,7 +715,7 @@ if (isset($config['dhcrelay']['enable'])) {
}
if (is_subsystem_dirty('staticmaps')) {
- print_info_box_np(gettext("The static mapping configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The static mapping configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
/* active tabs */
@@ -777,6 +777,14 @@ $section->addInput(new Form_Checkbox(
$pconfig['denyunknown']
));
+$section->addInput(new Form_Checkbox(
+ 'nonak',
+ 'Ignore denied clients',
+ 'Denied clients will be ignored rather than rejected.',
+ $pconfig['nonak']
+));
+
+
if (is_numeric($pool) || ($act == "newpool")) {
$section->addInput(new Form_Input(
'descr',
@@ -806,7 +814,7 @@ $range_to--;
$rangestr = long2ip32($range_from) . ' - ' . long2ip32($range_to);
if (is_numeric($pool) || ($act == "newpool")) {
- $rangestr .= '<br />' . 'In-use DHCP Pool Ranges:';
+ $rangestr .= '<br />' . gettext('In-use DHCP Pool Ranges:');
if (is_array($config['dhcpd'][$if]['range'])) {
$rangestr .= '<br />' . $config['dhcpd'][$if]['range']['from'] . ' - ' . $config['dhcpd'][$if]['range']['to'];
}
@@ -940,8 +948,8 @@ if (!is_numeric($pool) && !($act == "newpool")) {
'failover_peerip',
'Failover peer IP',
$pconfig['failover_peerip']
- ))->setHelp('Leave blank to disable. Enter the interface IP address of the other machine. Machines must be using CARP.' .
- 'Interface\'s advskew determines whether the DHCPd process is Primary or Secondary. Ensure one machine\'s advskew < 20 (and the other is > 20).');
+ ))->setHelp('Leave blank to disable. Enter the interface IP address of the other machine. Machines must be using CARP. ' .
+ 'Interface\'s advskew determines whether the DHCPd process is Primary or Secondary. Ensure one machine\'s advskew &lt; 20 (and the other is &gt; 20).');
}
if (!is_numeric($pool) && !($act == "newpool")) {
@@ -950,7 +958,7 @@ if (!is_numeric($pool) && !($act == "newpool")) {
'Static ARP',
'Enable Static ARP entries',
$pconfig['staticarp']
- ))->setHelp('This option persists even if DHCP server is disabled. Only the machines listed below will be able to communicate with the firewall on this NIC.');
+ ))->setHelp('This option persists even if DHCP server is disabled. Only the machines listed below will be able to communicate with the firewall on this interface.');
$section->addInput(new Form_Checkbox(
'dhcpleaseinlocaltime',
@@ -973,7 +981,7 @@ $btnadv = new Form_Button(
'Advanced'
);
-$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm');
+$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm');
$section->addInput(new Form_StaticText(
'Dynamic DNS',
@@ -990,7 +998,7 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_Input(
'ddnsdomain',
'DDNS Domain',
- 'number',
+ 'text',
$pconfig['ddnsdomain']
))->setHelp('Leave blank to disable dynamic DNS registration.' . '<br />' .
'Enter the dynamic DNS domain which will be used to register client names in the DNS server.');
@@ -1021,7 +1029,7 @@ $btnadv = new Form_Button(
'Advanced'
);
-$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm');
+$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm');
$section->addInput(new Form_StaticText(
'MAC address control',
@@ -1030,14 +1038,14 @@ $section->addInput(new Form_StaticText(
$section->addInput(new Form_Input(
'mac_allow',
- 'Allow',
+ 'MAC Allow',
'text',
$pconfig['mac_allow']
))->setHelp('List of partial MAC addresses to allow, comma separated, no spaces, e.g.: 00:00:00,01:E5:FF');
$section->addInput(new Form_Input(
'mac_deny',
- 'Deny',
+ 'MAC Deny',
'text',
$pconfig['mac_deny']
))->setHelp('List of partial MAC addresses to deny access, comma separated, no spaces, e.g.: 00:00:00,01:E5:FF');
@@ -1048,24 +1056,24 @@ $btnadv = new Form_Button(
'Advanced'
);
-$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm');
+$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm');
$section->addInput(new Form_StaticText(
- 'NTP servers',
+ 'NTP',
$btnadv
));
$section->addInput(new Form_IpAddress(
'ntp1',
- null,
+ 'NTP Server 1',
$pconfig['ntp1']
-))->setAttribute('placeholder', 'NTP Server 1');
+));
$section->addInput(new Form_IpAddress(
'ntp2',
- null,
+ 'NTP Server 2',
$pconfig['ntp2']
-))->setAttribute('placeholder', 'NTP Server 2');
+));
// Advanced TFTP
$btnadv = new Form_Button(
@@ -1073,16 +1081,16 @@ $btnadv = new Form_Button(
'Advanced'
);
-$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm');
+$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm');
$section->addInput(new Form_StaticText(
- 'TFTP server',
+ 'TFTP',
$btnadv
));
$section->addInput(new Form_IpAddress(
'tftp',
- null,
+ 'TFTP Server',
$pconfig['tftp']
))->setHelp('Leave blank to disable. Enter a full hostname or IP for the TFTP server')->setPattern('[.a-zA-Z0-9_]+');
@@ -1092,74 +1100,21 @@ $btnadv = new Form_Button(
'Advanced'
);
-$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm');
+$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm');
$section->addInput(new Form_StaticText(
- 'LDAP URI',
+ 'LDAP',
$btnadv
));
$section->addInput(new Form_Input(
'ldap',
- null,
+ 'LDAP Server URI',
'text',
$pconfig['ldap']
))->setHelp('Leave blank to disable. Enter a full URI for the LDAP server in the form ldap://ldap.example.com/dc=example,dc=com ');
-// Advanced NETBOOT
-$btnadv = new Form_Button(
- 'btnadvboot',
- 'Advanced'
-);
-
-$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm');
-
-$section->addInput(new Form_StaticText(
- 'Network booting',
- $btnadv
-));
-
-$section->addInput(new Form_Checkbox(
- 'netboot',
- null,
- 'Enables network booting',
- $pconfig['netboot']
-));
-
-$section->addInput(new Form_IpAddress(
- 'nextserver',
- 'Next Server',
- $pconfig['nextserver']
-))->setHelp('Enter the IP address of the next server');
-
-$section->addInput(new Form_Input(
- 'filename',
- 'Default BIOS file name',
- 'text',
- $pconfig['filename']
-));
-
-$section->addInput(new Form_Input(
- 'filename32',
- 'UEFI 32 bit file name',
- 'text',
- $pconfig['filename32']
-));
-
-$section->addInput(new Form_Input(
- 'filename64',
- 'UEFI 64 bit file name',
- 'text',
- $pconfig['filename64']
-))->setHelp('You need both a filename and a boot server configured for this to work! ' .
- 'You will need all three filenames and a boot server configured for UEFI to work! ');
-
-$section->addInput(new Form_Input(
- 'rootpath',
- 'Root path',
- 'text',
- $pconfig['rootpath']
-))->setHelp('string-format: iscsi:(servername):(protocol):(port):(LUN):targetname ');
+$form->add($section);
// Advanced Additional options
$btnadv = new Form_Button(
@@ -1167,22 +1122,20 @@ $btnadv = new Form_Button(
'Advanced'
);
-$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm');
+$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm');
$section->addInput(new Form_StaticText(
'Additional BOOTP/DHCP Options',
$btnadv
));
-$form->add($section);
-
$section = new Form_Section('Additional BOOTP/DHCP Options');
$section->addClass('adnlopts');
$section->addInput(new Form_StaticText(
null,
- '<div class="alert alert-info"> ' . gettext('Enter the DHCP option number and the value for each item you would like to include in the DHCP lease information. ' .
- 'For a list of available options please visit this ') . '<a href="http://www.iana.org/assignments/bootp-dhcp-parameters/" target="_blank">' . gettext("URL") . '</a></div>'
+ '<div class="alert alert-info"> ' . gettext('Enter the DHCP option number and the value for each item you would like to include in the DHCP lease information.') . ' ' .
+ sprintf(gettext('For a list of available options please visit this %1$s URL%2$s'), '<a href="http://www.iana.org/assignments/bootp-dhcp-parameters/" target="_blank">', '</a></div>')
));
if (!$pconfig['numberoptions']) {
@@ -1203,7 +1156,7 @@ $numrows = count($pconfig['numberoptions']['item']) -1;
foreach ($pconfig['numberoptions']['item'] as $item) {
$number = $item['number'];
$itemtype = $item['type'];
- $value = $item['value'];
+ $value = base64_decode($item['value']);
$group = new Form_Group(($counter == 0) ? 'Option':null);
$group->addClass('repeatable');
@@ -1247,6 +1200,57 @@ $section->addInput(new Form_Button(
$form->add($section);
+if ($pconfig['netboot']) {
+ $sectate = COLLAPSIBLE|SEC_OPEN;
+} else {
+ $sectate = COLLAPSIBLE|SEC_CLOSED;
+}
+$section = new Form_Section("Network booting", nwkbootsec, $sectate);
+
+$section->addInput(new Form_Checkbox(
+ 'netboot',
+ 'Enable',
+ 'Enables network booting',
+ $pconfig['netboot']
+));
+
+$section->addInput(new Form_IpAddress(
+ 'nextserver',
+ 'Next Server',
+ $pconfig['nextserver']
+))->setHelp('Enter the IP address of the next server');
+
+$section->addInput(new Form_Input(
+ 'filename',
+ 'Default BIOS file name',
+ 'text',
+ $pconfig['filename']
+));
+
+$section->addInput(new Form_Input(
+ 'filename32',
+ 'UEFI 32 bit file name',
+ 'text',
+ $pconfig['filename32']
+));
+
+$section->addInput(new Form_Input(
+ 'filename64',
+ 'UEFI 64 bit file name',
+ 'text',
+ $pconfig['filename64']
+))->setHelp('You need both a filename and a boot server configured for this to work! ' .
+ 'You will need all three filenames and a boot server configured for UEFI to work! ');
+
+$section->addInput(new Form_Input(
+ 'rootpath',
+ 'Root path',
+ 'text',
+ $pconfig['rootpath']
+))->setHelp('string-format: iscsi:(servername):(protocol):(port):(LUN):targetname ');
+
+$form->add($section);
+
if ($act == "newpool") {
$form->addGlobal(new Form_Input(
'act',
@@ -1394,7 +1398,6 @@ events.push(function() {
hideInput('mac_allow', !showadvmac && !hide);
hideInput('mac_deny', !showadvmac && !hide);
- hideInput('btnadvmac', hide);
showadvmac = !showadvmac;
}
@@ -1402,7 +1405,7 @@ events.push(function() {
$('#btnadvmac').prop('type', 'button');
$('#btnadvmac').click(function(event) {
- show_advmac();
+ show_advmac(true);
});
// Show advanced NTP options ======================================================================================
@@ -1432,7 +1435,7 @@ events.push(function() {
});
// Show advanced TFTP options ======================================================================================
- var showadvtftp = false;
+ var showtftp = false;
function show_advtftp() {
<?php
@@ -1444,10 +1447,9 @@ events.push(function() {
?>
var hide = <?php if ($hide) {echo 'true';} else {echo 'false';} ?>;
- hideInput('tftp', !showadvtftp && !hide);
- hideInput('btnadvtftp', hide);
+ hideInput('tftp', !showtftp & !hide);
- showadvtftp = !showadvtftp;
+ showtftp = !showtftp;
}
$('#btnadvtftp').prop('type', 'button');
@@ -1481,37 +1483,6 @@ events.push(function() {
show_advldap();
});
- // Show advanced NETBOOT options ===================================================================================
- var showadvboot = false;
-
- function show_advboot() {
-<?php
- if (!$pconfig['netboot'] && empty($pconfig['nextserver']) && empty($pconfig['filename']) && empty($pconfig['filename32']) &&
- empty($pconfig['filename64']) && empty($pconfig['rootpath'])) {
- $hide = false;
- } else {
- $hide = true;
- }
-?>
- var hide = <?php if ($hide) {echo 'true';} else {echo 'false';} ?>;
-
- hideCheckbox('netboot', !showadvboot && !hide);
- hideInput('nextserver', !showadvboot && !hide);
- hideInput('filename', !showadvboot && !hide);
- hideInput('filename32', !showadvboot && !hide);
- hideInput('filename64', !showadvboot && !hide);
- hideInput('rootpath', !showadvboot && !hide);
- hideInput('btnadvboot', hide);
-
- showadvboot = !showadvboot;
- }
-
- $('#btnadvboot').prop('type', 'button');
-
- $('#btnadvboot').click(function(event) {
- show_advboot();
- });
-
// Show advanced additional opts options ===========================================================================
var showadvopts = false;
@@ -1545,7 +1516,6 @@ events.push(function() {
show_advntp();
show_advtftp();
show_advldap();
- show_advboot();
show_advopts();
// Suppress "Delete row" button if there are fewer than two rows
diff --git a/src/usr/local/www/services_dhcp_edit.php b/src/usr/local/www/services_dhcp_edit.php
index 303833c..dfc11fb 100644
--- a/src/usr/local/www/services_dhcp_edit.php
+++ b/src/usr/local/www/services_dhcp_edit.php
@@ -238,10 +238,7 @@ if ($_POST) {
/* make sure it's not within the dynamic subnet */
if ($_POST['ipaddr']) {
- $dynsubnet_start = ip2ulong($config['dhcpd'][$if]['range']['from']);
- $dynsubnet_end = ip2ulong($config['dhcpd'][$if]['range']['to']);
- if ((ip2ulong($_POST['ipaddr']) >= $dynsubnet_start) &&
- (ip2ulong($_POST['ipaddr']) <= $dynsubnet_end)) {
+ if (is_inrange_v4($_POST['ipaddr'], $config['dhcpd'][$if]['range']['from'], $config['dhcpd'][$if]['range']['to'])) {
$input_errors[] = sprintf(gettext("The IP address must not be within the DHCP range for this interface."));
}
diff --git a/src/usr/local/www/services_dhcp_relay.php b/src/usr/local/www/services_dhcp_relay.php
index e1f287d..2f71de0 100644
--- a/src/usr/local/www/services_dhcp_relay.php
+++ b/src/usr/local/www/services_dhcp_relay.php
@@ -100,6 +100,7 @@ if (is_array($config['dhcpd'])) {
}
if ($_POST) {
+
unset($input_errors);
$pconfig = $_POST;
@@ -137,7 +138,7 @@ if ($_POST) {
$config['dhcrelay']['enable'] = $_POST['enable'] ? true : false;
$config['dhcrelay']['interface'] = implode(",", $_POST['interface']);
$config['dhcrelay']['agentoption'] = $_POST['agentoption'] ? true : false;
- $config['dhcrelay']['server'] = $pconfig['server'];
+ $config['dhcrelay']['server'] = $svrlist;
write_config();
@@ -148,12 +149,14 @@ if ($_POST) {
}
}
+$pconfig['server'] = $config['dhcrelay']['server'];
+
$pgtitle = array(gettext("Services"), gettext("DHCP Relay"));
$shortcut_section = "dhcp";
include("head.inc");
if ($dhcpd_enabled) {
- echo '<div class="alert alert-danger">DHCP Server is currently enabled. Cannot enable the DHCP Relay service while the DHCP Server is enabled on any interface.</div>';
+ echo '<div class="alert alert-danger">' . gettext("DHCP Server is currently enabled. Cannot enable the DHCP Relay service while the DHCP Server is enabled on any interface.") . '</div>';
include("foot.inc");
exit;
}
@@ -189,7 +192,6 @@ $section->addInput(new Form_Checkbox(
'agentoption',
'',
'Append circuit ID and agent ID to requests',
- 'yes',
$pconfig['agentoption']
))->setHelp(
'If this is checked, the DHCP relay will append the circuit ID (%s interface number) and the agent ID to the DHCP request.',
@@ -204,15 +206,15 @@ function createDestinationServerInputGroup($value = null) {
'server',
'Destination server',
$value
- ))->setWidth(4)->setHelp(
- 'This is the IP address of the server to which DHCP requests are relayed.'
- )->setIsRepeated();
+ ))->setWidth(4)
+ ->setHelp('This is the IP address of the server to which DHCP requests are relayed.')
+ ->setIsRepeated();
$group->enableDuplication(null, true); // Buttons are in-line with the input
return $group;
}
-if (!isset($pconfig['server']) || count($pconfig['server']) < 1) {
+if (!isset($pconfig['server'])) {
$section->add(createDestinationServerInputGroup());
} else {
foreach (explode(',', $pconfig['server']) as $server) {
diff --git a/src/usr/local/www/services_dhcpv6.php b/src/usr/local/www/services_dhcpv6.php
index 7f7a6b3..6d2a2c88 100644
--- a/src/usr/local/www/services_dhcpv6.php
+++ b/src/usr/local/www/services_dhcpv6.php
@@ -180,7 +180,7 @@ if ($_POST) {
if (isset($_POST["number{$x}"]) && ctype_digit($_POST["number{$x}"])) {
$numbervalue = array();
$numbervalue['number'] = htmlspecialchars($_POST["number{$x}"]);
- $numbervalue['value'] = htmlspecialchars($_POST["value{$x}"]);
+ $numbervalue['value'] = base64_encode($_POST["value{$x}"]);
$numberoptions['item'][] = $numbervalue;
}
}
@@ -195,7 +195,7 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (($_POST['prefixrange_from'] && !is_ipaddrv6($_POST['prefixrange_from']))) {
- $input_errors[] = gettext("A valid range must be specified.");
+ $input_errors[] = gettext("A valid prefix range must be specified.");
}
if (($_POST['prefixrange_to'] && !is_ipaddrv6($_POST['prefixrange_to']))) {
$input_errors[] = gettext("A valid prefix range must be specified.");
@@ -436,24 +436,6 @@ if ($_GET['act'] == "del") {
}
}
-// Delete a row in the options table
-if ($_GET['act'] == "delopt") {
- $idx = $_GET['id'];
-
- if ($pconfig['numberoptions'] && is_array($pconfig['numberoptions']['item'][$idx])) {
- unset($pconfig['numberoptions']['item'][$idx]);
- }
-}
-
-// Add an option row
-if ($_GET['act'] == "addopt") {
- if (!is_array($pconfig['numberoptions']['item'])) {
- $pconfig['numberoptions']['item'] = array();
- }
-
- array_push($pconfig['numberoptions']['item'], array('number' => null, 'value' => null));
-}
-
$pgtitle = array(gettext("Services"), gettext("DHCPv6 Server"));
$shortcut_section = "dhcp6";
@@ -474,7 +456,7 @@ if ($dhcrelay_enabled) {
}
if (is_subsystem_dirty('staticmaps')) {
- print_info_box_np(gettext('The static mapping configuration has been changed') . '.<br />' . gettext('You must apply the changes in order for them to take effect.'));
+ print_apply_box(gettext('The static mapping configuration has been changed.') . '<br />' . gettext('You must apply the changes in order for them to take effect.'));
}
/* active tabs */
@@ -834,48 +816,53 @@ $form->add($section);
$title = 'Show Additional BOOTP/DHCP Options';
-if ($pconfig['numberoptions']) {
- $counter = 0;
- $last = count($pconfig['numberoptions']['item']) - 1;
-
- foreach ($pconfig['numberoptions']['item'] as $item) {
- $group = new Form_Group(null);
-
- $group->add(new Form_Input(
- 'number' . $counter,
- null,
- 'text',
- $item['number']
- ))->setHelp($counter == $last ? 'Number':null);
-
- $group->add(new Form_Input(
- 'value' . $counter,
- null,
- 'text',
- $item['value']
- ))->setHelp($counter == $last ? 'Value':null);
-
- $btn = new Form_Button(
- 'btn' . $counter,
- 'Delete',
- 'services_dhcpv6.php?if=' . $if . '&act=delopt' . '&id=' . $counter
- );
-
- $btn->removeClass('btn-primary')->addClass('btn-danger btn-xs adnlopt');
- $group->addClass('adnlopt');
- $group->add($btn);
- $section->add($group);
- $counter++;
- }
+if (!$pconfig['numberoptions']) {
+ $noopts = true;
+ $pconfig['numberoptions']['item'] = array(0 => array('number' => "", 'value' => ""));
+} else {
+ $noopts = false;
}
+$counter = 0;
+$last = count($pconfig['numberoptions']['item']) - 1;
+
+foreach ($pconfig['numberoptions']['item'] as $item) {
+ $group = new Form_Group(null);
+ $group->addClass('repeatable');
+ $group->addClass('adnloptions');
+
+ $group->add(new Form_Input(
+ 'number' . $counter,
+ null,
+ 'text',
+ $item['number']
+ ))->setHelp($counter == $last ? 'Number':null);
+
+ $group->add(new Form_Input(
+ 'value' . $counter,
+ null,
+ 'text',
+ base64_decode($item['value'])
+ ))->setHelp($counter == $last ? 'Value':null);
+
+ $btn = new Form_Button(
+ 'deleterow' . $counter,
+ 'Delete'
+ );
+
+ $btn->removeClass('btn-primary')->addClass('btn-warning');
+ $group->add($btn);
+ $section->add($group);
+ $counter++;
+}
+
+
$btnaddopt = new Form_Button(
- 'btnaddopt',
- 'Add Option',
- 'services_dhcpv6.php?if=' . $if . '&act=addopt'
+ 'addrowt',
+ 'Add Option'
);
-$btnaddopt->removeClass('btn-primary')->addClass('btn-success btn-sm');
+$btnaddopt->removeClass('btn-primary')->addClass('btn-success btn-sm')->addClass('adnloptions');
$section->addInput($btnaddopt);
@@ -888,15 +875,26 @@ $section->addInput(new Form_Input(
print($form);
-print_info_box(gettext('The DNS servers entered in ') . '<a href="system.php">' . gettext(' System: General setup') . '</a>' .
- gettext(' (or the ') . '<a href="services_dnsmasq.php"/>' . gettext('DNS forwarder') . '</a>, ' . gettext('if enabled) ') .
- gettext('will be assigned to clients by the DHCP server.') . '<br />' .
- gettext('The DHCP lease table can be viewed on the ') . '<a href="status_dhcpv6_leases.php">' .
- gettext('Status: DHCPv6 leases') . '</a>' . gettext(' page.'));
?>
-
+<div class="infoblock blockopen">
+<?php
+print_info_box(
+ sprintf(
+ gettext('The DNS servers entered in %1$sSystem: General setup%3$s (or the %2$sDNS forwarder%3$s if enabled) will be assigned to clients by the DHCP server.'),
+ '<a href="system.php">',
+ '<a href="services_dnsmasq.php"/>',
+ '</a>') .
+ '<br />' .
+ sprintf(
+ gettext('The DHCP lease table can be viewed on the %1$sStatus: DHCPv6 leases%2$s page.'),
+ '<a href="status_dhcpv6_leases.php">',
+ '</a>'),
+ 'info',
+ false);
+?>
+</div>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">DHCPv6 Static Mappings for this interface.</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("DHCPv6 Static Mappings for this interface.");?></h2></div>
<div class="panel-body table-responsive">
<table class="table table-striped table-hover table-condensed">
<thead>
@@ -956,7 +954,7 @@ endif;
events.push(function() {
function hideDDNS(hide) {
- hideCheckBox('ddnsupdate', hide);
+ hideCheckbox('ddnsupdate', hide);
hideInput('ddnsdomain', hide);
hideInput('ddnsdomainprimary', hide);
hideInput('ddnsdomainkeyname', hide);
@@ -1009,7 +1007,7 @@ events.push(function() {
// Show netboot controls
$("#btnnetboot").click(function() {
hideInput('bootfile_url', false);
- hideCheckBox('shownetboot', false);
+ hideCheckbox('shownetboot', false);
});
// Make the 'additional options' button a plain button, not a submit button
@@ -1017,7 +1015,7 @@ events.push(function() {
// Show additional controls
$("#btnadnl").click(function() {
- hideClass('adnlopt', false);
+ hideClass('adnloptions', false);
hideInput('btnaddopt', false);
});
@@ -1027,8 +1025,8 @@ events.push(function() {
hideInput('tftp', true);
hideInput('ldap', true);
hideInput('bootfile_url', true);
- hideCheckBox('shownetboot', true);
- hideClass('adnlopt', true);
+ hideCheckbox('shownetboot', true);
+ hideClass('adnloptions', <?php echo json_encode($noopts); ?>);
hideInput('btnaddopt', true);
});
//]]>
diff --git a/src/usr/local/www/services_dhcpv6_relay.php b/src/usr/local/www/services_dhcpv6_relay.php
index a8b1d33..c95b0df 100644
--- a/src/usr/local/www/services_dhcpv6_relay.php
+++ b/src/usr/local/www/services_dhcpv6_relay.php
@@ -63,23 +63,15 @@
##|-PRIV
require("guiconfig.inc");
-function filterDestinationServers(array $destinationServers) {
- return array_unique(
- array_filter($destinationServers)
- );
-}
$pconfig['enable'] = isset($config['dhcrelay6']['enable']);
+
if (empty($config['dhcrelay6']['interface'])) {
$pconfig['interface'] = array();
} else {
$pconfig['interface'] = explode(",", $config['dhcrelay6']['interface']);
}
-$pconfig['server'] = filterDestinationServers(
- explode(',', $config['dhcrelay6']['server'])
-);
-
$pconfig['agentoption'] = isset($config['dhcrelay6']['agentoption']);
$iflist = array_intersect_key(
@@ -112,10 +104,6 @@ if ($_POST) {
unset($input_errors);
- if ($_POST['server']) {
- $_POST['server'] = filterDestinationServers($_POST['server']);
- }
-
$pconfig = $_POST;
/* input validation */
@@ -125,10 +113,21 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
+ $svrlist = '';
+
if ($_POST['server']) {
- foreach ($_POST['server'] as $srv) {
- if (!is_ipaddrv6($srv)) {
- $input_errors[] = gettext("A valid Destination Server IPv6 address must be specified.");
+ foreach ($_POST['server'] as $checksrv => $srv) {
+ if (!is_ipaddrv6($srv[0])) {
+ $input_errors[] = gettext("A valid Destination Server IPv6 address must be specified.");
+ }
+
+
+ if (!empty($srv[0])) { // Filter out any empties
+ if (!empty($svrlist)) {
+ $svrlist .= ',';
+ }
+
+ $svrlist .= $srv[0];
}
}
}
@@ -138,7 +137,7 @@ if ($_POST) {
$config['dhcrelay6']['enable'] = $_POST['enable'] ? true : false;
$config['dhcrelay6']['interface'] = implode(",", $_POST['interface']);
$config['dhcrelay6']['agentoption'] = $_POST['agentoption'] ? true : false;
- $config['dhcrelay6']['server'] = $_POST['server'];
+ $config['dhcrelay6']['server'] = $svrlist;
write_config();
@@ -148,12 +147,14 @@ if ($_POST) {
}
}
+$pconfig['server'] = $config['dhcrelay6']['server'];
+
$pgtitle = array(gettext("Services"), gettext("DHCPv6 Relay"));
$shortcut_section = "dhcp6";
include("head.inc");
if ($dhcpd_enabled) {
- echo '<div class="alert alert-danger">DHCPv6 Server is currently enabled. Cannot enable the DHCPv6 Relay service while the DHCPv6 Server is enabled on any interface.</div>';
+ echo '<div class="alert alert-danger">' . gettext("DHCPv6 Server is currently enabled. Cannot enable the DHCPv6 Relay service while the DHCPv6 Server is enabled on any interface.") . '</div>';
include("foot.inc");
exit;
}
@@ -163,7 +164,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
$form = new Form;
@@ -190,7 +191,6 @@ $section->addInput(new Form_Checkbox(
'agentoption',
'',
'Append circuit ID and agent ID to requests',
- 'yes',
$pconfig['agentoption']
))->setHelp(
'If this is checked, the DHCPv6 relay will append the circuit ID (%s interface number) and the agent ID to the DHCPv6 request.',
@@ -199,23 +199,24 @@ $section->addInput(new Form_Checkbox(
function createDestinationServerInputGroup($value = null) {
$group = new Form_Group('Destination server');
- $group->enableDuplication();
$group->add(new Form_IpAddress(
'server',
'Destination server',
$value
- ))->setHelp(
- 'This is the IPv6 address of the server to which DHCPv6 requests are relayed.'
- )->setIsRepeated();
+ ))->setWidth(4)
+ ->setHelp('This is the IPv6 address of the server to which DHCPv6 requests are relayed.')
+ ->setIsRepeated();
+
+ $group->enableDuplication(null, true); // Buttons are in-line with the input
return $group;
}
-if (!isset($pconfig['server']) || count($pconfig['server']) < 1) {
+if (!isset($pconfig['server'])) {
$section->add(createDestinationServerInputGroup());
} else {
- foreach ($pconfig['server'] as $idx => $server) {
+ foreach (explode(',', $pconfig['server']) as $server) {
$section->add(createDestinationServerInputGroup($server));
}
}
diff --git a/src/usr/local/www/services_dnsmasq.php b/src/usr/local/www/services_dnsmasq.php
index c6f230d..9cdae22 100644
--- a/src/usr/local/www/services_dnsmasq.php
+++ b/src/usr/local/www/services_dnsmasq.php
@@ -130,7 +130,7 @@ if ($_POST) {
if (isset($_POST['enable']) && isset($config['unbound']['enable'])) {
if ($_POST['port'] == $config['unbound']['port']) {
- $input_errors[] = "The DNS Resolver is enabled using this port. Choose a non-conflicting port, or disable DNS Resolver.";
+ $input_errors[] = gettext("The DNS Resolver is enabled using this port. Choose a non-conflicting port, or disable DNS Resolver.");
}
}
@@ -189,6 +189,8 @@ if ($_GET['act'] == "del") {
}
function build_if_list() {
+ global $pconfig;
+
$interface_addresses = get_possible_listen_ips(true);
$iflist = array('options' => array(), 'selected' => array());
@@ -223,7 +225,7 @@ if ($savemsg) {
}
if (is_subsystem_dirty('hosts')) {
- print_info_box_np(gettext("The DNS forwarder configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The DNS forwarder configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$form = new Form();
@@ -339,19 +341,23 @@ $section->addInput(new Form_Textarea(
$form->add($section);
print($form);
-
-print_info_box(sprintf("If the DNS forwarder is enabled, the DHCP".
- " service (if enabled) will automatically serve the LAN IP".
- " address as a DNS server to DHCP clients so they will use".
- " the forwarder. The DNS forwarder will use the DNS servers".
- " entered in %sSystem: General setup%s".
- " or those obtained via DHCP or PPP on WAN if the &quot;Allow".
- " DNS server list to be overridden by DHCP/PPP on WAN&quot;".
- " is checked. If you don't use that option (or if you use".
- " a static IP address on WAN), you must manually specify at".
- " least one DNS server on the %sSystem:".
- "General setup%s page.",'<a href="system.php">','</a>','<a href="system.php">','</a>'), info);
?>
+<div class="infoblock blockopen">
+<?php
+print_info_box(
+ sprintf(
+ gettext('If the DNS forwarder is enabled, the DHCP service (if enabled) will automatically' .
+ ' serve the LAN IP address as a DNS server to DHCP clients so they will use the forwarder.' .
+ ' The DNS forwarder will use the DNS servers entered in %1$sSystem: General setup%3$s or' .
+ ' those obtained via DHCP or PPP on WAN if &quot;Allow DNS server list to be overridden by DHCP/PPP on WAN&quot; is checked.' .
+ ' If you don\'t use that option (or if you use a static IP address on WAN),' .
+ ' you must manually specify at least one DNS server on the %2$sSystem:General setup%3$s page.'),
+ '<a href="system.php">',
+ '<a href="system.php">',
+ '</a>'),
+ 'info', false);
+?>
+</div>
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?=gettext("Host Overrides")?></h2></div>
@@ -401,7 +407,7 @@ foreach ($a_hosts as $i => $hostent):
<?=$alias['domain']?>
</td>
<td>
- Alias for <?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain']?>
+ <?=gettext("Alias for ");?><?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain']?>
</td>
<td>
<i class="fa fa-angle-double-right text-info"></i>
@@ -428,10 +434,12 @@ endforeach;
</a>
</nav>
+<div class="infoblock blockopen">
<?php
-print_info_box(gettext("Entries in this section override individual results from the forwarders.") .
- gettext("Use these for changing DNS results or for adding custom DNS records."), info);
+print_info_box(gettext("Entries in this section override individual results from the forwarders.") . " " .
+ gettext("Use these for changing DNS results or for adding custom DNS records."), 'info', false);
?>
+</div>
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?=gettext("Domain Overrides")?></h2></div>
@@ -480,20 +488,11 @@ endforeach;
</a>
</nav>
-<script type="text/javascript">
-//<![CDATA[
-events.push(function() {
- // On clicking the "Apply" button, submit the main form, not the little form the button lives in
-// $('[name=apply]').prop('type', 'button');
-
-// $('[name=apply]').click(function() {
-// $('form:last').submit();
-// });
-// });
-//]]>
-</script>
+<div class="infoblock blockopen">
<?php
print_info_box(gettext("Entries in this area override an entire domain, and subdomains, by specifying an".
- " authoritative DNS server to be queried for that domain."), info);
-
+ " authoritative DNS server to be queried for that domain."), 'info', false);
+?>
+</div>
+<?php
include("foot.inc");
diff --git a/src/usr/local/www/services_dnsmasq_domainoverride_edit.php b/src/usr/local/www/services_dnsmasq_domainoverride_edit.php
index b230a4b..f0ffd9c 100644
--- a/src/usr/local/www/services_dnsmasq_domainoverride_edit.php
+++ b/src/usr/local/www/services_dnsmasq_domainoverride_edit.php
@@ -198,7 +198,7 @@ if (isset($id) && $a_domainOverrides[$id]) {
null,
'hidden',
$pconfig['id']
- ))->setHelp('You may enter a description here for your reference (not parsed).');
+ ));
}
$form->add($section);
diff --git a/src/usr/local/www/services_dyndns.php b/src/usr/local/www/services_dyndns.php
index 234f5f9..e095cb2 100644
--- a/src/usr/local/www/services_dyndns.php
+++ b/src/usr/local/www/services_dyndns.php
@@ -70,7 +70,12 @@ $a_dyndns = &$config['dyndnses']['dyndns'];
if ($_GET['act'] == "del") {
$conf = $a_dyndns[$_GET['id']];
- @unlink("{$g['conf_path']}/dyndns_{$conf['interface']}{$conf['type']}" . escapeshellarg($conf['host']) . "{$conf['id']}.cache");
+ if ($conf['type'] == "namecheap") {
+ $hostname = $conf['host'] . "." . $conf['domainname'];
+ } else {
+ $hostname = $conf['host'];
+ }
+ @unlink("{$g['conf_path']}/dyndns_{$conf['interface']}{$conf['type']}" . escapeshellarg($hostname) . "{$conf['id']}.cache");
unset($a_dyndns[$_GET['id']]);
write_config();
@@ -92,7 +97,7 @@ if ($_GET['act'] == "del") {
exit;
}
}
-$pgtitle = array(gettext("Services"), gettext("Dynamic DNS"), gettext("Dynamic DNS Clients"));
+$pgtitle = array(gettext("Services"), gettext("Dynamic DNS"), gettext("Clients"));
include("head.inc");
if ($input_errors) {
@@ -105,25 +110,33 @@ $tab_array[] = array(gettext("RFC 2136"), false, "services_rfc2136.php");
display_top_tabs($tab_array);
?>
<form action="services_dyndns.php" method="post" name="iform" id="iform">
- <div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Interface")?></th>
- <th><?=gettext("Service")?></th>
- <th><?=gettext("Hostname")?></th>
- <th><?=gettext("Cached IP")?></th>
- <th><?=gettext("Description")?></th>
- <th><?=gettext("Actions")?></th>
- </tr>
- </thead>
- <tbody>
+ <div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Dynamic DNS Clients')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Interface")?></th>
+ <th><?=gettext("Service")?></th>
+ <th><?=gettext("Hostname")?></th>
+ <th><?=gettext("Cached IP")?></th>
+ <th><?=gettext("Description")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$i = 0;
foreach ($a_dyndns as $dyndns):
+ if ($dyndns['type'] == "namecheap") {
+ $hostname = $dyndns['host'] . "." . $dyndns['domainname'];
+ } else {
+ $hostname = $dyndns['host'];
+ }
?>
- <tr<?=!isset($dyndns['enable'])?' class="disabled"':''?>>
- <td>
+ <tr<?=!isset($dyndns['enable'])?' class="disabled"':''?>>
+ <td>
<?php
$iflist = get_configured_interface_with_descr();
foreach ($iflist as $if => $ifdesc) {
@@ -142,8 +155,8 @@ foreach ($a_dyndns as $dyndns):
}
}
?>
- </td>
- <td>
+ </td>
+ <td>
<?php
$types = explode(",", DYNDNS_PROVIDER_DESCRIPTIONS);
$vals = explode(" ", DYNDNS_PROVIDER_VALUES);
@@ -156,16 +169,16 @@ foreach ($a_dyndns as $dyndns):
}
}
?>
- </td>
- <td>
+ </td>
+ <td>
<?php
- print(htmlspecialchars($dyndns['host']));
+ print(htmlspecialchars($hostname));
?>
- </td>
- <td>
+ </td>
+ <td>
<?php
- $filename = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache";
- $filename_v6 = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}_v6.cache";
+ $filename = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($hostname) . "{$dyndns['id']}.cache";
+ $filename_v6 = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($hostname) . "{$dyndns['id']}_v6.cache";
if (file_exists($filename)) {
$ipaddr = dyndnsCheckIP($dyndns['interface']);
$cached_ip_s = explode(":", file_get_contents($filename));
@@ -196,31 +209,33 @@ foreach ($a_dyndns as $dyndns):
print('N/A');
}
?>
- </td>
- <td>
+ </td>
+ <td>
<?php
print(htmlspecialchars($dyndns['descr']));
?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit service')?>" href="services_dyndns_edit.php?id=<?=$i?>"></a>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit service')?>" href="services_dyndns_edit.php?id=<?=$i?>"></a>
<?php if (isset($dyndns['enable'])) {
?>
- <a class="fa fa-ban" title="<?=gettext('Disable service')?>" href="?act=toggle&amp;id=<?=$i?>"></a>
+ <a class="fa fa-ban" title="<?=gettext('Disable service')?>" href="?act=toggle&amp;id=<?=$i?>"></a>
<?php } else {
?>
- <a class="fa fa-check-square-o" title="<?=gettext('Enable service')?>" href="?act=toggle&amp;id=<?=$i?>"></a>
+ <a class="fa fa-check-square-o" title="<?=gettext('Enable service')?>" href="?act=toggle&amp;id=<?=$i?>"></a>
<?php }
?>
- <a class="fa fa-trash" title="<?=gettext('Delete service')?>" href="services_dyndns.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ <a class="fa fa-trash" title="<?=gettext('Delete service')?>" href="services_dyndns.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php
$i++;
endforeach;
?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
</form>
diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php
index 7330874..9cdf20e 100644
--- a/src/usr/local/www/services_dyndns_edit.php
+++ b/src/usr/local/www/services_dyndns_edit.php
@@ -92,6 +92,7 @@ if (isset($id) && isset($a_dyndns[$id])) {
$pconfig['username'] = $a_dyndns[$id]['username'];
$pconfig['password'] = $a_dyndns[$id]['password'];
$pconfig['host'] = $a_dyndns[$id]['host'];
+ $pconfig['domainname'] = $a_dyndns[$id]['domainname'];
$pconfig['mx'] = $a_dyndns[$id]['mx'];
$pconfig['type'] = $a_dyndns[$id]['type'];
$pconfig['enable'] = !isset($a_dyndns[$id]['enable']);
@@ -129,6 +130,10 @@ if ($_POST) {
$reqdfieldsn[] = gettext("Password");
$reqdfields[] = "username";
$reqdfieldsn[] = gettext("Username");
+ if ($pconfig['type'] == "namecheap") {
+ $reqdfields[] = "domainname";
+ $reqdfieldsn[] = gettext("Domain Name");
+ }
} else {
$reqdfields[] = "updateurl";
$reqdfieldsn[] = gettext("Update URL");
@@ -136,12 +141,26 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
+ if ($_POST['passwordfld'] != $_POST['passwordfld_confirm']) {
+ $input_errors[] = gettext("Password and confirmed password must match.");
+ }
+
if (isset($_POST['host']) && in_array("host", $reqdfields)) {
/* Namecheap can have a @. in hostname */
if ($pconfig['type'] == "namecheap" && substr($_POST['host'], 0, 2) == '@.') {
$host_to_check = substr($_POST['host'], 2);
} else {
$host_to_check = $_POST['host'];
+
+ /* No-ip can have a @ in hostname */
+ if (substr($pconfig['type'], 0, 4) == "noip") {
+ $last_to_check = strrpos($host_to_check, '@');
+ if ($last_to_check !== false) {
+ $host_to_check = substr_replace(
+ $host_to_check, '.', $last_to_check, 1);
+ }
+ unset($last_to_check);
+ }
}
if ($pconfig['type'] != "custom" && $pconfig['type'] != "custom-v6") {
@@ -163,8 +182,13 @@ if ($_POST) {
$dyndns = array();
$dyndns['type'] = $_POST['type'];
$dyndns['username'] = $_POST['username'];
- $dyndns['password'] = $_POST['passwordfld'];
+ if ($_POST['passwordfld'] != DMYPWD) {
+ $dyndns['password'] = $_POST['passwordfld'];
+ } else {
+ $dyndns['password'] = $a_dyndns[$id]['password'];;
+ }
$dyndns['host'] = $_POST['host'];
+ $dyndns['domainname'] = $_POST['domainname'];
$dyndns['mx'] = $_POST['mx'];
$dyndns['wildcard'] = $_POST['wildcard'] ? true : false;
$dyndns['verboselog'] = $_POST['verboselog'] ? true : false;
@@ -293,15 +317,28 @@ $section->addInput(new Form_Select(
$interfacelist
))->setHelp('This is almost always the same as the Interface to Monitor. ');
-$section->addInput(new Form_Input(
+$group = new Form_Group('Hostname');
+
+$group->add(new Form_Input(
'host',
'Hostname',
'text',
$pconfig['host']
-))->setHelp('Enter the complete fully qualified domain name. Example: myhost.dyndns.org'. '<br />' .
+));
+$group->add(new Form_Input(
+ 'domainname',
+ 'Domain Name',
+ 'text',
+ $pconfig['domainname']
+));
+
+$group->setHelp('Enter the complete fully qualified domain name. Example: myhost.dyndns.org'. '<br />' .
'he.net tunnelbroker: Enter your tunnel ID' . '<br />' .
'GleSYS: Enter your record ID' . '<br />' .
- 'DNSimple: Enter only the domain name.');
+ 'DNSimple: Enter only the domain name.' . '<br />' .
+ 'Namecheap: Enter the hostname and the domain separately, with the domain being the domain or subdomain zone being handled by Namecheap.');
+
+$section->add($group);
$section->addInput(new Form_Input(
'mx',
@@ -349,7 +386,7 @@ $section->addInput(new Form_Input(
'GleSYS: Enter your API user.' . '<br />' .
'For Custom Entries, Username and Password represent HTTP Authentication username and passwords.');
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'passwordfld',
'Password',
'password',
@@ -426,6 +463,7 @@ events.push(function() {
switch (service) {
case "custom" :
case "custom-v6" :
+ hideGroupInput('domainname', true);
hideInput('resultmatch', false);
hideInput('updateurl', false);
hideInput('requestif', false);
@@ -440,6 +478,7 @@ events.push(function() {
case "dnsimple":
case "route53":
+ hideGroupInput('domainname', true);
hideInput('resultmatch', true);
hideInput('updateurl', true);
hideInput('requestif', true);
@@ -451,8 +490,21 @@ events.push(function() {
hideInput('zoneid', false);
hideInput('ttl', false);
break;
-
+ case "namecheap":
+ hideGroupInput('domainname', false);
+ hideInput('resultmatch', true);
+ hideInput('updateurl', true);
+ hideInput('requestif', true);
+ hideCheckbox('curl_ipresolve_v4', true);
+ hideCheckbox('curl_ssl_verifypeer', true);
+ hideInput('host', false);
+ hideInput('mx', false);
+ hideCheckbox('wildcard', false);
+ hideInput('zoneid', true);
+ hideInput('ttl', true);
+ break;
default:
+ hideGroupInput('domainname', true);
hideInput('resultmatch', true);
hideInput('updateurl', true);
hideInput('requestif', true);
diff --git a/src/usr/local/www/services_igmpproxy.php b/src/usr/local/www/services_igmpproxy.php
index 7face46..aae82f7 100644
--- a/src/usr/local/www/services_igmpproxy.php
+++ b/src/usr/local/www/services_igmpproxy.php
@@ -106,35 +106,38 @@ if ($savemsg) {
}
if (is_subsystem_dirty('igmpproxy')) {
- print_info_box_np(gettext('The IGMP entry list has been changed.' . '<br />' . 'You must apply the changes in order for them to take effect.'));
+ print_apply_box(gettext('The IGMP entry list has been changed.') . '<br />' . gettext('You must apply the changes in order for them to take effect.'));
}
?>
<form action="services_igmpproxy.php" method="post">
- <div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Name")?></th>
- <th><?=gettext("Type")?></th>
- <th><?=gettext("Values")?></th>
- <th><?=gettext("Description")?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+ <div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('IGMP Proxy')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Name")?></th>
+ <th><?=gettext("Type")?></th>
+ <th><?=gettext("Values")?></th>
+ <th><?=gettext("Description")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$i = 0;
foreach ($a_igmpproxy as $igmpentry):
?>
- <tr>
- <td>
- <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($igmpentry['ifname']))?>
- </td>
- <td>
- <?=htmlspecialchars($igmpentry['type'])?>
- </td>
- <td>
+ <tr>
+ <td>
+ <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($igmpentry['ifname']))?>
+ </td>
+ <td>
+ <?=htmlspecialchars($igmpentry['type'])?>
+ </td>
+ <td>
<?php
$addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10));
print($addresses);
@@ -145,21 +148,23 @@ foreach ($a_igmpproxy as $igmpentry):
print('...');
}
?>
- </td>
- <td>
- <?=htmlspecialchars($igmpentry['descr'])?>&nbsp;
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit IGMP entry')?>" href="services_igmpproxy_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete IGMP entry')?>" href="services_igmpproxy.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ </td>
+ <td>
+ <?=htmlspecialchars($igmpentry['descr'])?>&nbsp;
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit IGMP entry')?>" href="services_igmpproxy_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete IGMP entry')?>" href="services_igmpproxy.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php
$i++;
endforeach;
?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
</form>
@@ -174,9 +179,9 @@ endforeach;
</a>
</nav>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(gettext('Please add the interface for upstream, the allowed subnets, and the downstream interfaces you would like the proxy to allow. ' .
- 'Only one "upstream" interface can be configured.'), info)?>
+ 'Only one "upstream" interface can be configured.'), 'info', false)?>
</div>
<?php
include("foot.inc");
diff --git a/src/usr/local/www/services_igmpproxy_edit.php b/src/usr/local/www/services_igmpproxy_edit.php
index 371b85a..ff86376 100644
--- a/src/usr/local/www/services_igmpproxy_edit.php
+++ b/src/usr/local/www/services_igmpproxy_edit.php
@@ -257,7 +257,7 @@ foreach ($item as $ww) {
null,
$address,
['placeholder' => 'Address']
- ))->sethelp($tracker == $rows ? 'Network/CIDR':null)->addMask('address_subnet' . $tracker, $address_subnet)->setWidth(4)->setPattern('[0-9, a-z, A-Z and .');
+ ))->sethelp($tracker == $rows ? 'Network/CIDR':null)->addMask('address_subnet' . $tracker, $address_subnet)->setWidth(4)->setPattern('[a-zA-Z0-9\_\.\:]+');
$group->add(new Form_Button(
'deleterow' . $counter,
diff --git a/src/usr/local/www/services_ntpd.php b/src/usr/local/www/services_ntpd.php
index 0600045..7892456 100644
--- a/src/usr/local/www/services_ntpd.php
+++ b/src/usr/local/www/services_ntpd.php
@@ -75,7 +75,7 @@ if (empty($config['ntpd']['interface'])) {
is_array($config['installedpackages']['openntpd']['config'][0]) && !empty($config['installedpackages']['openntpd']['config'][0]['interface'])) {
$pconfig['interface'] = explode(",", $config['installedpackages']['openntpd']['config'][0]['interface']);
unset($config['installedpackages']['openntpd']);
- write_config("Upgraded settings from openttpd");
+ write_config(gettext("Upgraded settings from openttpd"));
} else {
$pconfig['interface'] = array();
}
@@ -283,7 +283,7 @@ display_top_tabs($tab_array);
$form = new Form;
-$section = new Form_Section('NTP server configuration');
+$section = new Form_Section('NTP Server Configuration');
$iflist = build_interface_list();
@@ -300,7 +300,7 @@ $section->addInput(new Form_Select(
$timeservers = explode(' ', $config['system']['timeservers']);
$maxrows = max(count($timeservers), 1);
for ($counter=0; $counter < $maxrows; $counter++) {
- $group = new Form_Group($counter == 0 ? 'Time servers':'');
+ $group = new Form_Group($counter == 0 ? 'Time Servers':'');
$group->addClass('repeatable');
$group->add(new Form_Input(
@@ -347,7 +347,7 @@ $section->addInput(new Form_StaticText(
$section->addInput(new Form_Input(
'ntporphan',
- 'Orphan mode',
+ 'Orphan Mode',
'text',
$pconfig['ntporphan']
))->setHelp('Orphan mode allows the system clock to be used when no other clocks are available. ' .
@@ -363,18 +363,18 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_Checkbox(
'logpeer',
- 'Syslog logging',
- 'Enable logging of peer messages (default: disabled).',
+ 'Logging',
+ 'Log peer messages (default: disabled).',
$pconfig['logpeer']
));
$section->addInput(new Form_Checkbox(
'logsys',
null,
- 'Enable logging of system messages (default: disabled).',
+ 'Log system messages (default: disabled).',
$pconfig['logsys']
))->setHelp('These options enable additional messages from NTP to be written to the System Log ' .
- '<a href="diag_logs_ntpd.php">' . 'Status > System Logs > NTP' . '</a>');
+ '<a href="status_logs.php?logfile=ntpd">' . 'Status > System Logs > NTP' . '</a>');
// Statistics logging section
$btnadvstats = new Form_Button(
@@ -385,28 +385,28 @@ $btnadvstats = new Form_Button(
$btnadvstats->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText(
- 'Statistics logging',
+ 'Statistics Logging',
$btnadvstats
))->setHelp('Warning: These options will create persistent daily log files in /var/log/ntp.');
$section->addInput(new Form_Checkbox(
'clockstats',
null,
- 'Enable logging of reference clock statistics (default: disabled).',
+ 'Log reference clock statistics (default: disabled).',
$pconfig['clockstats']
));
$section->addInput(new Form_Checkbox(
'loopstats',
null,
- 'Enable logging of clock discipline statistics (default: disabled).',
+ 'Log clock discipline statistics (default: disabled).',
$pconfig['loopstats']
));
$section->addInput(new Form_Checkbox(
'peerstats',
null,
- 'Enable logging of NTP peer statistics (default: disabled).',
+ 'Log NTP peer statistics (default: disabled).',
$pconfig['peerstats']
));
@@ -426,43 +426,43 @@ $section->addInput(new Form_StaticText(
$section->addInput(new Form_Checkbox(
'kod',
null,
- 'Enable Kiss-o\'-death packets (default: enabled).',
- $pconfig['kod']
+ 'Enable Kiss-o\'-death packets (default: checked).',
+ !$pconfig['kod']
));
$section->addInput(new Form_Checkbox(
'nomodify',
null,
- 'Deny state modifications (i.e. run time configuration) by ntpq and ntpdc (default: enabled).',
- $pconfig['nomodify']
+ 'Deny state modifications (i.e. run time configuration) by ntpq and ntpdc (default: checked).',
+ !$pconfig['nomodify']
));
$section->addInput(new Form_Checkbox(
'noquery',
null,
- 'Disable ntpq and ntpdc queries (default: disabled).',
+ 'Disable ntpq and ntpdc queries (default: unchecked).',
$pconfig['noquery']
));
$section->addInput(new Form_Checkbox(
'noserve',
null,
- 'Disable all except ntpq and ntpdc queries (default: disabled).',
+ 'Disable all except ntpq and ntpdc queries (default: unchecked).',
$pconfig['noserve']
));
$section->addInput(new Form_Checkbox(
'nopeer',
null,
- 'Deny packets that attempt a peer association (default: enabled).',
- $pconfig['nopeer']
+ 'Deny packets that attempt a peer association (default: checked).',
+ !$pconfig['nopeer']
));
$section->addInput(new Form_Checkbox(
'notrap',
null,
- 'Deny mode 6 control message trap service (default: enabled).',
- $pconfig['notrap']
+ 'Deny mode 6 control message trap service (default: checked).',
+ !$pconfig['notrap']
))->addClass('advrestrictions');
// Leap seconds section
@@ -522,6 +522,7 @@ events.push(function() {
// On click, show the controls in the restrictions section
$("#btnadvrestr").click(function() {
+ hideCheckbox('kod', false);
hideCheckbox('nomodify', false);
hideCheckbox('noquery', false);
hideCheckbox('noserve', false);
diff --git a/src/usr/local/www/services_ntpd_gps.php b/src/usr/local/www/services_ntpd_gps.php
index fc60424..2781178 100644
--- a/src/usr/local/www/services_ntpd_gps.php
+++ b/src/usr/local/www/services_ntpd_gps.php
@@ -83,7 +83,7 @@ function set_default_gps() {
$config['ntpd']['gps']['nmea'] = 0;
}
- write_config("Setting default NTPd settings");
+ write_config(gettext("Setting default NTPd settings"));
}
if ($_POST) {
@@ -138,8 +138,8 @@ if ($_POST) {
unset($config['ntpd']['gps']['prefer']);
}
- if (!empty($_POST['gpsselect'])) {
- $config['ntpd']['gps']['noselect'] = $_POST['gpsselect'];
+ if (!empty($_POST['gpsnoselect'])) {
+ $config['ntpd']['gps']['noselect'] = $_POST['gpsnoselect'];
} elseif (isset($config['ntpd']['gps']['noselect'])) {
unset($config['ntpd']['gps']['noselect']);
}
@@ -186,7 +186,7 @@ if ($_POST) {
unset($config['ntpd']['gps']['initcmd']);
}
- write_config("Updated NTP GPS Settings");
+ write_config(gettext("Updated NTP GPS Settings"));
$retval = system_ntp_configure();
$savemsg = get_std_save_message($retval);
@@ -202,11 +202,11 @@ function build_nmea_list() {
$nmealist = array('options' => array(), 'selected' => array());
- $nmealist['options'][0] = 'All';
- $nmealist['options'][1] = 'RMC';
- $nmealist['options'][2] = 'GGA';
- $nmealist['options'][4] = 'GLL';
- $nmealist['options'][8] = 'ZDA or ZDG';
+ $nmealist['options'][0] = gettext('All');
+ $nmealist['options'][1] = gettext('RMC');
+ $nmealist['options'][2] = gettext('GGA');
+ $nmealist['options'][4] = gettext('GLL');
+ $nmealist['options'][8] = gettext('ZDA or ZDG');
if (!$pconfig['nmea']) {
array_push($nmealist['selected'], 0);
@@ -245,11 +245,11 @@ $section->addInput(new Form_StaticText(
' to minimize clock drift if the GPS data is not valid over time. Otherwise ntpd may only use values from the unsynchronized local clock when providing time to clients.'
));
-$gpstypes = array('Custom', 'Default', 'Generic', 'Garmin', 'MediaTek', 'SiRF', 'U-Blox', 'SureGPS');
+$gpstypes = array(gettext('Custom'), gettext('Default'), 'Generic', 'Garmin', 'MediaTek', 'SiRF', 'U-Blox', 'SureGPS');
$section->addInput(new Form_Select(
'gpstype',
- 'GPS',
+ 'GPS Type',
$pconfig['type'],
array_combine($gpstypes, $gpstypes)
))->setHelp('This option allows you to select a predefined configuration. ' .
@@ -268,7 +268,7 @@ if (!empty($serialports)) {
$section->addInput(new Form_Select(
'gpsport',
- 'Serial port',
+ 'Serial Port',
$pconfig['port'],
$splist
))->setHelp('All serial ports are listed, be sure to pick the port with the GPS attached. ');
@@ -294,14 +294,14 @@ $section->addInput(new Form_Select(
$section->addInput(new Form_Input(
'gpsfudge1',
- 'Fudge time 1',
+ 'Fudge Time 1',
'text',
$pconfig['fudge1']
))->setHelp('Fudge time 1 is used to specify the GPS PPS signal offset (default: 0.0).');
$section->addInput(new Form_Input(
'gpsfudge2',
- 'Fudge time 2',
+ 'Fudge Time 2',
'text',
$pconfig['fudge2']
))->setHelp('Fudge time 2 is used to specify the GPS time offset (default: 0.0).');
@@ -316,49 +316,49 @@ $section->addInput(new Form_Input(
$section->addInput(new Form_Checkbox(
'gpsprefer',
'Flags',
- 'NTP should prefer this clock (default: enabled).',
+ 'Prefer this clock (default: checked).',
!$pconfig['prefer']
));
$section->addInput(new Form_Checkbox(
- 'gpsselect',
+ 'gpsnoselect',
null,
- 'NTP should not use this clock, it will be displayed for reference only (default: disabled).',
+ 'Do not use this clock, display for reference only (default: unchecked).',
$pconfig['noselect']
));
$section->addInput(new Form_Checkbox(
'gpsflag1',
null,
- 'Enable PPS signal processing (default: enabled).',
+ 'Enable PPS signal processing (default: checked).',
$pconfig['flag1']
));
$section->addInput(new Form_Checkbox(
'gpsflag2',
null,
- 'Enable falling edge PPS signal processing (default: rising edge).',
+ 'Enable falling edge PPS signal processing (default: unchecked, rising edge).',
$pconfig['flag2']
));
$section->addInput(new Form_Checkbox(
'gpsflag3',
null,
- 'Enable kernel PPS clock discipline (default: enabled).',
+ 'Enable kernel PPS clock discipline (default: checked).',
$pconfig['flag3']
));
$section->addInput(new Form_Checkbox(
'gpsflag4',
null,
- 'Obscure location in timestamp (default: unobscured).',
+ 'Obscure location in timestamp (default: unchecked, unobscured).',
$pconfig['flag4']
));
$section->addInput(new Form_Checkbox(
'gpssubsec',
null,
- 'Log the sub-second fraction of the received time stamp (default: Not logged).',
+ 'Log the sub-second fraction of the received time stamp (default: unchecked, not logged).',
$pconfig['subsec']
))->setHelp('Enabling this will rapidly fill the log, but is useful for tuning Fudge time 2.');
@@ -380,7 +380,7 @@ $btnadvgps->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText(
'GPS Initialization',
- $btnadvgps . '&nbsp' . 'Show GPS Initialization commands'
+ $btnadvgps . '&nbsp;' . 'Show GPS Initialization commands'
));
$section->addInput(new Form_Textarea(
@@ -530,14 +530,14 @@ events.push(function() {
set_gps_default('<?=$pconfig['type']?>');
- // Checkboxes gpsprefer and gpsselect are mutually exclusive
+ // Checkboxes gpsprefer and gpsnoselect are mutually exclusive
$('#gpsprefer').click(function() {
if ($(this).is(':checked')) {
- $('#gpsselect').prop('checked', false);
+ $('#gpsnoselect').prop('checked', false);
}
});
- $('#gpsselect').click(function() {
+ $('#gpsnoselect').click(function() {
if ($(this).is(':checked')) {
$('#gpsprefer').prop('checked', false);
}
diff --git a/src/usr/local/www/services_ntpd_pps.php b/src/usr/local/www/services_ntpd_pps.php
index 98c1b37..b050168 100644
--- a/src/usr/local/www/services_ntpd_pps.php
+++ b/src/usr/local/www/services_ntpd_pps.php
@@ -167,24 +167,24 @@ $section->addInput(new Form_StaticText(
$serialports = glob("/dev/cua?[0-9]{,.[0-9]}", GLOB_BRACE);
if (!empty($serialports)) {
- $splist = array();
-
- foreach ($serialports as $port) {
- $shortport = substr($port, 5);
- $splist[$shortport] = $shortport;
- }
-
- $section->addInput(new Form_Select(
- 'ppsport',
- 'Serial port',
- $pconfig['port'],
- $splist
- ))->setHelp('All serial ports are listed, be sure to pick the port with the PPS source attached. ');
+ $splist = array();
+
+ foreach ($serialports as $port) {
+ $shortport = substr($port, 5);
+ $splist[$shortport] = $shortport;
+ }
+
+ $section->addInput(new Form_Select(
+ 'ppsport',
+ 'Serial Port',
+ $pconfig['port'],
+ $splist
+ ))->setHelp('All serial ports are listed, be sure to pick the port with the PPS source attached. ');
}
$section->addInput(new Form_Input(
'ppsfudge1',
- 'Fudge time',
+ 'Fudge Time',
'text',
$pconfig['fudge1']
))->setHelp('Fudge time is used to specify the PPS signal offset from the actual second such as the transmission delay between the transmitter and the receiver. (default: 0.0).');
@@ -199,21 +199,21 @@ $section->addInput(new Form_Input(
$section->addInput(new Form_Checkbox(
'ppsflag2',
'Flags',
- 'Enable falling edge PPS signal processing (default: rising edge).',
+ 'Enable falling edge PPS signal processing (default: unchecked, rising edge).',
$pconfig['flag2']
));
$section->addInput(new Form_Checkbox(
'ppsflag3',
null,
- 'Enable kernel PPS clock discipline (default: disabled).',
+ 'Enable kernel PPS clock discipline (default: unchecked).',
$pconfig['flag3']
));
$section->addInput(new Form_Checkbox(
'ppsflag4',
null,
- 'Record a timestamp once for each second, useful for constructing Allan deviation plots (default: disabled).',
+ 'Record a timestamp once for each second, useful for constructing Allan deviation plots (default: unchecked).',
$pconfig['flag4']
));
diff --git a/src/usr/local/www/services_pppoe.php b/src/usr/local/www/services_pppoe.php
index 109520b..bdd4be7 100644
--- a/src/usr/local/www/services_pppoe.php
+++ b/src/usr/local/www/services_pppoe.php
@@ -122,11 +122,15 @@ if ($savemsg) {
}
if (is_subsystem_dirty('vpnpppoe')) {
- print_info_box_np(gettext('The PPPoE entry list has been changed') . '.<br />' . gettext('You must apply the changes in order for them to take effect.'));
+ print_apply_box(gettext('The PPPoE entry list has been changed.') . '<br />' . gettext('You must apply the changes in order for them to take effect.'));
}
?>
-<div class="table-responsive">
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('PPPoE Server')?></h2></div>
+ <div class="panel-body">
+
+ <div class="table-responsive">
<table class="table table-striped table-hover table-condensed">
<thead>
<tr>
@@ -134,7 +138,7 @@ if (is_subsystem_dirty('vpnpppoe')) {
<th><?=gettext("Local IP")?></th>
<th><?=gettext("Number of users")?></th>
<th><?=gettext("Description")?></th>
- <th><!-- Action buttons --></th>
+ <th><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody>
@@ -168,6 +172,9 @@ endforeach;
</table>
</div>
+ </div>
+</div>
+
<nav class="action-buttons">
<a href="services_pppoe_edit.php" class="btn btn-success">
<i class="fa fa-plus icon-embed-btn"></i>
diff --git a/src/usr/local/www/services_pppoe_edit.php b/src/usr/local/www/services_pppoe_edit.php
index 03284bb..63d87e6 100644
--- a/src/usr/local/www/services_pppoe_edit.php
+++ b/src/usr/local/www/services_pppoe_edit.php
@@ -101,6 +101,7 @@ if (isset($id) && $a_pppoes[$id]) {
$pconfig['mode'] = $pppoecfg['mode'];
$pconfig['interface'] = $pppoecfg['interface'];
$pconfig['n_pppoe_units'] = $pppoecfg['n_pppoe_units'];
+ $pconfig['n_pppoe_maxlogin'] = $pppoecfg['n_pppoe_maxlogin'];
$pconfig['pppoe_subnet'] = $pppoecfg['pppoe_subnet'];
$pconfig['pppoe_dns1'] = $pppoecfg['dns1'];
$pconfig['pppoe_dns2'] = $pppoecfg['dns2'];
@@ -151,18 +152,24 @@ if ($_POST) {
if (($_POST['localip'] && !is_ipaddr($_POST['localip']))) {
$input_errors[] = gettext("A valid server address must be specified.");
}
- if (($_POST['pppoe_subnet'] && !is_ipaddr($_POST['remoteip']))) {
+ if (($_POST['remoteip'] && !is_ipaddr($_POST['remoteip']))) {
$input_errors[] = gettext("A valid remote start address must be specified.");
}
if (($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver']))) {
$input_errors[] = gettext("A valid RADIUS server address must be specified.");
}
+ if (!is_numericint($_POST['n_pppoe_units']) || $_POST['n_pppoe_units'] > 255) {
+ $input_errors[] = gettext("Number of PPPoE users must be between 1 and 255");
+ }
+ if (!is_numericint($_POST['n_pppoe_maxlogin']) || $_POST['n_pppoe_maxlogin'] > 255) {
+ $input_errors[] = gettext("User Max Logins must be between 1 and 255");
+ }
+ if (!is_numericint($_POST['pppoe_subnet']) || $_POST['pppoe_subnet'] > 32) {
+ $input_errors[] = gettext("Subnet mask must be an interger between 0 and 32");
+ }
$_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['pppoe_subnet']);
- $subnet_start = ip2ulong($_POST['remoteip']);
- $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['pppoe_subnet'] - 1;
- if ((ip2ulong($_POST['localip']) >= $subnet_start) &&
- (ip2ulong($_POST['localip']) <= $subnet_end)) {
+ if (is_inrange_v4($_POST['localip'], $_POST['remoteip'], ip_after($_POST['remoteip'], $_POST['pppoe_subnet'] - 1))) {
$input_errors[] = gettext("The specified server address lies in the remote subnet.");
}
if ($_POST['localip'] == get_interface_ip($_POST['interface'])) {
@@ -193,6 +200,7 @@ if ($_POST) {
$pppoecfg['mode'] = $_POST['mode'];
$pppoecfg['interface'] = $_POST['interface'];
$pppoecfg['n_pppoe_units'] = $_POST['n_pppoe_units'];
+ $pppoecfg['n_pppoe_maxlogin'] = $_POST['n_pppoe_maxlogin'];
$pppoecfg['pppoe_subnet'] = $_POST['pppoe_subnet'];
$pppoecfg['descr'] = $_POST['descr'];
if ($_POST['radiusserver'] || $_POST['radiusserver2']) {
@@ -206,7 +214,9 @@ if ($_POST) {
$pppoecfg['radius']['server'] = array();
$pppoecfg['radius']['server']['ip'] = $_POST['radiusserver'];
- $pppoecfg['radius']['server']['secret'] = $_POST['radiussecret'];
+ if ($_POST['radiussecret'] != DMYPWD) {
+ $pppoecfg['radius']['server']['secret'] = $_POST['radiussecret'];
+ }
$pppoecfg['radius']['server']['port'] = $_POST['radiusserverport'];
$pppoecfg['radius']['server']['acctport'] = $_POST['radiusserveracctport'];
}
@@ -215,7 +225,9 @@ if ($_POST) {
$pppoecfg['radius']['server2'] = array();
$pppoecfg['radius']['server2']['ip'] = $_POST['radiusserver2'];
- $pppoecfg['radius']['server2']['secret2'] = $_POST['radiussecret2'];
+ if ($_POST['radiussecret2'] != DMYPWD) {
+ $pppoecfg['radius']['server2']['secret2'] = $_POST['radiussecret2'];
+ }
$pppoecfg['radius']['server2']['port'] = $_POST['radiusserver2port'];
$pppoecfg['radius']['server2']['acctport'] = $_POST['radiusserver2acctport'];
}
@@ -332,18 +344,18 @@ $section->addInput(new Form_Select(
));
$section->addInput(new Form_Select(
- 'pppoe_subnet',
- 'Subnet mask',
- $pconfig['pppoe_subnet'],
- array_combine(range(0, 32, 1), range(0, 32, 1))
-))->setHelp('Hint: 24 is 255.255.255.0');
-
-$section->addInput(new Form_Select(
'n_pppoe_units',
- 'No. of PPPoE Users',
+ 'Total User Count',
$pconfig['n_pppoe_units'],
- array_combine(range(0, 255, 1), range(0, 255, 1))
-));
+ array_combine(range(1, 255, 1), range(1, 255, 1))
+))->setHelp('The number of PPPoE users allowed to connect to this server simultaneously.');
+
+$section->addInput(new Form_Select(
+ 'n_pppoe_maxlogin',
+ 'User Max Logins',
+ $pconfig['n_pppoe_maxlogin'],
+ array_combine(range(1, 255, 1), range(1, 255, 1))
+))->setHelp('The number of times a single user may be logged in at the same time.');
$section->addInput(new Form_IpAddress(
'localip',
@@ -359,6 +371,13 @@ $section->addInput(new Form_IpAddress(
$pconfig['remoteip']
))->setHelp('Specify the starting address for the client IP address subnet');
+$section->addInput(new Form_Select(
+ 'pppoe_subnet',
+ 'Subnet mask',
+ $pconfig['pppoe_subnet'],
+ array_combine(range(0, 32, 1), range(0, 32, 1))
+))->setHelp('Hint: 24 is 255.255.255.0');
+
$section->addInput(new Form_Input(
'descr',
'Description',
@@ -382,22 +401,22 @@ $section->addInput(new Form_IpAddress(
$section->addInput(new Form_Checkbox(
'radiusenable',
'RADIUS',
- 'Use a RADIUS Server for authentication',
+ 'Use RADIUS Authentication',
$pconfig['radiusenable']
-))->setHelp('All users will be authenticated using the RADIUS server specified below. The local user database ' .
+))->setHelp('Users will be authenticated using the RADIUS server specified below. The local user database ' .
'will not be used');
$section->addInput(new Form_Checkbox(
'radacct_enable',
null,
- 'Enable RADIUS Accounting',
+ 'Use RADIUS Accounting',
$pconfig['radacct_enable']
))->setHelp('Sends accounting packets to the RADIUS server');
$section->addInput(new Form_Checkbox(
'radiussecenable',
null,
- 'Use backup RADIUS server',
+ 'Use a Backup RADIUS Authentication Server',
$pconfig['radiussecenable']
))->setHelp('If primary server fails all requests will be sent via backup server');
@@ -405,7 +424,7 @@ $section->addInput(new Form_IpAddress(
'radius_nasip',
'NAS IP Address',
$pconfig['radius_nasip']
-))->setHelp('RADIUS server NAS IP Address');
+))->setHelp('NAS IP Address sent to the RADIUS Server');
$section->addInput(new Form_Input(
'radius_acct_update',
@@ -416,12 +435,12 @@ $section->addInput(new Form_Input(
$section->addInput(new Form_Checkbox(
'radiusissueips',
- 'Radius Issued IPs',
- 'Issue IP Addresses via RADIUS server',
+ 'Radius Issued IP Addresses',
+ 'Assign IP Addresses to users via RADIUS server reply attributes',
$pconfig['radiusissueips']
));
-$group = new Form_Group('RADIUS server Primary');
+$group = new Form_Group('Primary RADIUS Server');
$group->add(new Form_IpAddress(
'radiusserver',
@@ -447,14 +466,14 @@ $group->setHelp('Standard ports are 1812 (authentication) and 1813 (accounting)'
$section->add($group);
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'radiussecret',
- 'RADIUS primary shared secret',
+ 'Primary RADIUS Server Shared Secret',
'password',
$pconfig['radiussecret']
))->setHelp('Enter the shared secret that will be used to authenticate to the RADIUS server.');
-$group = new Form_Group('RADIUS server Secondary');
+$group = new Form_Group('Secondary RADIUS Server');
$group->add(new Form_IpAddress(
'radiusserver2',
@@ -480,9 +499,9 @@ $group->setHelp('Standard ports are 1812 (authentication) and 1813 (accounting)'
$section->add($group);
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'radiussecret2',
- 'RADIUS secondary shared secret',
+ 'Secondary RADIUS Server Shared Secret',
'password',
$pconfig['radiussecret2']
))->setHelp('Enter the shared secret that will be used to authenticate to the backup RADIUS server.');
@@ -518,7 +537,7 @@ if ($usernames != "") {
null,
'text',
$user
- ))->setHelp($numrows == $counter ? 'User name':null);
+ ))->setHelp($numrows == $counter ? 'Username':null);
$group->add(new Form_Input(
'password' . $counter,
@@ -590,6 +609,7 @@ events.push(function() {
disableInput('radacct_enable', hide);
disableInput('radiusserver', hide);
disableInput('radiussecret', hide);
+ disableInput('radiussecret_confirm', hide);
disableInput('radiusserverport', hide);
disableInput('radiusserveracctport', hide);
disableInput('radiusissueips', hide);
@@ -604,6 +624,7 @@ events.push(function() {
function hide_radius2(hide) {
disableInput('radiusserver2', hide);
disableInput('radiussecret2', hide);
+ disableInput('radiussecret2_confirm', hide);
disableInput('radiusserver2port', hide);
disableInput('radiusserver2acctport', hide);
}
diff --git a/src/usr/local/www/services_rfc2136.php b/src/usr/local/www/services_rfc2136.php
index 3a01332..44bb1c5 100644
--- a/src/usr/local/www/services_rfc2136.php
+++ b/src/usr/local/www/services_rfc2136.php
@@ -98,59 +98,70 @@ $tab_array[] = array(gettext("RFC 2136"), true, "services_rfc2136.php");
display_top_tabs($tab_array);
if ($input_errors) {
- print_input_errors($input_errors);
+ print_input_errors($input_errors);
}
?>
<form action="services_rfc2136.php" method="post" name="iform" id="iform">
- <div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("If")?></th>
- <th><?=gettext("Server")?></th>
- <th><?=gettext("Hostname")?></th>
- <th><?=gettext("Cached IP")?></th>
- <th><?=gettext("Description")?></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+ <div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('RFC2136 Clients')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Interface")?></th>
+ <th><?=gettext("Server")?></th>
+ <th><?=gettext("Hostname")?></th>
+ <th><?=gettext("Cached IP")?></th>
+ <th><?=gettext("Description")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$iflist = get_configured_interface_with_descr();
+$groupslist = return_gateway_groups_array();
$i = 0;
foreach ($a_rfc2136 as $rfc2136):
?>
- <tr<?=(isset($rfc2136['enable']) ? '' : ' class="disabled"')?>>
- <td>
+ <tr<?=(isset($rfc2136['enable']) ? '' : ' class="disabled"')?>>
+ <td>
<?php
foreach ($iflist as $if => $ifdesc) {
- if ($rfc2136['interface'] == $if) {
- print($ifdesc);
+ if ($rfc2136['interface'] == $if) {
+ print($ifdesc);
break;
- }
+ }
+ }
+ foreach ($groupslist as $if => $group) {
+ if ($rfc2136['interface'] == $if) {
+ print($if);
+ break;
+ }
}
?>
- </td>
- <td>
- <?=htmlspecialchars($rfc2136['server'])?>
- </td>
- <td>
- <?=htmlspecialchars($rfc2136['host'])?>
- </td>
- <td>
+ </td>
+ <td>
+ <?=htmlspecialchars($rfc2136['server'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($rfc2136['host'])?>
+ </td>
+ <td>
<?php
$filename = "{$g['conf_path']}/dyndns_{$rfc2136['interface']}_rfc2136_" . escapeshellarg($rfc2136['host']) . "_{$rfc2136['server']}.cache";
+ $if = get_failover_interface($rfc2136['interface']);
if (file_exists($filename)) {
print('IPv4: ');
if (isset($rfc2136['usepublicip'])) {
- $ipaddr = dyndnsCheckIP($rfc2136['interface']);
+ $ipaddr = dyndnsCheckIP($if);
} else {
- $ipaddr = get_interface_ip($rfc2136['interface']);
+ $ipaddr = get_interface_ip($if);
}
$cached_ip_s = explode("|", file_get_contents($filename));
@@ -172,7 +183,7 @@ foreach ($a_rfc2136 as $rfc2136):
if (file_exists("{$filename}.ipv6")) {
print('IPv6: ');
- $ipaddr = get_interface_ipv6($rfc2136['interface']);
+ $ipaddr = get_interface_ipv6($if);
$cached_ip_s = explode("|", file_get_contents("{$filename}.ipv6"));
$cached_ip = $cached_ip_s[0];
@@ -189,30 +200,32 @@ foreach ($a_rfc2136 as $rfc2136):
}
?>
- </td>
- <td>
- <?=htmlspecialchars($rfc2136['descr'])?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit client')?>" href="services_rfc2136_edit.php?id=<?=$i?>"></a>
- <?php if (isset($rfc2136['enable'])) {
- ?>
- <a class="fa fa-ban" title="<?=gettext('Disable client')?>" href="?act=toggle&amp;id=<?=$i?>"></a>
- <?php } else {
- ?>
- <a class="fa fa-check-square-o" title="<?=gettext('Enable client')?>" href="?act=toggle&amp;id=<?=$i?>"></a>
- <?php }
- ?>
- <a class="fa fa-trash" title="<?=gettext('Delete client')?>" href="services_rfc2136.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ </td>
+ <td>
+ <?=htmlspecialchars($rfc2136['descr'])?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit client')?>" href="services_rfc2136_edit.php?id=<?=$i?>"></a>
+ <?php if (isset($rfc2136['enable'])) {
+ ?>
+ <a class="fa fa-ban" title="<?=gettext('Disable client')?>" href="?act=toggle&amp;id=<?=$i?>"></a>
+ <?php } else {
+ ?>
+ <a class="fa fa-check-square-o" title="<?=gettext('Enable client')?>" href="?act=toggle&amp;id=<?=$i?>"></a>
+ <?php }
+ ?>
+ <a class="fa fa-trash" title="<?=gettext('Delete client')?>" href="services_rfc2136.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php
- $i++;
+ $i++;
endforeach; ?>
- </tbody>
- </table>
- </div>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
</form>
<nav class="action-buttons">
diff --git a/src/usr/local/www/services_rfc2136_edit.php b/src/usr/local/www/services_rfc2136_edit.php
index 88da96f..891e8b1 100644
--- a/src/usr/local/www/services_rfc2136_edit.php
+++ b/src/usr/local/www/services_rfc2136_edit.php
@@ -157,6 +157,28 @@ if ($_POST) {
}
}
+function build_if_list() {
+ $list = array();
+
+ $iflist = get_configured_interface_with_descr();
+
+ foreach ($iflist as $if => $ifdesc) {
+ $list[$if] = $ifdesc;
+ }
+
+ unset($iflist);
+
+ $grouplist = return_gateway_groups_array();
+
+ foreach ($grouplist as $name => $group) {
+ $list[$name] = 'GW Group ' . $name;
+ }
+
+ unset($grouplist);
+
+ return($list);
+}
+
$pgtitle = array(gettext("Services"), gettext("Dynamic DNS"), gettext("RFC 2136 Client"), gettext("Edit"));
include("head.inc");
@@ -165,7 +187,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
$form = new Form;
@@ -180,17 +202,14 @@ $section->addInput(new Form_Checkbox(
));
$optionlist = array();
-$iflist = get_configured_interface_with_descr();
-foreach ($iflist as $ifnam => $ifdescr) {
- $optionlist[$ifnam] = $ifdescr;
-}
+$iflist = build_if_list();
$section->addInput(new Form_Select(
'interface',
'Interface',
$pconfig['interface'],
- $optionlist
+ $iflist
));
$section->addInput(new Form_Input(
@@ -306,19 +325,24 @@ $section->addInput(new Form_Input(
))->setHelp('You may enter a description here for your reference (not parsed).');
if (isset($id) && $a_rfc2136[$id]) {
- $section->addInput(new Form_Input(
- 'id',
- null,
- 'hidden',
- $id
+ $section->addInput(new Form_Input(
+ 'id',
+ null,
+ 'hidden',
+ $id
));
+
+ $form->addGlobal(new Form_Button(
+ 'force',
+ 'Save & Force Update'
+ ))->removeClass('btn-primary')->addClass('btn-info');
}
$form->add($section);
print($form);
-print_info_box(sprintf('You must configure a DNS server in %sSystem: ' .
- 'General setup %sor allow the DNS server list to be overridden ' .
- 'by DHCP/PPP on WAN for dynamic DNS updates to work.','<a href="system.php">', '</a>'));
+print_info_box(sprintf(gettext('You must configure a DNS server in %1$sSystem: ' .
+ 'General setup %2$sor allow the DNS server list to be overridden ' .
+ 'by DHCP/PPP on WAN for dynamic DNS updates to work.'), '<a href="system.php">', '</a>'));
include("foot.inc");
diff --git a/src/usr/local/www/services_router_advertisements.php b/src/usr/local/www/services_router_advertisements.php
index 1693b4a..dd13ed1 100644
--- a/src/usr/local/www/services_router_advertisements.php
+++ b/src/usr/local/www/services_router_advertisements.php
@@ -92,8 +92,8 @@ if ($config['installedpackages']['olsrd']) {
}
if (!$_GET['if']) {
- $savemsg = "<p><b>" . gettext("The DHCPv6 Server can only be enabled on interfaces configured with static, non unique local IP addresses") . ".</b></p>" .
- "<p><b>" . gettext("Only interfaces configured with a static IP will be shown") . ".</b></p>";
+ $savemsg = "<p><b>" . gettext("The DHCPv6 Server can only be enabled on interfaces configured with static, non unique local IP addresses.") . "</b></p>" .
+ "<p><b>" . gettext("Only interfaces configured with a static IP will be shown.") . "</b></p>";
}
$iflist = get_configured_interface_with_descr();
@@ -118,6 +118,10 @@ if (is_array($config['dhcpdv6'][$if])) {
if ($pconfig['rapriority'] == "") {
$pconfig['rapriority'] = "medium";
}
+
+ $pconfig['ravalidlifetime'] = $config['dhcpdv6'][$if]['ravalidlifetime'];
+ $pconfig['rapreferredlifetime'] = $config['dhcpdv6'][$if]['rapreferredlifetime'];
+
$pconfig['rainterface'] = $config['dhcpdv6'][$if]['rainterface'];
$pconfig['radomainsearchlist'] = $config['dhcpdv6'][$if]['radomainsearchlist'];
list($pconfig['radns1'], $pconfig['radns2'], $pconfig['radns3']) = $config['dhcpdv6'][$if]['radnsserver'];
@@ -129,22 +133,25 @@ if (!is_array($pconfig['subnets'])) {
$pconfig['subnets'] = array();
}
-$advertise_modes = array("disabled" => "Disabled",
- "router" => "Router Only",
- "unmanaged" => "Unmanaged",
- "managed" => "Managed",
- "assist" => "Assisted",
- "stateless_dhcp" => "Stateless DHCP");
-$priority_modes = array("low" => "Low",
- "medium" => "Normal",
- "high" => "High");
+$advertise_modes = array(
+ "disabled" => gettext("Disabled"),
+ "router" => gettext("Router Only"),
+ "unmanaged" => gettext("Unmanaged"),
+ "managed" => gettext("Managed"),
+ "assist" => gettext("Assisted"),
+ "stateless_dhcp" => gettext("Stateless DHCP"));
+$priority_modes = array(
+ "low" => gettext("Low"),
+ "medium" => gettext("Normal"),
+ "high" => gettext("High"));
$carplist = get_configured_carp_interface_list();
-$subnets_help = '<span class="help-block">' . gettext("Subnets are specified in CIDR format. " .
- "Select the CIDR mask that pertains to each entry. " .
- "/128 specifies a single IPv6 host; /64 specifies a normal IPv6 network; etc. " .
- "If no subnets are specified here, the Router Advertisement (RA) Daemon will advertise to the subnet to which the router's interface is assigned." .
- '</span>');
+$subnets_help = '<span class="help-block">' .
+ gettext("Subnets are specified in CIDR format. " .
+ "Select the CIDR mask that pertains to each entry. " .
+ "/128 specifies a single IPv6 host; /64 specifies a normal IPv6 network; etc. " .
+ "If no subnets are specified here, the Router Advertisement (RA) Daemon will advertise to the subnet to which the router's interface is assigned.") .
+ '</span>';
if ($_POST) {
unset($input_errors);
@@ -188,6 +195,10 @@ if ($_POST) {
}
}
+ if ($_POST['ravalidlifetime'] && (!is_numeric($_POST['ravalidlifetime']) || ($_POST['ravalidlifetime'] < 7200))) {
+ $input_errors[] = gettext("A valid lifetime below 2 hrs will be ignored by clients (RFC 4862 Section 5.5.3 point e)");
+ }
+
if (!$input_errors) {
if (!is_array($config['dhcpdv6'][$if])) {
$config['dhcpdv6'][$if] = array();
@@ -197,6 +208,9 @@ if ($_POST) {
$config['dhcpdv6'][$if]['rapriority'] = $_POST['rapriority'];
$config['dhcpdv6'][$if]['rainterface'] = $_POST['rainterface'];
+ $config['dhcpdv6'][$if]['ravalidlifetime'] = $_POST['ravalidlifetime'];
+ $config['dhcpdv6'][$if]['rapreferredlifetime'] = $_POST['rapreferredlifetime'];
+
$config['dhcpdv6'][$if]['radomainsearchlist'] = $_POST['radomainsearchlist'];
unset($config['dhcpdv6'][$if]['radnsserver']);
if ($_POST['radns1']) {
@@ -295,6 +309,22 @@ $section->addInput(new Form_Select(
$priority_modes
))->setHelp('Select the Priority for the Router Advertisement (RA) Daemon.');
+$section->addInput(new Form_Input(
+ 'ravalidlifetime',
+ 'Default valid lifetime',
+ 'text',
+ $pconfig['ravalidlifetime']
+))->setHelp('Seconds. The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for the purpose of on-link determination.' . ' <br />' .
+'The default is 86400 seconds.');
+
+$section->addInput(new Form_Input(
+ 'rapreferredlifetime',
+ 'Default preferred lifetime',
+ 'text',
+ $pconfig['rapreferredlifetime']
+))->setHelp('Seconds. The length of time in seconds (relative to the time the packet is sent) that addresses generated from the prefix via stateless address autoconfiguration remain preferred.' . ' <br />' .
+ 'The default is 14400 seconds.');
+
$carplistif = array();
if (count($carplist) > 0) {
foreach ($carplist as $ifname => $vip) {
@@ -372,7 +402,7 @@ for ($idx=1; $idx<=3; $idx++) {
'radns' . $idx,
'Server ' . $idx,
$pconfig['radns' . $idx]
- ))->setPattern('[0-9, a-z, A-Z and .')->setHelp(($idx < 3) ? '':'Leave blank to use the system default DNS servers - this interface\'s IP if DNS Forwarder or Resolver is enabled, otherwise the servers configured on the General page');
+ ))->setPattern('[a-zA-Z0-9\_\.\:]+')->setHelp(($idx < 3) ? '':'Leave blank to use the system default DNS servers - this interface\'s IP if DNS Forwarder or Resolver is enabled, otherwise the servers configured on the General page');
}
$section->addInput(new Form_Input(
diff --git a/src/usr/local/www/services_snmp.php b/src/usr/local/www/services_snmp.php
index 58e1b44..16ef69f 100644
--- a/src/usr/local/www/services_snmp.php
+++ b/src/usr/local/www/services_snmp.php
@@ -217,7 +217,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
$form = new Form();
diff --git a/src/usr/local/www/services_unbound.php b/src/usr/local/www/services_unbound.php
index 8e84170..48f017a 100644
--- a/src/usr/local/www/services_unbound.php
+++ b/src/usr/local/www/services_unbound.php
@@ -137,22 +137,18 @@ if ($_POST) {
if (isset($pconfig['enable']) && isset($config['dnsmasq']['enable'])) {
if ($pconfig['port'] == $config['dnsmasq']['port']) {
- $input_errors[] = "The DNS Forwarder is enabled using this port. Choose a non-conflicting port, or disable the DNS Forwarder.";
+ $input_errors[] = gettext("The DNS Forwarder is enabled using this port. Choose a non-conflicting port, or disable the DNS Forwarder.");
}
}
if (empty($pconfig['active_interface'])) {
- $input_errors[] = "One or more Network Interfaces must be selected for binding.";
+ $input_errors[] = gettext("One or more Network Interfaces must be selected for binding.");
} else if (!isset($config['system']['dnslocalhost']) && (!in_array("lo0", $pconfig['active_interface']) && !in_array("all", $pconfig['active_interface']))) {
- $input_errors[] = "This system is configured to use the DNS Resolver as its DNS server, so Localhost or All must be selected in Network Interfaces.";
+ $input_errors[] = gettext("This system is configured to use the DNS Resolver as its DNS server, so Localhost or All must be selected in Network Interfaces.");
}
if (empty($pconfig['outgoing_interface'])) {
- $input_errors[] = "One or more Outgoing Network Interfaces must be selected.";
- }
-
- if (empty($pconfig['system_domain_local_zone_type'])) {
- $input_errors[] = "A System Domain Local-Zone Type must be selected.";
+ $input_errors[] = gettext("One or more Outgoing Network Interfaces must be selected.");
}
if ($pconfig['port'] && !is_port($pconfig['port'])) {
@@ -172,11 +168,6 @@ if ($_POST) {
$pconfig['outgoing_interface'] = implode(",", $pconfig['outgoing_interface']);
}
- if (isset($pconfig['system_domain_local_zone_type']) && !empty($pconfig['system_domain_local_zone_type'])) {
- $display_system_domain_local_zone_type = $pconfig['system_domain_local_zone_type'];
- $pconfig['system_domain_local_zone_type'] = $pconfig['system_domain_local_zone_type'];
- }
-
$test_output = array();
if (test_unbound_config($pconfig, $test_output)) {
$input_errors[] = gettext("The generated config file cannot be parsed by unbound. Please correct the following errors:");
@@ -195,13 +186,12 @@ if ($_POST) {
$a_unboundcfg['system_domain_local_zone_type'] = $pconfig['system_domain_local_zone_type'];
$a_unboundcfg['custom_options'] = $pconfig['custom_options'];
- write_config("DNS Resolver configured.");
+ write_config(gettext("DNS Resolver configured."));
mark_subsystem_dirty('unbound');
}
$pconfig['active_interface'] = $display_active_interface;
$pconfig['outgoing_interface'] = $display_outgoing_interface;
- $pconfig['system_domain_local_zone_type'] = $display_system_domain_local_zone_type;
$pconfig['custom_options'] = $display_custom_options;
}
}
@@ -230,7 +220,7 @@ function build_if_list($selectedifs) {
$interface_addresses = get_possible_listen_ips(true);
$iflist = array('options' => array(), 'selected' => array());
- $iflist['options']['all'] = "All";
+ $iflist['options']['all'] = gettext("All");
if (empty($selectedifs) || empty($selectedifs[0]) || in_array("all", $selectedifs)) {
array_push($iflist['selected'], "all");
}
@@ -262,7 +252,7 @@ if ($savemsg) {
}
if (is_subsystem_dirty('unbound')) {
- print_info_box_np(gettext("The configuration of the DNS Resolver has been changed. You must apply changes for them to take effect."));
+ print_apply_box(gettext("The DNS Resolver configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -298,7 +288,7 @@ $section->addInput(new Form_Select(
$activeiflist['selected'],
$activeiflist['options'],
true
-))->setHelp('Interface IPs used by the DNS Resolver for responding to queries from clients. If an interface has both IPv4 and IPv6 IPs, both are used. Queries to other interface IPs not selected below are discarded. ' .
+))->addClass('general')->setHelp('Interface IPs used by the DNS Resolver for responding to queries from clients. If an interface has both IPv4 and IPv6 IPs, both are used. Queries to other interface IPs not selected below are discarded. ' .
'The default behavior is to respond to queries on every available IPv4 and IPv6 address.');
$outiflist = build_if_list($pconfig['outgoing_interface']);
@@ -309,15 +299,13 @@ $section->addInput(new Form_Select(
$outiflist['selected'],
$outiflist['options'],
true
-))->setHelp('Utilize different network interface(s) that the DNS Resolver will use to send queries to authoritative servers and receive their replies. By default all interfaces are used.');
-
-$unbound_local_zone_types = array("deny" => gettext("Deny"), "refuse" => gettext("Refuse"), "static" => gettext("Static"), "transparent" => gettext("Transparent"), "typetransparent" => gettext("Type Transparent"), "redirect" => gettext("Redirect"), "inform" => gettext("Inform"), "inform_deny" => gettext("Inform Deny"), "nodefault" => gettext("No Default"));
+))->addClass('general')->setHelp('Utilize different network interface(s) that the DNS Resolver will use to send queries to authoritative servers and receive their replies. By default all interfaces are used.');
$section->addInput(new Form_Select(
'system_domain_local_zone_type',
'System Domain Local Zone Type',
$pconfig['system_domain_local_zone_type'],
- $unbound_local_zone_types
+ unbound_local_zone_types()
))->setHelp('The local-zone type used for the pfSense system domain (System | General Setup | Domain). Transparent is the default. Local-Zone type descriptions are available in the unbound.conf(5) manual pages.');
$section->addInput(new Form_Checkbox(
@@ -378,20 +366,18 @@ print($form);
//<![CDATA[
events.push(function() {
- // If the enable checkbox is not checked, disable the next three checkboxes
- function disableDHCP() {
+ // If the enable checkbox is not checked, hide all inputs
+ function hideGeneral() {
var hide = ! $('#enable').prop('checked');
- disableInput('port', hide);
- disableInput('active_interface', hide);
- disableInput('outgoing_interface', hide);
- disableInput('system_domain_local_zone_type', hide);
- disableInput('regdhcpstatic', hide);
- disableInput('dnssec', hide);
- disableInput('forwarding', hide);
- disableInput('regdhcp', hide);
- disableInput('regdhcpstatic', hide);
- disableInput('btnadvdns', hide);
+ hideMultiClass('general', hide);
+ hideInput('port', hide);
+ hideSelect('system_domain_local_zone_type', hide);
+ hideCheckbox('dnssec', hide);
+ hideCheckbox('forwarding', hide);
+ hideCheckbox('regdhcp', hide);
+ hideCheckbox('regdhcpstatic', hide);
+ hideInput('btnadvdns', hide);
}
// Make the 'additional options' button a plain button, not a submit button
@@ -400,12 +386,11 @@ events.push(function() {
// Un-hide additional controls
$("#btnadvdns").click(function() {
hideInput('custom_options', false);
-
});
- // When 'enable' is clicked, disable/enable the following three checkboxes
+ // When 'enable' is clicked, disable/enable the following hide inputs
$('#enable').click(function() {
- disableDHCP();
+ hideGeneral();
});
// On initial load
@@ -413,7 +398,7 @@ events.push(function() {
hideInput('custom_options', true);
}
- disableDHCP();
+ hideGeneral();
});
//]]>
@@ -468,7 +453,7 @@ foreach ($a_hosts as $hostent):
<?=$alias['domain']?>
</td>
<td>
- Alias for <?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain']?>
+ <?=gettext("Alias for ");?><?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain']?>
</td>
<td>
<i class="fa fa-angle-double-right text-info"></i>
@@ -545,7 +530,7 @@ endforeach;
</a>
</nav>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(sprintf(gettext("If the DNS Resolver is enabled, the DHCP".
" service (if enabled) will automatically serve the LAN IP".
" address as a DNS server to DHCP clients so they will use".
@@ -553,7 +538,7 @@ endforeach;
" entered in %sSystem: General setup%s".
" or those obtained via DHCP or PPP on WAN if &quot;Allow".
" DNS server list to be overridden by DHCP/PPP on WAN&quot;".
- " is checked."), '<a href="system.php">', '</a>'), info)?>
+ " is checked."), '<a href="system.php">', '</a>'), 'info', false)?>
</div>
<?php include("foot.inc");
diff --git a/src/usr/local/www/services_unbound_acls.php b/src/usr/local/www/services_unbound_acls.php
index bc8a7ab..1c94824 100644
--- a/src/usr/local/www/services_unbound_acls.php
+++ b/src/usr/local/www/services_unbound_acls.php
@@ -200,11 +200,10 @@ if ($_POST) {
}
$actionHelp =
- '<span class="text-success"><strong>Deny:</strong></span> Stops queries from hosts within the netblock defined below.' . '<br />' .
- '<span class="text-success"><strong>Refuse:</strong></span> Stops queries from hosts within the netblock defined below, but sends a DNS rcode REFUSED error message back to the client.' . '<br />' .
- '<span class="text-success"><strong>Allow:</strong></span> Allow queries from hosts within the netblock defined below.' . '<br />' .
- '<span class="text-success"><strong>Allow Snoop:</strong></span> Allow recursive and nonrecursive access from hosts within the netblock defined below. Used for cache snooping and ideally should only be configured for your administrative host.';
-
+ sprintf(gettext('%sDeny:%s Stops queries from hosts within the netblock defined below.%s'), '<span class="text-success"><strong>', '</strong></span>', '<br />') .
+ sprintf(gettext('%sRefuse:%s Stops queries from hosts within the netblock defined below, but sends a DNS rcode REFUSED error message back to the client.%s'), '<span class="text-success"><strong>', '</strong></span>', '<br />') .
+ sprintf(gettext('%sAllow:%s Allow queries from hosts within the netblock defined below.%s'), '<span class="text-success"><strong>', '</strong></span>', '<br />') .
+ sprintf(gettext('%sAllow Snoop:%s Allow recursive and nonrecursive access from hosts within the netblock defined below. Used for cache snooping and ideally should only be configured for your administrative host.'), '<span class="text-success"><strong>', '</strong></span>');
$pgtitle = array(gettext("Services"), gettext("DNS Resolver"), gettext("Access Lists"));
$shortcut_section = "resolver";
@@ -219,7 +218,7 @@ if ($savemsg) {
}
if (is_subsystem_dirty('unbound')) {
- print_info_box_np(gettext("The configuration of the DNS Resolver, has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The DNS Resolver configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -259,7 +258,7 @@ if ($act == "new" || $act == "edit") {
'aclaction',
'Action',
strtolower($pconfig['aclaction']),
- array('allow' => 'Allow', 'deny' => 'Deny', 'refuse' => 'Refuse', 'allow snoop' => 'Allow Snoop')
+ array('allow' => gettext('Allow'), 'deny' => gettext('Deny'), 'refuse' => gettext('Refuse'), 'allow snoop' => gettext('Allow Snoop'))
))->setHelp($actionHelp);
$section->addInput(new Form_Input(
diff --git a/src/usr/local/www/services_unbound_advanced.php b/src/usr/local/www/services_unbound_advanced.php
index b4af8a0..60c117f 100644
--- a/src/usr/local/www/services_unbound_advanced.php
+++ b/src/usr/local/www/services_unbound_advanced.php
@@ -121,43 +121,43 @@ if ($_POST) {
$pconfig = $_POST;
if (isset($_POST['msgcachesize']) && !in_array($_POST['msgcachesize'], array('4', '10', '20', '50', '100', '250', '512'), true)) {
- $input_errors[] = "A valid value for Message Cache Size must be specified.";
+ $input_errors[] = gettext("A valid value for Message Cache Size must be specified.");
}
if (isset($_POST['outgoing_num_tcp']) && !in_array($_POST['outgoing_num_tcp'], array('0', '10', '20', '30', '40', '50'), true)) {
- $input_errors[] = "A valid value must be specified for Outgoing TCP Buffers.";
+ $input_errors[] = gettext("A valid value must be specified for Outgoing TCP Buffers.");
}
if (isset($_POST['incoming_num_tcp']) && !in_array($_POST['incoming_num_tcp'], array('0', '10', '20', '30', '40', '50'), true)) {
- $input_errors[] = "A valid value must be specified for Incoming TCP Buffers.";
+ $input_errors[] = gettext("A valid value must be specified for Incoming TCP Buffers.");
}
if (isset($_POST['edns_buffer_size']) && !in_array($_POST['edns_buffer_size'], array('512', '1480', '4096'), true)) {
- $input_errors[] = "A valid value must be specified for EDNS Buffer Size.";
+ $input_errors[] = gettext("A valid value must be specified for EDNS Buffer Size.");
}
if (isset($_POST['num_queries_per_thread']) && !in_array($_POST['num_queries_per_thread'], array('512', '1024', '2048'), true)) {
- $input_errors[] = "A valid value must be specified for Number of queries per thread.";
+ $input_errors[] = gettext("A valid value must be specified for Number of Queries per Thread.");
}
if (isset($_POST['jostle_timeout']) && !in_array($_POST['jostle_timeout'], array('100', '200', '500', '1000'), true)) {
- $input_errors[] = "A valid value must be specified for Jostle Timeout.";
+ $input_errors[] = gettext("A valid value must be specified for Jostle Timeout.");
}
if (isset($_POST['cache_max_ttl']) && (!is_numericint($_POST['cache_max_ttl']) || ($_POST['cache_max_ttl'] < 0))) {
- $input_errors[] = "'Maximum TTL for RRsets and messages' must be a positive integer.";
+ $input_errors[] = gettext("'Maximum TTL for RRsets and Messages' must be a positive integer.");
}
if (isset($_POST['cache_min_ttl']) && (!is_numericint($_POST['cache_min_ttl']) || ($_POST['cache_min_ttl'] < 0))) {
- $input_errors[] = "'Minimum TTL for RRsets and messages' must be a positive integer.";
+ $input_errors[] = gettext("'Minimum TTL for RRsets and Messages' must be a positive integer.");
}
if (isset($_POST['infra_host_ttl']) && !in_array($_POST['infra_host_ttl'], array('60', '120', '300', '600', '900'), true)) {
- $input_errors[] = "A valid value must be specified for TTL for Host cache entries.";
+ $input_errors[] = gettext("A valid value must be specified for TTL for Host Cache Entries.");
}
if (isset($_POST['infra_cache_numhosts']) && !in_array($_POST['infra_cache_numhosts'], array('1000', '5000', '10000', '20000', '50000'), true)) {
- $input_errors[] = "A valid value must be specified for Number of Hosts to cache.";
+ $input_errors[] = gettext("A valid value must be specified for Number of Hosts to Cache.");
}
if (isset($_POST['unwanted_reply_threshold']) && !in_array($_POST['unwanted_reply_threshold'], array('disabled', '5000000', '10000000', '20000000', '40000000', '50000000'), true)) {
- $input_errors[] = "A valid value must be specified for Unwanted Reply Threshold.";
+ $input_errors[] = gettext("A valid value must be specified for Unwanted Reply Threshold.");
}
if (isset($_POST['log_verbosity']) && !in_array($_POST['log_verbosity'], array('0', '1', '2', '3', '4', '5'), true)) {
- $input_errors[] = "A valid value must be specified for Log level verbosity.";
+ $input_errors[] = gettext("A valid value must be specified for Log Level.");
}
if (isset($_POST['dnssecstripped']) && !isset($config['unbound']['dnssec'])) {
- $input_errors[] = "Harden DNSSEC Data option can only be enabled if DNSSEC support is enabled.";
+ $input_errors[] = gettext("Harden DNSSEC Data option can only be enabled if DNSSEC support is enabled.");
}
if (!$input_errors) {
@@ -211,7 +211,7 @@ if ($_POST) {
unset($config['unbound']['use_caps']);
}
- write_config("DNS Resolver configured.");
+ write_config(gettext("DNS Resolver configured."));
mark_subsystem_dirty('unbound');
}
@@ -227,11 +227,11 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg, 'success');
+ print_info_box($savemsg, 'success');
}
if (is_subsystem_dirty('unbound')) {
- print_info_box_np(gettext("The configuration of the DNS Resolver has been changed. You must apply changes for them to take effect."));
+ print_apply_box(gettext("The DNS Resolver configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -246,21 +246,21 @@ $section = new Form_Section('Advanced Resolver Options');
$section->addInput(new Form_Checkbox(
'hideidentity',
- 'Hide identity',
+ 'Hide Identity',
'id.server and hostname.bind queries are refused',
$pconfig['hideidentity']
));
$section->addInput(new Form_Checkbox(
'hideversion',
- 'Hide version',
+ 'Hide Version',
'version.server and version.bind queries are refused',
$pconfig['hideversion']
));
$section->addInput(new Form_Checkbox(
'prefetch',
- 'Prefetch support',
+ 'Prefetch Support',
'Message cache elements are prefetched before they expire to help keep the cache up to date',
$pconfig['prefetch']
))->setHelp('When enabled, this option can cause an increase of around 10% more DNS traffic and load on the server, but frequently requested items will not expire from the cache');
@@ -274,35 +274,35 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_Checkbox(
'dnssecstripped',
- 'Harden DNSSEC data',
+ 'Harden DNSSEC Data',
'DNSSEC data is required for trust-anchored zones.',
$pconfig['dnssecstripped']
))->setHelp('If such data is absent, the zone becomes bogus. If Disabled and no DNSSEC data is received, then the zone is made insecure. ');
$section->addInput(new Form_Select(
'msgcachesize',
- 'Message Cache size',
+ 'Message Cache Size',
$pconfig['msgcachesize'],
array_combine(array("4", "10", "20", "50", "100", "250", "512"), array("4 MB", "10 MB", "20 MB", "50 MB", "100 MB", "250 MB", "512 MB"))
-))->setHelp('Size of the message cache. The message cache stores DNS rcodes and validation statuses. The RRSet cache will automatically be set to twice this amount. The RRSet cache contains the actual RR data. The default is 4 megabytes.');
+))->setHelp('Size of the message cache. The message cache stores DNS response codes and validation statuses. The Resource Record Set (RRSet) cache will automatically be set to twice this amount. The RRSet cache contains the actual RR data. The default is 4 megabytes.');
$section->addInput(new Form_Select(
'outgoing_num_tcp',
'Outgoing TCP Buffers',
$pconfig['outgoing_num_tcp'],
array_combine(array("0", "10", "20", "30", "50", "50"), array("0", "10", "20", "30", "50", "50"))
-))->setHelp('The number of outgoing TCP buffers to allocate per thread. The default value is 10. If 0 is selected then no TCP queries, to authoritative servers, are done.');
+))->setHelp('The number of outgoing TCP buffers to allocate per thread. The default value is 10. If 0 is selected then TCP queries are not sent to authoritative servers.');
$section->addInput(new Form_Select(
'incoming_num_tcp',
'Incoming TCP Buffers',
$pconfig['incoming_num_tcp'],
array_combine(array("0", "10", "20", "30", "50", "50"), array("0", "10", "20", "30", "50", "50"))
-))->setHelp('The number of incoming TCP buffers to allocate per thread. The default value is 10. If 0 is selected then no TCP queries, to authoritative servers, are done.');
+))->setHelp('The number of incoming TCP buffers to allocate per thread. The default value is 10. If 0 is selected then TCP queries are not accepted from clients.');
$section->addInput(new Form_Select(
'edns_buffer_size',
- 'EDNS Buffer size',
+ 'EDNS Buffer Size',
$pconfig['edns_buffer_size'],
array_combine(array("512", "1480", "4096"), array("512", "1480", "4096"))
))->setHelp('Number of bytes size to advertise as the EDNS reassembly buffer size. This is the value that is used in UDP datagrams sent to peers. ' .
@@ -311,7 +311,7 @@ $section->addInput(new Form_Select(
$section->addInput(new Form_Select(
'num_queries_per_thread',
- 'Number of queries per thread',
+ 'Number of Queries per Thread',
$pconfig['num_queries_per_thread'],
array_combine(array("512", "1024", "2048"), array("512", "1024", "2048"))
))->setHelp('The number of queries that every thread will service simultaneously. If more queries arrive that need to be serviced, and no queries can be jostled, then these queries are dropped');
@@ -325,55 +325,58 @@ $section->addInput(new Form_Select(
$section->addInput(new Form_Input(
'cache_max_ttl',
- 'Maximum TTL for RRsets and messages',
+ 'Maximum TTL for RRsets and Messages',
'text',
$pconfig['cache_max_ttl']
-))->setHelp('Configure a maximum Time to live for RRsets and messages in the cache. The default is 86400 seconds (1 day). ' .
+))->setHelp('The Maximum Time to Live for RRsets and messages in the cache. The default is 86400 seconds (1 day). ' .
'When the internal TTL expires the cache item is expired. This can be configured to force the resolver to query for data more often and not trust (very large) TTL values');
$section->addInput(new Form_Input(
'cache_min_ttl',
- 'Minimum TTL for RRsets and messages',
+ 'Minimum TTL for RRsets and Messages',
'text',
$pconfig['cache_min_ttl']
-))->setHelp('Configure a minimum Time to live for RRsets and messages in the cache. ' .
+))->setHelp('The Minimum Time to Live for RRsets and messages in the cache. ' .
'The default is 0 seconds. If the minimum value kicks in, the data is cached for longer than the domain owner intended, and thus less queries are made to look up the data. ' .
'The 0 value ensures the data in the cache is as the domain owner intended. High values can lead to trouble as the data in the cache might not match up with the actual data anymore.');
+$mnt = gettext("minutes");
$section->addInput(new Form_Select(
'infra_host_ttl',
- 'TTL for Host Cache entries',
+ 'TTL for Host Cache Entries',
$pconfig['infra_host_ttl'],
- array_combine(array("60", "120", "300", "600", "900"), array("1 minute", "2 minutes", "5 minutes", "10 minutes", "15 minutes"))
-))->setHelp('This timeout is used for when the server is very busy. This protects against denial of service by slow queries or high query rates. The default value is 200 milliseconds. ');
+ array_combine(array("60", "120", "300", "600", "900"), array("1 " . $mnt, "2 " . $mnt, "5 " . $mnt, "10 " . $mnt, "15 " . $mnt))
+))->setHelp('Time to Live, in seconds, for entries in the infrastructure host cache. The infrastructure host cache contains round trip timing, lameness, and EDNS support information for DNS servers. The default value is 15 minutes.');
$section->addInput(new Form_Select(
'infra_cache_numhosts',
'Number of Hosts to Cache',
$pconfig['infra_cache_numhosts'],
array_combine(array("1000", "5000", "10000", "20000", "50000"), array("1000", "5000", "10000", "20000", "50000"))
-))->setHelp('Number of hosts for which information is cached. The default is 10,000.');
+))->setHelp('Number of infrastructure hosts for which information is cached. The default is 10,000.');
+$mln = gettext("million");
$section->addInput(new Form_Select(
'unwanted_reply_threshold',
'Unwanted Reply Threshold',
$pconfig['unwanted_reply_threshold'],
array_combine(array("disabled", "5000000", "10000000", "20000000", "40000000", "50000000"),
- array("Disabled", "5 million", "10 million", "20 million", "40 million", "50 million"))
+ array("Disabled", "5 " . $mln, "10 " . $mln, "20 " . $mln, "40 " . $mln, "50 " . $mln))
))->setHelp('If enabled, a total number of unwanted replies is kept track of in every thread. When it reaches the threshold, a defensive action is taken ' .
'and a warning is printed to the log file. This defensive action is to clear the RRSet and message caches, hopefully flushing away any poison. ' .
'The default is disabled, but if enabled a value of 10 million is suggested.');
+$lvl = gettext("level");
$section->addInput(new Form_Select(
'log_verbosity',
- 'Log level',
+ 'Log Level',
$pconfig['log_verbosity'],
- array_combine(array("0", "1", "2", "3", "4", "5"), array("Level 0", "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"))
+ array_combine(array("0", "1", "2", "3", "4", "5"), array($lvl + " 0", $lvl + " 1", $lvl + " 2", $lvl + " 3", $lvl + " 4", $lvl + " 5"))
))->setHelp('Select the log verbosity.');
$section->addInput(new Form_Checkbox(
'disable_auto_added_access_control',
- 'Disable auto-added access control',
+ 'Disable Auto-added Access Control',
'disable the automatically-added access control entries',
$pconfig['disable_auto_added_access_control']
))->setHelp('By default, IPv4 and IPv6 networks residing on internal interfaces of this system are permitted. ' .
diff --git a/src/usr/local/www/services_wol.php b/src/usr/local/www/services_wol.php
index 8d91c19..b23b81b 100644
--- a/src/usr/local/www/services_wol.php
+++ b/src/usr/local/www/services_wol.php
@@ -83,9 +83,11 @@ if ($_GET['wakeall'] != "") {
$bcip = gen_subnet_max($ipaddr, get_interface_subnet($if));
/* Execute wol command and check return code. */
if (!mwexec("/usr/local/bin/wol -i {$bcip} {$mac}")) {
- $savemsg .= sprintf(gettext('Sent magic packet to %1$s (%2$s)%3$s'), $mac, $description, ".<br />");
+ $savemsg .= sprintf(gettext('Sent magic packet to %1$s (%2$s).'), $mac, $description) . "<br />";
+ $class = 'success';
} else {
- $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s (%4$s) did not complete successfully%5$s'), '<a href="/status_logs.php">', '</a>', $description, $mac, ".<br />");
+ $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s (%4$s) did not complete successfully.'), '<a href="/status_logs.php">', '</a>', $description, $mac) . "<br />";
+ $class = 'warning';
}
}
}
@@ -123,8 +125,10 @@ if ($_POST || $_GET['mac']) {
/* Execute wol command and check return code. */
if (!mwexec("/usr/local/bin/wol -i {$bcip} " . escapeshellarg($mac))) {
$savemsg .= sprintf(gettext("Sent magic packet to %s."), $mac);
+ $class = 'success';
} else {
- $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s did not complete successfully%4$s'), '<a href="/status_logs.php">', '</a>', $mac, ".<br />");
+ $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s did not complete successfully.'), '<a href="/status_logs.php">', '</a>', $mac) . "<br />";
+ $class = 'warning';
}
}
}
@@ -141,12 +145,15 @@ if ($_GET['act'] == "del") {
$pgtitle = array(gettext("Services"), gettext("Wake on LAN"));
include("head.inc");
-
-print_info_box(gettext('This service can be used to wake up (power on) computers by sending special') . ' "' . gettext('Magic Packets') . '"<br />' .
- gettext('The NIC in the computer that is to be woken up must support Wake on LAN and must be properly configured (WOL cable, BIOS settings).'));
-
?>
+<div class="infoblock blockopen">
+<?php
+print_info_box(gettext('This service can be used to wake up (power on) computers by sending special "Magic Packets".') . '<br />' .
+ gettext('The NIC in the computer that is to be woken up must support Wake on LAN and must be properly configured (WOL cable, BIOS settings).'),
+ 'info', false);
+?>
+</div>
<?php
if ($input_errors) {
@@ -154,7 +161,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, $class);
}
$form = new Form('Send');
@@ -181,7 +188,7 @@ print $form;
<div class="panel panel-default">
<div class="panel-heading">
- <h2 class="panel-title">Wake on LAN devices</h2>
+ <h2 class="panel-title"><?=gettext("Wake on LAN devices");?></h2>
</div>
<div class="panel-body">
@@ -193,7 +200,7 @@ print $form;
<th><?=gettext("Interface")?></th>
<th><?=gettext("MAC address")?></th>
<th><?=gettext("Description")?></th>
- <th></th>
+ <th><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody>
@@ -220,7 +227,7 @@ print $form;
</div>
<div class="panel-footer">
<a class="btn btn-success" href="services_wol_edit.php">
- Add
+ <?=gettext("Add");?>
</a>
<a href="services_wol.php?wakeall=true" role="button" class="btn btn-primary">
diff --git a/src/usr/local/www/shortcuts/pkg_upnp.php b/src/usr/local/www/shortcuts/pkg_upnp.inc
index 3ee7f81..6554e10 100644
--- a/src/usr/local/www/shortcuts/pkg_upnp.php
+++ b/src/usr/local/www/shortcuts/pkg_upnp.inc
@@ -4,7 +4,7 @@ global $shortcuts;
$shortcuts['upnp'] = array();
$shortcuts['upnp']['main'] = "pkg_edit.php?xml=miniupnpd.xml";
-$shortcuts['upnp']['log'] = "diag_logs_routing.php";
+$shortcuts['upnp']['log'] = "status_logs.php?logfile=routing";
$shortcuts['upnp']['status'] = "status_upnp.php";
$shortcuts['upnp']['service'] = "miniupnpd";
diff --git a/src/usr/local/www/sortable/LICENSE b/src/usr/local/www/sortable/LICENSE
index e19dfc9..e19dfc9 100755..100644
--- a/src/usr/local/www/sortable/LICENSE
+++ b/src/usr/local/www/sortable/LICENSE
diff --git a/src/usr/local/www/sortable/sortable-theme-bootstrap.css b/src/usr/local/www/sortable/sortable-theme-bootstrap.css
index 99cf6c9..99cf6c9 100755..100644
--- a/src/usr/local/www/sortable/sortable-theme-bootstrap.css
+++ b/src/usr/local/www/sortable/sortable-theme-bootstrap.css
diff --git a/src/usr/local/www/sortable/sortable.js b/src/usr/local/www/sortable/sortable.js
index 031d6f7..031d6f7 100755..100644
--- a/src/usr/local/www/sortable/sortable.js
+++ b/src/usr/local/www/sortable/sortable.js
diff --git a/src/usr/local/www/status.php b/src/usr/local/www/status.php
index 06fa756..b4a8afc 100755
--- a/src/usr/local/www/status.php
+++ b/src/usr/local/www/status.php
@@ -95,7 +95,7 @@ function doCmdT($title, $command) {
echo "\n<a name=\"" . str_replace($rubbish, '', $title) . "\" id=\"" . str_replace($rubbish, '', $title) . "\"></a>\n";
print('<div class="panel panel-default">');
- print('<div class="panel-heading">' . $title . '</div>');
+ print('<div class="panel-heading"><h2 class="panel-title">' . $title . '</h2></div>');
print('<div class="panel-body">');
print('<pre>');
@@ -163,7 +163,7 @@ function listCmds() {
$rubbish = array('|', '-', '/', '.', ' '); /* fixes the <a> tag to be W3C compliant */
print('<div class="panel panel-default">');
- print('<div class="panel-heading">' . gettext("System status on ") . $currentDate . '</div>');
+ print('<div class="panel-heading"><h2 class="panel-title">' . gettext("System Status on ") . $currentDate . '</h2></div>');
print('<div class="panel-body">');
print(' <div class="content">');
print("\n<p>" . gettext("This status page includes the following information") . ":\n");
@@ -191,7 +191,7 @@ global $g, $config;
/* Set up all of the commands we want to execute. */
/* System stats/info */
-defCmdT("System uptime", "/usr/bin/uptime");
+defCmdT("System Uptime", "/usr/bin/uptime");
defCmdT("Interfaces", "/sbin/ifconfig -a");
defCmdT("Interface Statistics", "/usr/bin/netstat -nWi");
defCmdT("Top Process Info", "/usr/bin/top | /usr/bin/head -n5");
@@ -215,7 +215,7 @@ defCmdT("pf Info", "/sbin/pfctl -si");
defCmdT("pf Show All", "/sbin/pfctl -sa");
defCmdT("pf Queues", "/sbin/pfctl -s queue -v");
defCmdT("pf OSFP", "/sbin/pfctl -s osfp");
-defCmdT("pfsync stats", "/usr/bin/netstat -s -ppfsync");
+defCmdT("pfsync Stats", "/usr/bin/netstat -s -ppfsync");
defCmdT("pftop Default", "/usr/local/sbin/pftop -a -b");
defCmdT("pftop Long", "/usr/local/sbin/pftop -w 150 -a -b -v long");
defCmdT("pftop Queue", "/usr/local/sbin/pftop -w 150 -a -b -v queue");
@@ -225,7 +225,7 @@ defCmdT("pftop Speed", "/usr/local/sbin/pftop -w 150 -a -b -v speed");
if (isset($config['captiveportal']) && is_array($config['captiveportal'])) {
foreach ($config['captiveportal'] as $cpZone => $cpdata) {
if (isset($cpdata['enable'])) {
- defCmdT("IPFW rules for {$cpdata['zone']}", "/sbin/ipfw -x " . escapeshellarg($cpdata['zoneid']) . " show");
+ defCmdT("IPFW Rules for {$cpdata['zone']}", "/sbin/ipfw -x " . escapeshellarg($cpdata['zoneid']) . " show");
}
}
}
@@ -237,8 +237,8 @@ defCmdT("config.xml", "dumpconfigxml");
defCmdT("resolv.conf", "/bin/cat /etc/resolv.conf");
defCmdT("DHCP Configuration", "/bin/cat /var/dhcpd/etc/dhcpd.conf");
defCmdT("DHCPv6 Configuration", "/bin/cat /var/dhcpd/etc/dhcpdv6.conf");
-defCmdT("strongSwan config", "/bin/cat /var/etc/ipsec/strongswan.conf");
-defCmdT("IPsec config", "/bin/cat /var/etc/ipsec/ipsec.conf");
+defCmdT("strongSwan Configuration", "/bin/cat /var/etc/ipsec/strongswan.conf");
+defCmdT("IPsec Configuration", "/bin/cat /var/etc/ipsec/ipsec.conf");
defCmdT("IPsec Status", "/usr/local/sbin/ipsec statusall");
defCmdT("SPD", "/sbin/setkey -DP");
defCmdT("SAD", "/sbin/setkey -D");
@@ -252,7 +252,7 @@ if (file_exists("/boot/loader.conf.local")) {
defCmdT("Loader Configuration (Local)", "/bin/cat /boot/loader.conf.local");
}
if (file_exists("/var/etc/filterdns.conf")) {
- defCmdT("Filter DNS Daemon Config", "/bin/cat /var/etc/filterdns.conf");
+ defCmdT("Filter DNS Daemon Configuration", "/bin/cat /var/etc/filterdns.conf");
}
defCmdT("last 1000 system log entries", "/usr/local/sbin/clog /var/log/system.log 2>&1 | tail -n 1000");
defCmdT("last 1000 DHCP log entries", "/usr/local/sbin/clog /var/log/dhcpd.log 2>&1 | tail -n 1000");
@@ -280,7 +280,7 @@ defCmdT("Installed OS Packages", "/usr/sbin/pkg info");
exec("/bin/date", $dateOutput, $dateStatus);
$currentDate = $dateOutput[0];
-$pgtitle = array("{$g['product_name']}", "status");
+$pgtitle = array("{$g['product_name']}", "Status");
include("head.inc");
print_info_box(gettext("Make sure all sensitive information is removed! (Passwords, etc.) before posting " .
diff --git a/src/usr/local/www/status_captiveportal.php b/src/usr/local/www/status_captiveportal.php
index c497ab8..1e4c091 100644
--- a/src/usr/local/www/status_captiveportal.php
+++ b/src/usr/local/www/status_captiveportal.php
@@ -259,7 +259,7 @@ else:
<div class="panel-heading"><h2 class="panel-title"><?=gettext("Captive Portal Status")?></h2></div>
<div class="panel-body"><br />
<?php
- print_info_box(gettext("No captive portal zones have been configured. You may add new zones here: ") . '<a href="services_captiveportal_zones.php">' . 'Services->Captive portal' . '</a>');
+ print_info_box(sprintf(gettext('No captive portal zones have been configured. You may add new zones here: %1$sServices->Captive portal%2$s'), '<a href="services_captiveportal_zones.php">', '</a>'));
?>
</div>
</div>
diff --git a/src/usr/local/www/status_carp.php b/src/usr/local/www/status_carp.php
index 07dde06..39d2a64 100644
--- a/src/usr/local/www/status_carp.php
+++ b/src/usr/local/www/status_carp.php
@@ -182,16 +182,16 @@ if ($carpcount == 0) {
// Sadly this needs to be here so that it is inside the form
if ($carp_detected_problems > 0) {
print_info_box(
- gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br/>" .
- gettext("Check the link status on all interfaces with configured CARP VIPs.") . "<br/>" .
- gettext("Search the") .
- " <a href=\"/status_logs.php?filtertext=carp%3A+demoted+by\">" .
- gettext("system log") .
- "</a> " .
- gettext("for CARP demotion-related events.") . "<br/><br/>" .
+ gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") .
+ "<br/>" .
+ gettext("Check the link status on all interfaces with configured CARP VIPs.") .
+ "<br/>" .
+ sprintf(gettext('Search the %1$sSystem Log%2$s for CARP demotion-related events.'), "<a href=\"/status_logs.php?filtertext=carp%3A+demoted+by\">", "</a>") .
+ "<br/><br/>" .
'<input type="submit" class="btn btn-warning" name="resetdemotion" id="resetdemotion" value="' .
gettext("Reset CARP Demotion Status") .
- '" />', 'danger'
+ '" />',
+ 'danger'
);
}
diff --git a/src/usr/local/www/status_dhcp_leases.php b/src/usr/local/www/status_dhcp_leases.php
index 60fa055..41bce34 100644
--- a/src/usr/local/www/status_dhcp_leases.php
+++ b/src/usr/local/www/status_dhcp_leases.php
@@ -170,6 +170,15 @@ $i = 0;
$l = 0;
$p = 0;
+// Translate these once so we don't do it over and over in the loops below.
+$online_string = gettext("online");
+$offline_string = gettext("offline");
+$active_string = gettext("active");
+$expired_string = gettext("expired");
+$reserved_string = gettext("reserved");
+$dynamic_string = gettext("dynamic");
+$static_string = gettext("static");
+
// Put everything together again
foreach ($leases_content as $lease) {
/* split the line by space */
@@ -198,7 +207,7 @@ foreach ($leases_content as $lease) {
continue 3;
case "lease":
$leases[$l]['ip'] = $data[$f+1];
- $leases[$l]['type'] = "dynamic";
+ $leases[$l]['type'] = $dynamic_string;
$f = $f+2;
break;
case "starts":
@@ -233,15 +242,15 @@ foreach ($leases_content as $lease) {
case "binding":
switch ($data[$f+2]) {
case "active":
- $leases[$l]['act'] = "active";
+ $leases[$l]['act'] = $active_string;
break;
case "free":
- $leases[$l]['act'] = "expired";
- $leases[$l]['online'] = "offline";
+ $leases[$l]['act'] = $expired_string;
+ $leases[$l]['online'] = $offline_string;
break;
case "backup":
- $leases[$l]['act'] = "reserved";
- $leases[$l]['online'] = "offline";
+ $leases[$l]['act'] = $reserved_string;
+ $leases[$l]['online'] = $offline_string;
break;
}
$f = $f+1;
@@ -258,9 +267,9 @@ foreach ($leases_content as $lease) {
$leases[$l]['mac'] = $data[$f+2];
/* check if it's online and the lease is active */
if (in_array($leases[$l]['ip'], $arpdata_ip)) {
- $leases[$l]['online'] = 'online';
+ $leases[$l]['online'] = $online_string;
} else {
- $leases[$l]['online'] = 'offline';
+ $leases[$l]['online'] = $offline_string;
}
$f = $f+2;
break;
@@ -306,14 +315,15 @@ foreach ($config['interfaces'] as $ifname => $ifarr) {
foreach ($config['dhcpd'][$ifname]['staticmap'] as $static) {
$slease = array();
$slease['ip'] = $static['ipaddr'];
- $slease['type'] = "static";
+ $slease['type'] = $static_string;
$slease['mac'] = $static['mac'];
$slease['if'] = $ifname;
$slease['start'] = "";
$slease['end'] = "";
$slease['hostname'] = htmlentities($static['hostname']);
- $slease['act'] = "static";
- $slease['online'] = in_array(strtolower($slease['mac']), $arpdata_mac) ? 'online' : 'offline';
+ $slease['descr'] = htmlentities($static['descr']);
+ $slease['act'] = $static_string;
+ $slease['online'] = in_array(strtolower($slease['mac']), $arpdata_mac) ? $online_string : $offline_string;
$slease['staticmap_array_index'] = $staticmap_array_index;
$leases[] = $slease;
$staticmap_array_index++;
@@ -342,7 +352,7 @@ if (count($pools) > 0) {
</tr>
</thead>
<tbody>
-<? foreach ($pools as $data):?>
+<?php foreach ($pools as $data):?>
<tr>
<td><?=$data['name']?></td>
<td><?=$data['mystate']?></td>
@@ -350,7 +360,7 @@ if (count($pools) > 0) {
<td><?=$data['peerstate']?></td>
<td><?=adjust_gmt($data['peerdate'])?></td>
</tr>
-<? endforeach?>
+<?php endforeach; ?>
</tbody>
</table>
</div>
@@ -369,10 +379,12 @@ if (count($pools) > 0) {
<th><?=gettext("IP address")?></th>
<th><?=gettext("MAC address")?></th>
<th><?=gettext("Hostname")?></th>
+ <th><?=gettext("Description")?></th>
<th><?=gettext("Start")?></th>
<th><?=gettext("End")?></th>
<th><?=gettext("Online")?></th>
<th><?=gettext("Lease Type")?></th>
+ <th data-sortable="false"><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody>
@@ -381,27 +393,25 @@ $dhcp_leases_subnet_counter = array(); //array to sum up # of leases / subnet
$iflist = get_configured_interface_with_descr(); //get interface descr for # of leases
foreach ($leases as $data):
- if ($data['act'] != "active" && $data['act'] != "static" && $_GET['all'] != 1) {
+ if ($data['act'] != $active_string && $data['act'] != $static_string && $_GET['all'] != 1) {
continue;
}
- if ($data['act'] == 'active') {
+ if ($data['act'] == $active_string) {
$icon = 'fa-check-circle-o';
- } elseif ($data['act'] == 'expired') {
+ } elseif ($data['act'] == $expired_string) {
$icon = 'fa-ban';
} else {
$icon = 'fa-times-circle-o';
}
- $lip = ip2ulong($data['ip']);
-
- if ($data['act'] != "static") {
+ if ($data['act'] != $static_string) {
$dlsc=0;
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
if (!is_array($dhcpifconf['range'])) {
continue;
}
- if (($lip >= ip2ulong($dhcpifconf['range']['from'])) && ($lip <= ip2ulong($dhcpifconf['range']['to']))) {
+ if (is_inrange_v4($data['ip'], $dhcpifconf['range']['from'], $dhcpifconf['range']['to'])) {
$data['if'] = $dhcpif;
$dhcp_leases_subnet_counter[$dlsc]['dhcpif'] = $dhcpif;
$dhcp_leases_subnet_counter[$dlsc]['from'] = $dhcpifconf['range']['from'];
@@ -423,36 +433,32 @@ foreach ($leases as $data):
<td>
<?=$mac?>
- <? if (isset($mac_man[$mac_hi])):?>
+ <?php if (isset($mac_man[$mac_hi])):?>
(<?=$mac_man[$mac_hi]?>)
- <?endif?>
+ <?php endif; ?>
</td>
<td><?=htmlentities($data['hostname'])?></td>
-<? if ($data['type'] != "static"):?>
+ <td><?=htmlentities($data['descr'])?></td>
<td><?=adjust_gmt($data['start'])?></td>
<td><?=adjust_gmt($data['end'])?></td>
-<? else: ?>
- <td>n/a</td>
- <td>n/a</td>
-<? endif; ?>
<td><?=$data['online']?></td>
<td><?=$data['act']?></td>
<td>
-<? if ($data['type'] == "dynamic"): ?>
+<?php if ($data['type'] == $dynamic_string): ?>
<a class="fa fa-plus-square-o" title="<?=gettext("Add static mapping")?>" href="services_dhcp_edit.php?if=<?=$data['if']?>&amp;mac=<?=$data['mac']?>&amp;hostname=<?=htmlspecialchars($data['hostname'])?>"></a>
-<? else: ?>
+<?php else: ?>
<a class="fa fa-pencil" title="<?=gettext('Edit static mapping')?>" href="services_dhcp_edit.php?if=<?=$data['if']?>&amp;id=<?=$data['staticmap_array_index']?>"></a>
-<? endif; ?>
+<?php endif; ?>
<a class="fa fa-plus-square" title="<?=gettext("Add WOL mapping")?>" href="services_wol_edit.php?if=<?=$data['if']?>&amp;mac=<?=$data['mac']?>&amp;descr=<?=htmlentities($data['hostname'])?>"></a>
-<? if ($data['online'] != "online"):?>
+<?php if ($data['online'] != $online_string):?>
<a class="fa fa-power-off" title="<?=gettext("Send WOL packet")?>" href="services_wol.php?if=<?=$data['if']?>&amp;mac=<?=$data['mac']?>"></a>
-<? endif; ?>
+<?php endif; ?>
-<? if ($data['type'] == "dynamic" && $data['online'] != "online"):?>
+<?php if ($data['type'] == $dynamic_string && $data['online'] != $online_string):?>
<a class="fa fa-trash" title="<?=gettext('Delete lease')?>" href="status_dhcp_leases.php?deleteip=<?=$data['ip']?>&amp;all=<?=intval($_GET['all'])?>"></a>
-<? endif?>
+<?php endif; ?>
</td>
-<? endforeach; ?>
+<?php endforeach; ?>
</tr>
</tbody>
</table>
@@ -472,14 +478,14 @@ foreach ($leases as $data):
</tr>
</thead>
<tbody>
-<? foreach ($dhcp_leases_subnet_counter as $listcounters):?>
+<?php foreach ($dhcp_leases_subnet_counter as $listcounters):?>
<tr>
<td><?=$iflist[$listcounters['dhcpif']]?></td>
<td><?=$listcounters['from']?></td>
<td><?=$listcounters['to']?></td>
<td><?=$listcounters['count']?></td>
</tr>
-<? endforeach; ?>
+<?php endforeach; ?>
</tbody>
</table>
</div>
diff --git a/src/usr/local/www/status_dhcpv6_leases.php b/src/usr/local/www/status_dhcpv6_leases.php
index e557906..541ba8f 100644
--- a/src/usr/local/www/status_dhcpv6_leases.php
+++ b/src/usr/local/www/status_dhcpv6_leases.php
@@ -119,11 +119,11 @@ function leasecmp($a, $b) {
function adjust_gmt($dt) {
global $config;
- $dhcpv6leaseinlocaltime == "no";
+ $dhcpv6leaseinlocaltime = "no";
if (is_array($config['dhcpdv6'])) {
$dhcpdv6 = $config['dhcpdv6'];
- foreach ($dhcpdv6 as $dhcpv6leaseinlocaltime) {
- $dhcpv6leaseinlocaltime = $dhcpv6leaseinlocaltime['dhcpv6leaseinlocaltime'];
+ foreach ($dhcpdv6 as $dhcpdv6params) {
+ $dhcpv6leaseinlocaltime = $dhcpdv6params['dhcpv6leaseinlocaltime'];
if ($dhcpv6leaseinlocaltime == "yes") {
break;
}
@@ -206,6 +206,16 @@ $i = 0;
$l = 0;
$p = 0;
+// Translate these once so we don't do it over and over in the loops below.
+$online_string = gettext("online");
+$offline_string = gettext("offline");
+$active_string = gettext("active");
+$expired_string = gettext("expired");
+$reserved_string = gettext("reserved");
+$released_string = gettext("released");
+$dynamic_string = gettext("dynamic");
+$static_string = gettext("static");
+
// Put everything together again
while ($i < $leases_count) {
$entry = array();
@@ -257,23 +267,23 @@ while ($i < $leases_count) {
} else {
$entry['duid'] = $data[$f+1];
}
- $entry['type'] = "dynamic";
+ $entry['type'] = $dynamic_string;
$f = $f+2;
break;
case "iaaddr":
$entry['ip'] = $data[$f+1];
- $entry['type'] = "dynamic";
+ $entry['type'] = $dynamic_string;
if (in_array($entry['ip'], array_keys($ndpdata))) {
- $entry['online'] = 'online';
+ $entry['online'] = $online_string;
} else {
- $entry['online'] = 'offline';
+ $entry['online'] = $offline_string;
}
$f = $f+2;
break;
case "iaprefix":
$is_prefix = true;
$entry['prefix'] = $data[$f+1];
- $entry['type'] = "dynamic";
+ $entry['type'] = $dynamic_string;
$f = $f+2;
break;
case "starts":
@@ -303,19 +313,19 @@ while ($i < $leases_count) {
case "binding":
switch ($data[$f+2]) {
case "active":
- $entry['act'] = "active";
+ $entry['act'] = $active_string;
break;
case "free":
- $entry['act'] = "expired";
- $entry['online'] = "offline";
+ $entry['act'] = $expired_string;
+ $entry['online'] = $offline_string;
break;
case "backup":
- $entry['act'] = "reserved";
- $entry['online'] = "offline";
+ $entry['act'] = $reserved_string;
+ $entry['online'] = $offline_string;
break;
case "released":
- $entry['act'] = "released";
- $entry['online'] = "offline";
+ $entry['act'] = $released_string;
+ $entry['online'] = $offline_string;
}
$f = $f+1;
break;
@@ -378,11 +388,11 @@ foreach ($config['interfaces'] as $ifname => $ifarr) {
$slease['start'] = "";
$slease['end'] = "";
$slease['hostname'] = htmlentities($static['hostname']);
- $slease['act'] = "static";
+ $slease['act'] = $static_string;
if (in_array($slease['ip'], array_keys($ndpdata))) {
- $slease['online'] = 'online';
+ $slease['online'] = $online_string;
} else {
- $slease['online'] = 'offline';
+ $slease['online'] = $offline_string;
}
$leases[] = $slease;
@@ -411,7 +421,7 @@ if (count($pools) > 0) {
</tr>
</thead>
<tbody>
-<? foreach ($pools as $data):?>
+<?php foreach ($pools as $data):?>
<tr>
<td><?=$data['name']?></td>
<td><?=$data['mystate']?></td>
@@ -419,7 +429,7 @@ if (count($pools) > 0) {
<td><?=$data['peerstate']?></td>
<td><?=adjust_gmt($data['peerdate'])?></td>
</tr>
-<? endforeach?>
+<?php endforeach; ?>
</tbody>
</table>
</div>
@@ -429,7 +439,7 @@ if (count($pools) > 0) {
}
if (empty($leases)) {
- print '<div class="alert alert-warning" role="alert">'. gettext("No leases file found. Is the DHCP server active?") .'</div>';
+ print '<div class="alert alert-warning" role="alert">' . gettext("No leases file found. Is the DHCP server active?") . '</div>';
}
?>
@@ -449,24 +459,25 @@ if (empty($leases)) {
<th><?=gettext("End")?></th>
<th><?=gettext("Online")?></th>
<th><?=gettext("Lease Type")?></th>
+ <th><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($leases as $data):
- if ($data['act'] != "active" && $data['act'] != "static" && $_GET['all'] != 1) {
+ if ($data['act'] != $active_string && $data['act'] != $static_string && $_GET['all'] != 1) {
continue;
}
- if ($data['act'] == 'active') {
+ if ($data['act'] == $active_string) {
$icon = 'fa-check-circle-o';
- } elseif ($data['act'] == 'expired') {
+ } elseif ($data['act'] == $expired_string) {
$icon = 'fa-ban';
} else {
$icon = 'fa-times-circle-o';
}
- if ($data['act'] == "static") {
+ if ($data['act'] == $static_string) {
foreach ($config['dhcpdv6'] as $dhcpif => $dhcpifconf) {
if (is_array($dhcpifconf['staticmap'])) {
foreach ($dhcpifconf['staticmap'] as $staticent) {
@@ -496,31 +507,31 @@ foreach ($leases as $data):
<td>
<?=$mac?>
- <? if (isset($mac_man[$mac_hi])):?>
+ <?php if (isset($mac_man[$mac_hi])):?>
(<?=$mac_man[$mac_hi]?>)
- <?endif?>
+ <?php endif; ?>
</td>
<td><?=htmlentities($data['hostname'])?></td>
-<? if ($data['type'] != "static"):?>
+<?php if ($data['type'] != $static_string):?>
<td><?=adjust_gmt($data['start'])?></td>
<td><?=adjust_gmt($data['end'])?></td>
-<? else: ?>
+<?php else: ?>
<td>n/a</td>
<td>n/a</td>
-<? endif; ?>
+<?php endif; ?>
<td><?=$data['online']?></td>
<td><?=$data['act']?></td>
<td>
-<? if ($data['type'] == "dynamic"): ?>
+<?php if ($data['type'] == $dynamic_string): ?>
<a <a class="fa fa-plus-square-o" title="<?=gettext("Add static mapping")?>" href="services_dhcpv6_edit.php?if=<?=$data['if']?>&amp;duid=<?=$data['duid']?>&amp;hostname=<?=htmlspecialchars($data['hostname'])?>"></a>
-<? endif; ?>
+<?php endif; ?>
<a class="fa fa-plus-square" title="<?=gettext("Add WOL mapping")?>" href="services_wol_edit.php?if=<?=$data['if']?>&amp;mac=<?=$data['mac']?>&amp;descr=<?=htmlentities($data['hostname'])?>"></a>
-<? if ($data['type'] == "dynamic" && $data['online'] != "online"):?>
+<?php if ($data['type'] == $dynamic_string && $data['online'] != $online_string):?>
<a class="fa fa-trash" title="<?=gettext('Delete lease')?>" href="status_dhcpv6_leases.php?deleteip=<?=$data['ip']?>&amp;all=<?=intval($_GET['all'])?>"></a>
-<? endif?>
+<?php endif; ?>
</td>
-<? endforeach; ?>
</tr>
+<?php endforeach; ?>
</tbody>
</table>
</div>
@@ -543,19 +554,19 @@ foreach ($leases as $data):
<tbody>
<?php
foreach ($prefixes as $data):
- if ($data['act'] != "active" && $data['act'] != "static" && $_GET['all'] != 1) {
+ if ($data['act'] != $active_string && $data['act'] != $static_string && $_GET['all'] != 1) {
continue;
}
- if ($data['act'] == 'active') {
+ if ($data['act'] == $active_string) {
$icon = 'fa-check-circle-o';
- } elseif ($data['act'] == 'expired') {
+ } elseif ($data['act'] == $expired_string) {
$icon = 'fa-ban';
} else {
$icon = 'fa-times-circle-o';
}
- if ($data['act'] == "static") {
+ if ($data['act'] == $static_string) {
foreach ($config['dhcpdv6'] as $dhcpif => $dhcpifconf) {
if (is_array($dhcpifconf['staticmap'])) {
foreach ($dhcpifconf['staticmap'] as $staticent) {
@@ -582,23 +593,23 @@ foreach ($prefixes as $data):
<td><i class="fa <?=$icon?>"></i></td>
<td>
<?=$data['prefix']?>
-<? if ($mappings[$data['iaid'] . $data['duid']]): ?>
+<?php if ($mappings[$data['iaid'] . $data['duid']]): ?>
<br />
<?=gettext('Routed To')?>: <?=$mappings[$data['iaid'] . $data['duid']]?>
-<? endif; ?>
+<?php endif; ?>
</td>
<td><?=$data['iaid']?></td>
<td><?=$data['duid']?></td>
-<? if ($data['type'] != "static"):?>
+<?php if ($data['type'] != $static_string):?>
<td><?=adjust_gmt($data['start'])?></td>
<td><?=adjust_gmt($data['end'])?></td>
-<? else: ?>
+<?php else: ?>
<td>n/a</td>
<td>n/a</td>
-<? endif; ?>
+<?php endif; ?>
<td><?=$data['act']?></td>
-<? endforeach; ?>
</tr>
+<?php endforeach; ?>
</tbody>
</table>
</div>
diff --git a/src/usr/local/www/status_filter_reload.php b/src/usr/local/www/status_filter_reload.php
index 9a9596b..f46e1b0 100644
--- a/src/usr/local/www/status_filter_reload.php
+++ b/src/usr/local/www/status_filter_reload.php
@@ -91,13 +91,13 @@ include("head.inc");
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Filter Reload</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Filter Reload");?></h2></div>
<div class="panel-body">
<form action="status_filter_reload.php" method="post" name="filter">
- <input type="submit" class="btn btn-success" value="Reload Filter" name="reloadfilter" id="reloadfilter" />
+ <input type="submit" class="btn btn-success" value="<?=gettext("Reload Filter")?>" name="reloadfilter" id="reloadfilter" />
<?php
if ($config['hasync'] && $config['hasync']["synchronizetoip"] != ""): ?>
- <input type="submit" class="btn btn-default" value="Force Config Sync" name="syncfilter" id="syncfilter" />
+ <input type="submit" class="btn btn-default" value="<?=gettext("Force Config Sync")?>" name="syncfilter" id="syncfilter" />
<?php
endif;
?>
@@ -114,7 +114,7 @@ endif;
<br/>
- <div id="reloadinfo"><?=gettext("This page will automatically refresh every 3 seconds until the filter is done reloading"); ?>.</div>
+ <div id="reloadinfo"><?=gettext("This page will automatically refresh every 3 seconds until the filter is done reloading."); ?></div>
</div>
</div>
@@ -133,18 +133,18 @@ function update_data(obj) {
result_text = result_text.replace("\n", "");
result_text = result_text.replace("\r", "");
if (result_text) {
- jQuery('#status').html(result_text + '...');
+ $('#status').html(result_text + '...');
} else {
- jQuery('#status').html('Obtaining filter status...');
+ $('#status').html('<?=gettext("Obtaining filter status...");?>');
}
if (result_text == "Initializing") {
- jQuery('#status').html('Initializing...');
+ $('#status').html('<?=gettext("Initializing...");?>');
} else if (result_text == "Done") {
- jQuery('#status').effect('highlight');
- jQuery('#status').html('Done. The filter rules have been reloaded.');
- jQuery('#reloadinfo').css("visibility", "hidden");
- jQuery('#doneurl').css("visibility", "visible");
- jQuery('#doneurl').html("<p><a href='status_queues.php'>Queue Status<\/a><\/p>");
+ $('#status').effect('highlight');
+ $('#status').html('<?=gettext("Done. The filter rules have been reloaded.");?>');
+ $('#reloadinfo').css("visibility", "hidden");
+ $('#doneurl').css("visibility", "visible");
+ $('#doneurl').html("<p><a href='status_queues.php'><?=gettext("Queue Status");?><\/a><\/p>");
}
window.setTimeout('update_status_thread()', 2500);
}
diff --git a/src/usr/local/www/status_gateway_groups.php b/src/usr/local/www/status_gateway_groups.php
index b88c7cd..d9708b4 100755
--- a/src/usr/local/www/status_gateway_groups.php
+++ b/src/usr/local/www/status_gateway_groups.php
@@ -92,24 +92,26 @@ $tab_array[0] = array(gettext("Gateways"), false, "status_gateways.php");
$tab_array[1] = array(gettext("Gateway Groups"), true, "status_gateway_groups.php");
display_top_tabs($tab_array);
?>
-
-<div class="table-responsive">
- <table class="table table-hover table-condensed table-striped">
- <thead>
- <tr>
- <th><?=gettext("Group Name"); ?></th>
- <th><?=gettext("Gateways"); ?></th>
- <th><?=gettext("Description"); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($a_gateway_groups as $gateway_group): ?>
- <tr>
- <td>
- <?=htmlspecialchars($gateway_group['name'])?>
- </td>
- <td>
- <table class="table table-bordered table-condensed">
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Gateway Groups')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-hover table-condensed table-striped">
+ <thead>
+ <tr>
+ <th><?=gettext("Group Name"); ?></th>
+ <th><?=gettext("Gateways"); ?></th>
+ <th><?=gettext("Description"); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach ($a_gateway_groups as $gateway_group): ?>
+ <tr>
+ <td>
+ <?=htmlspecialchars($gateway_group['name'])?>
+ </td>
+ <td>
+ <table class="table table-bordered table-condensed">
<?php
/* process which priorities we have */
$priorities = array();
@@ -120,17 +122,17 @@ display_top_tabs($tab_array);
$priority_count = count($priorities);
ksort($priorities);
?>
- <thead>
- <tr>
+ <thead>
+ <tr>
<?php
// Make a column for each tier
foreach ($priorities as $number => $tier) {
echo "<th>" . sprintf(gettext("Tier %s"), $number) . "</th>";
}
?>
- </tr>
- </thead>
- <tbody>
+ </tr>
+ </thead>
+ <tbody>
<?php
/* inverse gateway group to gateway priority */
$priority_arr = array();
@@ -145,7 +147,7 @@ display_top_tabs($tab_array);
foreach ($tier as $member) {
/* we always have $priority_count fields */
?>
- <tr>
+ <tr>
<?php
$c = 1;
while ($c <= $priority_count) {
@@ -173,35 +175,37 @@ display_top_tabs($tab_array);
$bgcolor = WHITE;
}
?>
- <td bgcolor="<?=$bgcolor?>">
- <?=htmlspecialchars($member);?>,<br/><?=$online?>
- </td>
+ <td bgcolor="<?=$bgcolor?>">
+ <?=htmlspecialchars($member);?>,<br/><?=$online?>
+ </td>
<?php
} else {
?>
- <td>
- </td>
+ <td>
+ </td>
<?php }
$c++;
}
?>
- </tr>
+ </tr>
<?php
}
$p++;
}
?>
- </tbody>
- </table>
- </td>
- <td>
- <?=htmlspecialchars($gateway_group['descr'])?>
- </td>
- </tr>
+ </tbody>
+ </table>
+ </td>
+ <td>
+ <?=htmlspecialchars($gateway_group['descr'])?>
+ </td>
+ </tr>
<?php endforeach; ?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
<?php include("foot.inc");
diff --git a/src/usr/local/www/status_gateways.php b/src/usr/local/www/status_gateways.php
index 97c0051..cf7c652 100644
--- a/src/usr/local/www/status_gateways.php
+++ b/src/usr/local/www/status_gateways.php
@@ -87,6 +87,9 @@ $tab_array[] = array(gettext("Gateways"), true, "status_gateways.php");
$tab_array[] = array(gettext("Gateway Groups"), false, "status_gateway_groups.php");
display_top_tabs($tab_array);
?>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Gateways')?></h2></div>
+ <div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
@@ -96,6 +99,7 @@ display_top_tabs($tab_array);
<th><?=gettext("Gateway"); ?></th>
<th><?=gettext("Monitor"); ?></th>
<th><?=gettext("RTT"); ?></th>
+ <th><?=gettext("RTTsd"); ?></th>
<th><?=gettext("Loss"); ?></th>
<th><?=gettext("Status"); ?></th>
<th><?=gettext("Description"); ?></th>
@@ -109,7 +113,7 @@ display_top_tabs($tab_array);
<?=htmlspecialchars($gateway['name']);?>
</td>
<td>
- <?php echo lookup_gateway_ip_by_name($gname);?>
+ <?=lookup_gateway_ip_by_name($gname);?>
</td>
<td>
<?php
@@ -123,7 +127,9 @@ display_top_tabs($tab_array);
<td>
<?php
if ($gateways_status[$gname]) {
- echo $gateways_status[$gname]['delay'];
+ if (!isset($gateway['monitor_disable'])) {
+ echo $gateways_status[$gname]['delay'];
+ }
} else {
echo gettext("Pending");
}
@@ -132,7 +138,20 @@ display_top_tabs($tab_array);
<td>
<?php
if ($gateways_status[$gname]) {
- echo $gateways_status[$gname]['loss'];
+ if (!isset($gateway['monitor_disable'])) {
+ echo $gateways_status[$gname]['stddev'];
+ }
+ } else {
+ echo gettext("Pending");
+ }
+?>
+ </td>
+ <td>
+<?php
+ if ($gateways_status[$gname]) {
+ if (!isset($gateway['monitor_disable'])) {
+ echo $gateways_status[$gname]['loss'];
+ }
} else {
echo gettext("Pending");
}
@@ -148,10 +167,10 @@ display_top_tabs($tab_array);
$online = gettext("Offline");
$bgcolor = LIGHTCORAL;
} elseif (stristr($status['status'], "loss")) {
- $online = gettext("Warning, Packetloss").': '.$status['loss'];
+ $online = gettext("Warning, Packetloss") . ': ' . $status['loss'];
$bgcolor = KHAKI;
} elseif (stristr($status['status'], "delay")) {
- $online = gettext("Warning, Latency").': '.$status['delay'];
+ $online = gettext("Warning, Latency") . ': ' . $status['delay'];
$bgcolor = KHAKI;
} elseif ($status['status'] == "none") {
$online = gettext("Online");
@@ -175,7 +194,7 @@ display_top_tabs($tab_array);
<td bgcolor="<?=$bgcolor?>">
<strong><?=$online?></strong> <?php
if (!empty($lastchange)) { ?>
- <br /><i>Last checked <?=$lastchange?></i>
+ <br /><i><?=gettext("Last checked")?> <?=$lastchange?></i>
<?php } ?>
</td>
@@ -188,4 +207,7 @@ display_top_tabs($tab_array);
</table>
</div>
+ </div>
+</div>
+
<?php include("foot.inc"); ?>
diff --git a/src/usr/local/www/status_graph.php b/src/usr/local/www/status_graph.php
index 39ea7f0..8a366f3 100644
--- a/src/usr/local/www/status_graph.php
+++ b/src/usr/local/www/status_graph.php
@@ -84,14 +84,14 @@ if ($_POST['height']) {
// Get configured interface list
$ifdescrs = get_configured_interface_with_descr();
if (ipsec_enabled()) {
- $ifdescrs['enc0'] = "IPsec";
+ $ifdescrs['enc0'] = gettext("IPsec");
}
foreach (array('server', 'client') as $mode) {
if (is_array($config['openvpn']["openvpn-{$mode}"])) {
foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) {
if (!isset($setting['disable'])) {
- $ifdescrs['ovpn' . substr($mode, 0, 1) . $setting['vpnid']] = gettext("OpenVPN") . " ".$mode.": ".htmlspecialchars($setting['description']);
+ $ifdescrs['ovpn' . substr($mode, 0, 1) . $setting['vpnid']] = gettext("OpenVPN") . " " . $mode . ": ".htmlspecialchars($setting['description']);
}
}
}
@@ -170,8 +170,8 @@ $group->add(new Form_Select(
null,
$cursort,
array (
- 'in' => 'Bandwidth In',
- 'out' => 'Bandwidth Out'
+ 'in' => gettext('Bandwidth In'),
+ 'out' => gettext('Bandwidth Out')
)
))->setHelp('Sort by');
@@ -180,9 +180,9 @@ $group->add(new Form_Select(
null,
$curfilter,
array (
- 'local' => 'Local',
- 'remote'=> 'Remote',
- 'all' => 'All'
+ 'local' => gettext('Local'),
+ 'remote'=> gettext('Remote'),
+ 'all' => gettext('All')
)
))->setHelp('Filter');
@@ -191,9 +191,10 @@ $group->add(new Form_Select(
null,
$curhostipformat,
array (
- '' => 'IP Address',
- 'hostname' => 'Host Name',
- 'fqdn' => 'FQDN'
+ '' => gettext('IP Address'),
+ 'hostname' => gettext('Host Name'),
+ 'descr' => gettext('Description'),
+ 'fqdn' => gettext('FQDN')
)
))->setHelp('Display');
@@ -224,8 +225,8 @@ function updateBandwidth() {
$('#top10-hosts').append('<tr>'+
'<td>'+ hostinfo[0] +'</td>'+
- '<td>'+ hostinfo[1] +' Bits/sec</td>'+
- '<td>'+ hostinfo[2] +' Bits/sec</td>'+
+ '<td>'+ hostinfo[1] +' <?=gettext("Bits/sec");?></td>'+
+ '<td>'+ hostinfo[2] +' <?=gettext("Bits/sec");?></td>'+
'</tr>');
}
}
@@ -248,21 +249,21 @@ events.push(function() {
/* link the ipsec interface magically */
if (ipsec_enabled()) {
- $ifdescrs['enc0'] = "IPsec";
+ $ifdescrs['enc0'] = gettext("IPsec");
}
?>
<div class="panel panel-default">
<div class="panel-heading">
- <h2 class="panel-title">Traffic graph</h2>
+ <h2 class="panel-title"><?=gettext("Traffic graph");?></h2>
</div>
<div class="panel-body">
<div class="col-sm-6">
<object data="graph.php?ifnum=<?=htmlspecialchars($curif);?>&amp;ifname=<?=rawurlencode($ifdescrs[htmlspecialchars($curif)]);?>">
<param name="id" value="graph" />
<param name="type" value="image/svg+xml" />
- <param name="width" value="<? echo $width; ?>" />
- <param name="height" value="<? echo $height; ?>" />
+ <param name="width" value="<?=$width;?>" />
+ <param name="height" value="<?=$height;?>" />
<param name="pluginspage" value="http://www.adobe.com/svg/viewer/install/auto" />
</object>
</div>
diff --git a/src/usr/local/www/status_graph_cpu.php b/src/usr/local/www/status_graph_cpu.php
index 4581b19..1b9d8e8 100644
--- a/src/usr/local/www/status_graph_cpu.php
+++ b/src/usr/local/www/status_graph_cpu.php
@@ -63,22 +63,21 @@
##|*MATCH=status_graph_cpu.php*
##|-PRIV
-$pgtitle = array(gettext("Status"), gettext("CPU load"));
+$pgtitle = array(gettext("Status"), gettext("CPU Load Graph"));
require("guiconfig.inc");
include("head.inc");
-$pgtitle = gettext("Status: CPU Graph");
-
?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">CPU Load graph</h2></div>
- <div class="panel-body" align="center">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("CPU Load Graph");?></h2></div>
+ <div class="panel-body text-center">
<embed src="graph_cpu.php" type="image/svg+xml"
width="550" height="275" pluginspage="http://www.adobe.com/svg/viewer/install/auto" />
</div>
- <p align="center"><strong><?=gettext("Note"); ?>:</strong><?=gettext("if you can't see the graph, you may have to install the")?>
- <a href="http://www.adobe.com/svg/viewer/install/" target="_blank"><?=gettext("Adobe SVG viewer"); ?></a>
+ <p class="text-center">
+ <strong><?=gettext("Note"); ?>:</strong>
+ <?=sprintf(gettext('If you cannot see the graph, you may have to install the %1$sAdobe SVG viewer%2$s'), '<a href="http://www.adobe.com/svg/viewer/install/" target="_blank">', '</a>')?>
</p>
</div>
diff --git a/src/usr/local/www/status_ipsec.php b/src/usr/local/www/status_ipsec.php
index 5ef2c45..09caa2a 100644
--- a/src/usr/local/www/status_ipsec.php
+++ b/src/usr/local/www/status_ipsec.php
@@ -124,7 +124,7 @@ display_top_tabs($tab_array);
?>
<div class="panel panel-default">
- <div class="panel-heading">IPsec status</div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("IPsec status");?></h2></div>
<div class="panel-body table responsive">
<table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
<thead>
@@ -197,7 +197,7 @@ if (is_array($status)) {
$identity = "";
if (!empty($ikesa['remote-id'])) {
if ($ikesa['remote-id'] == '%any') {
- $identity = 'Any identifier';
+ $identity = htmlspecialchars(gettext('Any identifier'));
} else {
$identity = htmlspecialchars($ikesa['remote']['identification']);
}
@@ -274,13 +274,13 @@ if (is_array($status)) {
<?php
if ($ikesa['state'] != 'ESTABLISHED') {
?>
- <a href="status_ipsec.php?act=connect&amp;ikeid=<?=$con_id; ?>" class="btn btn-xs btn-success" data-toggle="tooltip" title="Connect VPN" >
+ <a href="status_ipsec.php?act=connect&amp;ikeid=<?=$con_id; ?>" class="btn btn-xs btn-success" data-toggle="tooltip" title="<?=gettext("Connect VPN");?>" >
<?=gettext("Connect VPN")?>
</a>
<?php
} else {
?>
- <a href="status_ipsec.php?act=ikedisconnect&amp;ikeid=<?=$con_id; ?>" class="btn btn-xs btn-danger" data-toggle="tooltip" title="Disconnect VPN">
+ <a href="status_ipsec.php?act=ikedisconnect&amp;ikeid=<?=$con_id; ?>" class="btn btn-xs btn-danger" data-toggle="tooltip" title="<?=gettext("Disconnect VPN");?>">
<?=gettext("Disconnect")?>
</a><br />
<?php
@@ -519,5 +519,17 @@ function show_childsa(id, buttonid) {
<?php
unset($status);
-print_info_box(gettext("You can configure IPsec ") . '<a href="vpn_ipsec.php">Here</a>');
+if (ipsec_enabled()) {
+?>
+<div class="infoblock">
+<?php
+} else {
+?>
+<div class="infoblock blockopen">
+<?php
+}
+print_info_box(sprintf(gettext('You can configure IPsec %1$shere%2$s'), '<a href="vpn_ipsec.php">', '</a>'), 'info', false);
+?>
+</div>
+<?php
include("foot.inc"); ?>
diff --git a/src/usr/local/www/status_ipsec_leases.php b/src/usr/local/www/status_ipsec_leases.php
index 155f274..0778e90 100644
--- a/src/usr/local/www/status_ipsec_leases.php
+++ b/src/usr/local/www/status_ipsec_leases.php
@@ -152,6 +152,17 @@ if (isset($mobile['pool']) && is_array($mobile['pool'])) {
print_info_box(gettext('No IPsec pools.'));
}
-print_info_box(gettext('You can configure your IPsec subsystem by clicking ') . '<a href="vpn_ipsec.php">' . gettext("here.") . '</a>');
-
+if (ipsec_enabled()) {
+?>
+<div class="infoblock">
+<?php
+} else {
+?>
+<div class="infoblock blockopen">
+<?php
+}
+print_info_box(sprintf(gettext('You can configure IPsec %1$shere%2$s'), '<a href="vpn_ipsec.php">', '</a>'), 'info', false);
+?>
+</div>
+<?php
include("foot.inc");
diff --git a/src/usr/local/www/status_ipsec_sad.php b/src/usr/local/www/status_ipsec_sad.php
index bbc9698..e213e50 100644
--- a/src/usr/local/www/status_ipsec_sad.php
+++ b/src/usr/local/www/status_ipsec_sad.php
@@ -135,7 +135,7 @@ if (count($sad)) {
$args .= "&amp;proto=" . rawurlencode($sa['proto']);
$args .= "&amp;spi=" . rawurlencode("0x" . $sa['spi']);
?>
- <a class="btn btn-xs btn-danger" href="status_ipsec_sad.php?act=del&amp;<?=$args?>">Delete</a>
+ <a class="btn btn-xs btn-danger" href="status_ipsec_sad.php?act=del&amp;<?=$args?>"><?=gettext('Delete')?></a>
</td>
</tr>
@@ -149,6 +149,17 @@ if (count($sad)) {
print_info_box(gettext('No IPsec security associations.'));
}
-print_info_box(gettext('You can configure your IPsec subsystem by clicking ') . '<a href="vpn_ipsec.php">' . gettext("here.") . '</a>');
-
+if (ipsec_enabled()) {
+?>
+<div class="infoblock">
+<?php
+} else {
+?>
+<div class="infoblock blockopen">
+<?php
+}
+print_info_box(sprintf(gettext('You can configure IPsec %1$shere%2$s'), '<a href="vpn_ipsec.php">', '</a>'), 'info', false);
+?>
+</div>
+<?php
include("foot.inc");
diff --git a/src/usr/local/www/status_ipsec_spd.php b/src/usr/local/www/status_ipsec_spd.php
index 56a9acf..f051d39 100644
--- a/src/usr/local/www/status_ipsec_spd.php
+++ b/src/usr/local/www/status_ipsec_spd.php
@@ -100,9 +100,9 @@ if (count($spd)) {
<?php
foreach ($spd as $sp) {
if ($sp['dir'] == 'in') {
- $dirstr = LEFTARROW . ' Inbound';
+ $dirstr = LEFTARROW . gettext(' Inbound');
} else {
- $dirstr = RIGHTARROW . ' Outbound';
+ $dirstr = RIGHTARROW . gettext(' Outbound');
}
?>
<tr>
@@ -133,6 +133,17 @@ if (count($spd)) {
print_info_box(gettext('No IPsec security policies configured.'));
}
-print_info_box(gettext('You can configure your IPsec subsystem by clicking ') . '<a href="vpn_ipsec.php">' . gettext("here.") . '</a>');
-
+if (ipsec_enabled()) {
+?>
+<div class="infoblock">
+<?php
+} else {
+?>
+<div class="infoblock blockopen">
+<?php
+}
+print_info_box(sprintf(gettext('You can configure IPsec %1$shere%2$s'), '<a href="vpn_ipsec.php">', '</a>'), 'info', false);
+?>
+</div>
+<?php
include("foot.inc");
diff --git a/src/usr/local/www/status_lb_pool.php b/src/usr/local/www/status_lb_pool.php
index d9917f8..57d320c 100644
--- a/src/usr/local/www/status_lb_pool.php
+++ b/src/usr/local/www/status_lb_pool.php
@@ -140,12 +140,12 @@ if ($_POST) {
}
mark_subsystem_dirty('loadbalancer');
- write_config("Updated load balancer pools via status screen.");
+ write_config(gettext("Updated load balancer pools via status screen."));
}
}
if (is_subsystem_dirty('loadbalancer')) {
- print_info_box_np('The load balancer configuration has been changed You must apply the changes in order for them to take effect.');
+ print_apply_box(gettext("The load balancer configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
/* active tabs */
@@ -159,7 +159,7 @@ $rowsprinted = 0;
<form action="status_lb_pool.php" method="post">
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Load Balancer Pools</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Load Balancer Pools");?></h2></div>
<div class="panel-body table-responsive">
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
@@ -184,13 +184,13 @@ foreach ($a_pool as $pool):
<?php
switch ($pool['mode']) {
case "loadbalance":
- echo "Load balancing";
+ echo gettext("Load balancing");
break;
case "failover":
- echo "Manual failover";
+ echo gettext("Manual failover");
break;
default:
- echo "(default)";
+ echo gettext("(default)");
}
?>
</td>
diff --git a/src/usr/local/www/status_lb_vs.php b/src/usr/local/www/status_lb_vs.php
index 4bfe8c3..fb7849f 100644
--- a/src/usr/local/www/status_lb_vs.php
+++ b/src/usr/local/www/status_lb_vs.php
@@ -91,7 +91,7 @@ $tab_array[] = array(gettext("Virtual Servers"), true, "status_lb_vs.php");
display_top_tabs($tab_array);
if (empty($a_vs)) {
- print('<div class="alert alert-danger">No load balancers have been configured!</div>');
+ print('<div class="alert alert-danger">' . gettext("No load balancers have been configured!") . '</div>');
} else {
?>
<div class="table-responsive"></div>
@@ -133,15 +133,15 @@ if (empty($a_vs)) {
switch (trim($rdr_a[$vsent['name']]['status'])) {
case 'active':
$bgcolor = LIGHTGREEN;
- $rdr_a[$vsent['name']]['status'] = "Active";
+ $rdr_a[$vsent['name']]['status'] = gettext("Active");
break;
case 'down':
$bgcolor = LIGHTCORAL;
- $rdr_a[$vsent['name']]['status'] = "Down";
+ $rdr_a[$vsent['name']]['status'] = gettext("Down");
break;
default:
$bgcolor = LIGHTGRAY;
- $rdr_a[$vsent['name']]['status'] = 'Unknown - relayd not running?';
+ $rdr_a[$vsent['name']]['status'] = gettext('Unknown - relayd not running?');
}
if (!COLOR) {
@@ -153,19 +153,13 @@ if (empty($a_vs)) {
<?php
if (!empty($rdr_a[$vsent['name']]['total'])) {
-?>
- Total Sessions: <?=$rdr_a[$vsent['name']]['total']?><br>/>
-<?php
+ echo sprintf(gettext("Total Sessions: %s"), $rdr_a[$vsent['name']]['total'] . "<br />");
}
if (!empty($rdr_a[$vsent['name']]['last'])) {
-?>
- Last: <?=$rdr_a[$vsent['name']]['last']?><br>/>
-<?php
+ echo sprintf(gettext("Last: %s"), $rdr_a[$vsent['name']]['last'] . "<br />");
}
if (!empty($rdr_a[$vsent['name']]['average'])) {
-?>
- Average: <?=$rdr_a[$vsent['name']]['average']?>
-<?php
+ echo sprintf(gettext("Average: %s"), $rdr_a[$vsent['name']]['average']);
}
?>
</td>
diff --git a/src/usr/local/www/status_logs.php b/src/usr/local/www/status_logs.php
index 4a1ff52..fe9cd29 100755
--- a/src/usr/local/www/status_logs.php
+++ b/src/usr/local/www/status_logs.php
@@ -63,37 +63,37 @@
##|*MATCH=status_logs.php
##|-PRIV
-require("guiconfig.inc");
-require_once("filter_log.inc");
+require_once("status_logs_common.inc");
+
/*
Build a list of allowed log files so we can reject others to prevent the page
from acting on unauthorized files.
*/
$allowed_logs = array(
- "system" => array("name" => "General",
+ "system" => array("name" => gettext("General"),
"shortcut" => ""),
- "dhcpd" => array("name" => "DHCP",
+ "dhcpd" => array("name" => gettext("DHCP"),
"shortcut" => "dhcp"),
- "portalauth" => array("name" => "Captive Portal Authentication",
+ "portalauth" => array("name" => gettext("Captive Portal Authentication"),
"shortcut" => "captiveportal"),
- "ipsec" => array("name" => "IPsec",
+ "ipsec" => array("name" => gettext("IPsec"),
"shortcut" => "ipsec"),
- "ppp" => array("name" => "PPP",
+ "ppp" => array("name" => gettext("PPP"),
"shortcut" => ""),
- "relayd" => array("name" => "Load Balancer",
+ "relayd" => array("name" => gettext("Load Balancer"),
"shortcut" => "relayd"),
- "openvpn" => array("name" => "OpenVPN",
+ "openvpn" => array("name" => gettext("OpenVPN"),
"shortcut" => "openvpn"),
- "ntpd" => array("name" => "NTPd",
+ "ntpd" => array("name" => gettext("NTPd"),
"shortcut" => "ntp"),
- "gateways" => array("name" => "Gateways",
+ "gateways" => array("name" => gettext("Gateways"),
"shortcut" => "gateways"),
- "routing" => array("name" => "Routing",
+ "routing" => array("name" => gettext("Routing"),
"shortcut" => "routing"),
- "resolver" => array("name" => "DNS Resolver",
+ "resolver" => array("name" => gettext("DNS Resolver"),
"shortcut" => "resolver"),
- "wireless" => array("name" => "Wireless",
+ "wireless" => array("name" => gettext("Wireless"),
"shortcut" => "wireless"),
);
@@ -108,332 +108,55 @@ if (!$_GET['logfile']) {
}
}
-$system_logfile = "{$g['varlog_path']}/" . basename($logfile) . ".log";
-
-
-function getGETPOSTsettingvalue($settingname, $default) {
- $settingvalue = $default;
- if ($_GET[$settingname]) {
- $settingvalue = $_GET[$settingname];
- }
- if ($_POST[$settingname]) {
- $settingvalue = $_POST[$settingname];
- }
- return $settingvalue;
-}
-
-
-$filtersubmit = getGETPOSTsettingvalue('filtersubmit', null);
-
-if ($filtersubmit) {
- $filter_active = true;
- $filtertext = getGETPOSTsettingvalue('filtertext', "");
- $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
-}
-
-$filterlogentries_submit = getGETPOSTsettingvalue('filterlogentries_submit', null);
-
-if ($filterlogentries_submit) {
- $filter_active = true;
- $filterfieldsarray = array();
-
- $filterfieldsarray['time'] = getGETPOSTsettingvalue('filterlogentries_time', null);
- $filterfieldsarray['process'] = getGETPOSTsettingvalue('filterlogentries_process', null);
- $filterfieldsarray['pid'] = getGETPOSTsettingvalue('filterlogentries_pid', null);
- $filterfieldsarray['message'] = getGETPOSTsettingvalue('filterlogentries_message', null);
- $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
-}
-
-
-# Manage Log - Code
-
-$specific_log = basename($logfile) . '_settings';
-
-# All
-$pconfig['cronorder'] = $config['syslog'][$specific_log]['cronorder'];
-$pconfig['nentries'] = $config['syslog'][$specific_log]['nentries'];
-$pconfig['logfilesize'] = $config['syslog'][$specific_log]['logfilesize'];
-$pconfig['format'] = $config['syslog'][$specific_log]['format'];
-
-# System General (main) Specific
-$pconfig['loglighttpd'] = !isset($config['syslog']['nologlighttpd']);
-
-$save_settings = getGETPOSTsettingvalue('save_settings', null);
-
-if ($save_settings) {
-
- # All
- $cronorder = getGETPOSTsettingvalue('cronorder', null);
- $nentries = getGETPOSTsettingvalue('nentries', null);
- $logfilesize = getGETPOSTsettingvalue('logfilesize', null);
- $format = getGETPOSTsettingvalue('format', null);
-
- # System General (main) Specific
- $loglighttpd = getGETPOSTsettingvalue('loglighttpd', null);
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- # All
- if (isset($nentries) && (strlen($nentries) > 0)) {
- if (!is_numeric($nentries) || ($nentries < 5) || ($nentries > 2000)) {
- $input_errors[] = gettext("Number of log entries to show must be between 5 and 2000.");
- }
- }
-
- if (isset($logfilesize) && (strlen($logfilesize) > 0)) {
- if (!is_numeric($logfilesize) || ($logfilesize < 100000)) {
- $input_errors[] = gettext("Log file size must be numeric and greater than or equal to 100000.");
- }
- }
-
- if (!$input_errors) {
-
- # Clear out the specific log settings and leave only the applied settings to override the general logging options (global) settings.
- unset($config['syslog'][$specific_log]);
-
- # All
- if ($cronorder != '') { # if not using the general logging options setting (global)
- $config['syslog'][$specific_log]['cronorder'] = $cronorder;
- }
- if (isset($nentries) && (strlen($nentries) > 0)) {
- $config['syslog'][$specific_log]['nentries'] = (int)$nentries;
- }
+// Log Filter Submit - System
+log_filter_form_system_submit();
- if (isset($logfilesize) && (strlen($logfilesize) > 0)) {
- $config['syslog'][$specific_log]['logfilesize'] = (int)$logfilesize;
- }
- if ($format != '') { # if not using the general logging options setting (global)
- $config['syslog'][$specific_log]['format'] = $format;
- }
+// Manage Log Section - Code
+manage_log_code();
- # System General (main) Specific
- if ($logfile == 'system') {
- $oldnologlighttpd = isset($config['syslog']['nologlighttpd']);
- $config['syslog']['nologlighttpd'] = $loglighttpd ? false : true;
- if ($oldnologlighttpd !== $config['syslog']['nologlighttpd']) {
- $logging_changed = $lighttpd_logging_changed = true;
- }
- }
+// Status Logs Common - Code
+status_logs_common_code();
- // If any of the logging settings were changed then backup and sync (standard write_config). Otherwise only write config (don't backup, don't sync).
- if ($logging_changed) {
- write_config($desc = "Log Display Settings Saved: " . gettext($allowed_logs[$logfile]["name"]), $backup = true, $write_config_only = false);
- $retval = 0;
- $retval = system_syslogd_start();
- } else {
- write_config($desc = "Log Display Settings Saved (no backup, no sync): " . gettext($allowed_logs[$logfile]["name"]), $backup = false, $write_config_only = true);
- }
-
- $savemsg = gettext("The changes have been applied successfully.");
-
- # System General (main) Specific
- if ($logfile == 'system') {
- if ($lighttpd_logging_changed) {
- ob_flush();
- flush();
- log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
- send_event("service restart webgui");
- $savemsg .= "<br />" . gettext("WebGUI process is restarting.");
- }
- }
- }
-}
-
-
-# Formatted/Raw Display
-if ($config['syslog'][$specific_log]['format'] == 'formatted') {
- $rawfilter = false;
-} else if ($config['syslog'][$specific_log]['format'] == 'raw') {
- $rawfilter = true;
-} else { # Use the general logging options setting (global).
- $rawfilter = isset($config['syslog']['rawfilter']);
-}
-
-
-isset($config['syslog'][$specific_log]['nentries']) ? $nentries = $config['syslog'][$specific_log]['nentries'] : $nentries = $config['syslog']['nentries'];
-
-# Override Display Quantity
-if ($filterlogentries_qty) {
- $nentries = $filterlogentries_qty;
-}
-
-if (!$nentries || !is_numeric($nentries)) {
- $nentries = 50;
-}
-
-if ($_POST['clear']) {
- clear_log_file($system_logfile);
-}
-
if ($filtertext) {
$filtertextmeta="?filtertext=$filtertext";
}
-/* Setup shortcuts if they exist */
-
-if (!empty($allowed_logs[$logfile]["shortcut"])) {
- $shortcut_section = $allowed_logs[$logfile]["shortcut"];
-}
-
$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"]));
include("head.inc");
if (!$input_errors && $savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
$manage_log_active = false;
}
-$tab_array = array();
-$tab_array[] = array(gettext("System"), ($logfile == 'system'), "status_logs.php");
-$tab_array[] = array(gettext("Firewall"), false, "status_logs_filter.php");
-$tab_array[] = array(gettext("DHCP"), ($logfile == 'dhcpd'), "status_logs.php?logfile=dhcpd");
-$tab_array[] = array(gettext("Portal Auth"), ($logfile == 'portalauth'), "status_logs.php?logfile=portalauth");
-$tab_array[] = array(gettext("IPsec"), ($logfile == 'ipsec'), "status_logs.php?logfile=ipsec");
-$tab_array[] = array(gettext("PPP"), ($logfile == 'ppp'), "status_logs.php?logfile=ppp");
-$tab_array[] = array(gettext("VPN"), false, "status_logs_vpn.php");
-$tab_array[] = array(gettext("Load Balancer"), ($logfile == 'relayd'), "status_logs.php?logfile=relayd");
-$tab_array[] = array(gettext("OpenVPN"), ($logfile == 'openvpn'), "status_logs.php?logfile=openvpn");
-$tab_array[] = array(gettext("NTP"), ($logfile == 'ntpd'), "status_logs.php?logfile=ntpd");
-$tab_array[] = array(gettext("Settings"), false, "status_logs_settings.php");
-display_top_tabs($tab_array);
-
-$tab_array = array();
-if (in_array($logfile, array('system', 'gateways', 'routing', 'resolver', 'wireless'))) {
- $tab_array[] = array(gettext("General"), ($logfile == 'system'), "/status_logs.php");
- $tab_array[] = array(gettext("Gateways"), ($logfile == 'gateways'), "/status_logs.php?logfile=gateways");
- $tab_array[] = array(gettext("Routing"), ($logfile == 'routing'), "/status_logs.php?logfile=routing");
- $tab_array[] = array(gettext("Resolver"), ($logfile == 'resolver'), "/status_logs.php?logfile=resolver");
- $tab_array[] = array(gettext("Wireless"), ($logfile == 'wireless'), "/status_logs.php?logfile=wireless");
- display_top_tabs($tab_array, false, 'nav nav-tabs');
-}
-
-if ($filter_active) {
- $filter_state = SEC_OPEN;
-} else {
- $filter_state = SEC_CLOSED;
-}
-
-if (!$rawfilter) { // Advanced log filter form
- $form = new Form(false);
-
- $section = new Form_Section('Advanced Log Filter', 'adv-filter-panel', COLLAPSIBLE|$filter_state);
-
- $group = new Form_Group('');
-
- $group->add(new Form_Input(
- 'filterlogentries_time',
- null,
- 'text',
- $filterfieldsarray['time']
- ))->setWidth(3)->setHelp('Time');
-
- $group->add(new Form_Input(
- 'filterlogentries_process',
- null,
- 'text',
- $filterfieldsarray['process']
- ))->setWidth(2)->setHelp('Process');
-
- $group->add(new Form_Input(
- 'filterlogentries_pid',
- null,
- 'text',
- $filterfieldsarray['pid']
- ))->setWidth(2)->setHelp('PID');
+// Tab Array
+tab_array_logs_common();
- $group->add(new Form_Input(
- 'filterlogentries_qty',
- null,
- 'number',
- $filterlogentries_qty,
- ['placeholder' => $nentries]
- ))->setWidth(2)->setHelp('Quantity');
- $section->add($group);
-
- $group = new Form_Group('');
-
- $group->add(new Form_Input(
- 'filterlogentries_message',
- null,
- 'text',
- $filterfieldsarray['message']
- ))->setWidth(7)->setHelp('Message');
-
- $btnsubmit = new Form_Button(
- 'filterlogentries_submit',
- ' ' . gettext('Apply Filter'),
- null,
- 'fa-filter'
- );
-} else { // Simple log filter form
- $form = new Form(false);
-
- $section = new Form_Section('Log Filter', 'basic-filter-panel', COLLAPSIBLE|$filter_state);
-
- $group = new Form_Group('');
-
- $group->add(new Form_Input(
- 'filtertext',
- null,
- 'text',
- $filtertext
- ))->setWidth(6)->setHelp('Filter Expression');
-
- $group->add(new Form_Input(
- 'filterlogentries_qty',
- null,
- 'number',
- $filterlogentries_qty,
- ['placeholder' => $nentries]
- ))->setWidth(2)->setHelp('Quantity');
-
- $btnsubmit = new Form_Button(
- 'filtersubmit',
- ' ' . gettext('Apply Filter'),
- null,
- 'fa-filter'
- );
+// Manage Log - Section/Form
+if ($system_logs_manage_log_form_hidden) {
+ manage_log_section();
}
-$btnsubmit->removeClass('btn-primary')->addClass('btn-success')->addClass('btn-sm');
-$group->add(new Form_StaticText(
- '',
- $btnsubmit
-));
+// Filter Section/Form - System
+filter_form_system();
-$group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.'));
-$section->add($group);
-$form->add($section);
-print $form;
// Now the forms are complete we can draw the log table and its controls
if (!$rawfilter) {
- if ($filterlogentries_submit) {
- $filterlog = conv_log_filter($system_logfile, $nentries, $nentries + 100, $filterfieldsarray);
- } else {
- $filterlog = conv_log_filter($system_logfile, $nentries, $nentries + 100, $filtertext);
- }
+ system_log_filter();
?>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">
<?php
- if ((!$filtertext) && (!$filterfieldsarray)) {
- printf(gettext("Last %d %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
- } else {
- printf(gettext("%d matched %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
- }
-
- printf(" (" . gettext("Maximum %d") . ")", $nentries);
+ print(system_log_table_panel_title());
?>
</h2>
</div>
@@ -483,7 +206,13 @@ if (!$rawfilter) {
} else {
?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title"><?=gettext("Last ")?><?=$nentries?> <?=gettext($allowed_logs[$logfile]["name"])?><?=gettext(" log entries")?></h2></div>
+ <div class="panel-heading">
+ <h2 class="panel-title">
+<?php
+ print(system_log_table_panel_title());
+?>
+ </h2>
+ </div>
<div class="table table-responsive">
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
@@ -500,14 +229,19 @@ if (!$rawfilter) {
$inverse = null;
}
- if ($filtertext) {
- $rows = dump_clog($system_logfile, $nentries, true, array("$filtertext"), $inverse);
- } else {
- $rows = dump_clog($system_logfile, $nentries, true, array(), $inverse);
- }
+ system_log_filter();
?>
</tbody>
</table>
+
+<script type="text/javascript">
+//<![CDATA[
+events.push(function() {
+ $("#count").html(<?=$rows?>);
+});
+//]]>
+</script>
+
<?php
if ($rows == 0) {
print_info_box(gettext('No logs to display'));
@@ -521,161 +255,9 @@ if (!$rawfilter) {
<?php
# Manage Log - Section/Form
-
-if ($input_errors) {
- print_input_errors($input_errors);
- $manage_log_active = true;
+if (!$system_logs_manage_log_form_hidden) {
+ manage_log_section();
}
-
-if ($manage_log_active) {
- $manage_log_state = SEC_OPEN;
-} else {
- $manage_log_state = SEC_CLOSED;
-}
-
-$form = new Form(false);
-
-$section = new Form_Section(gettext('Manage') . ' ' . gettext($allowed_logs[$logfile]["name"]) . ' ' . gettext('Log'), 'log-manager-panel', COLLAPSIBLE|$manage_log_state);
-
-$section->addInput(new Form_StaticText(
- '',
- 'These settings override the "General Logging Options" settings.'
-));
-
-
-# All
-$group = new Form_Group('Forward/Reverse Display');
-
-$group->add(new Form_Checkbox(
- 'cronorder',
- null,
- 'Forward',
- ($pconfig['cronorder'] == 'forward') ? true : false,
- 'forward'
-))->displayAsRadio()->setHelp('(newest at bottom)');
-
-$group->add(new Form_Checkbox(
- 'cronorder',
- null,
- 'Reverse',
- ($pconfig['cronorder'] == 'reverse') ? true : false,
- 'reverse'
-))->displayAsRadio()->setHelp('(newest at top)');
-
-$group->add(new Form_Checkbox(
- 'cronorder',
- null,
- 'General Logging Options Setting',
- ($pconfig['cronorder'] == '') ? true : false,
- ''
-))->displayAsRadio();
-
-$group->setHelp('Show log entries in forward or reverse order.');
-$section->add($group);
-
-$group = new Form_Group('GUI Log Entries');
-
-# Use the general logging options setting (global) as placeholder.
-$group->add(new Form_Input(
- 'nentries',
- 'GUI Log Entries',
- 'number',
- $pconfig['nentries'],
- ['min' => 5, 'max' => 2000, 'placeholder' => $config['syslog']['nentries']]
-))->setWidth(2);
-
-$group->setHelp('This is the number of log entries displayed in the GUI. It does not affect how many entries are contained in the log.');
-$section->add($group);
-
-$group = new Form_Group('Log file size (Bytes)');
-
-# Use the general logging options setting (global) as placeholder.
-$group->add(new Form_Input(
- 'logfilesize',
- 'Log file size (Bytes)',
- 'number',
- $pconfig['logfilesize'],
- ['min' => 100000, 'placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"]
-))->setWidth(2);
-$group->setHelp("The log is held in a constant-size circular log file. This field controls how large the log file is, and thus how many entries may exist inside the log. The default is approximately 500KB." .
- '<br /><br />' .
- "NOTE: The log size is changed the next time it is cleared. To immediately change the log size, first save the options to set the size, then clear the log using the \"Clear Log\" action below. ");
-$section->add($group);
-
-$group = new Form_Group('Formatted/Raw Display');
-
-$group->add(new Form_Checkbox(
- 'format',
- null,
- 'Formatted',
- ($pconfig['format'] == 'formatted') ? true : false,
- 'formatted'
-))->displayAsRadio();
-
-$group->add(new Form_Checkbox(
- 'format',
- null,
- 'Raw',
- ($pconfig['format'] == 'raw') ? true : false,
- 'raw'
-))->displayAsRadio();
-
-$group->add(new Form_Checkbox(
- 'format',
- null,
- 'General Logging Options Setting',
- ($pconfig['format'] == '') ? true : false,
- ''
-))->displayAsRadio();
-
-$group->setHelp('Show the log entries as formatted or raw output as generated by the service. The raw output will reveal more detailed information, but it is more difficult to read.');
-$section->add($group);
-
-
-# System General (main) Specific
-if ($logfile == 'system') {
- $section->addInput(new Form_Checkbox(
- 'loglighttpd',
- 'Web Server Log',
- 'Log errors from the web server process',
- $pconfig['loglighttpd']
- ))->setHelp('If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the system log.');
-}
-
-
-$group = new Form_Group('Action');
-
-$btnsavesettings = new Form_Button(
- 'save_settings',
- gettext('Save'),
- null
-);
-
-$btnsavesettings->addClass('btn-sm');
-
-$group->add(new Form_StaticText(
- '',
- $btnsavesettings
-))->setHelp('Saves changed settings.');
-
-
-$btnclear = new Form_Button(
- 'clear',
- ' ' . gettext('Clear log'),
- null,
- 'fa-trash'
-);
-
-$btnclear->removeClass('btn-primary')->addClass('btn-danger')->addClass('btn-sm');
-
-$group->add(new Form_StaticText(
- '',
- $btnclear
-))->setHelp('Clears local log file and reinitializes it as an empty log. Save any settings changes first.');
-
-$section->add($group);
-$form->add($section);
-print $form;
?>
<?php include("foot.inc"); ?>
diff --git a/src/usr/local/www/status_logs_common.inc b/src/usr/local/www/status_logs_common.inc
new file mode 100644
index 0000000..b608817
--- /dev/null
+++ b/src/usr/local/www/status_logs_common.inc
@@ -0,0 +1,993 @@
+<?php
+/*
+ status_logs_common.inc
+*/
+/* ====================================================================
+ * Copyright (c) 2004-2015 Electric Sheep Fencing, LLC. All rights reserved.
+ *
+ * Some or all of this file is based on the m0n0wall project which is
+ * Copyright (c) 2004 Manuel Kasper (BSD 2 clause)
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgment:
+ * "This product includes software developed by the pfSense Project
+ * for use in the pfSense software distribution. (http://www.pfsense.org/).
+ *
+ * 4. The names "pfSense" and "pfSense Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * coreteam@pfsense.org.
+ *
+ * 5. Products derived from this software may not be called "pfSense"
+ * nor may "pfSense" appear in their names without prior written
+ * permission of the Electric Sheep Fencing, LLC.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ *
+ * "This product includes software developed by the pfSense Project
+ * for use in the pfSense software distribution (http://www.pfsense.org/).
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ====================================================================
+ *
+ */
+
+require_once("guiconfig.inc");
+require_once("filter_log.inc");
+
+
+// Status Logs Common - Code
+function status_logs_common_code() {
+ global $g, $config, $specific_log, $nentries, $filterlogentries_qty, $logfile_path, $shortcut_section, $allowed_logs, $logfile;
+ global $system_logs_filter_form_hidden, $system_logs_manage_log_form_hidden, $view;
+
+ $logfile_path = "{$g['varlog_path']}/" . basename($logfile) . ".log";
+
+ isset($config['syslog'][$specific_log]['nentries']) ? $nentries = $config['syslog'][$specific_log]['nentries'] : $nentries = $config['syslog']['nentries'];
+
+ // Override Display Quantity
+ if ($filterlogentries_qty) {
+ $nentries = $filterlogentries_qty;
+ }
+
+ if (!$nentries || !is_numeric($nentries)) {
+ $nentries = 50;
+ }
+
+ if ($_POST['clear']) {
+ clear_log_file($logfile_path);
+ }
+
+ /* Setup shortcuts if they exist */
+
+ if (!empty($allowed_logs[$logfile]["shortcut"])) {
+ $shortcut_section = $allowed_logs[$logfile]["shortcut"];
+ }
+
+ // Get the configured options for Show/Hide Log Filter and Manage Log panels.
+ $system_logs_filter_form_hidden = isset($config['system']['webgui']['systemlogsfilterpanel']) ? false : true;
+ $system_logs_manage_log_form_hidden = isset($config['system']['webgui']['systemlogsmanagelogpanel']) ? false : true;
+
+ if ($logfile == 'filter' && $view == 'summary') {
+ $system_logs_filter_form_hidden = false;
+ $system_logs_manage_log_form_hidden = false;
+ }
+}
+
+// Tab Array
+function tab_array_logs_common() {
+ global $tab_array, $logfile, $vpntype, $view;
+
+ $is_system_log = in_array($logfile, array('system', 'gateways', 'routing', 'resolver', 'wireless'));
+ $is_filter_log = in_array($logfile, array('filter'));
+ $is_pppoe_l2tp_vpn_log = in_array($logfile, array('poes', 'l2tps', 'vpn'));
+
+ $tab_array = array();
+ $tab_array[] = array(gettext("System"), $is_system_log, "status_logs.php");
+ $tab_array[] = array(gettext("Firewall"), $is_filter_log, "status_logs_filter.php");
+ $tab_array[] = array(gettext("DHCP"), ($logfile == 'dhcpd'), "status_logs.php?logfile=dhcpd");
+ $tab_array[] = array(gettext("Portal Auth"), ($logfile == 'portalauth'), "status_logs.php?logfile=portalauth");
+ $tab_array[] = array(gettext("IPsec"), ($logfile == 'ipsec'), "status_logs.php?logfile=ipsec");
+ $tab_array[] = array(gettext("PPP"), ($logfile == 'ppp'), "status_logs.php?logfile=ppp");
+ $tab_array[] = array(gettext("VPN"), $is_pppoe_l2tp_vpn_log, "status_logs_vpn.php");
+ $tab_array[] = array(gettext("Load Balancer"), ($logfile == 'relayd'), "status_logs.php?logfile=relayd");
+ $tab_array[] = array(gettext("OpenVPN"), ($logfile == 'openvpn'), "status_logs.php?logfile=openvpn");
+ $tab_array[] = array(gettext("NTP"), ($logfile == 'ntpd'), "status_logs.php?logfile=ntpd");
+ $tab_array[] = array(gettext("Settings"), false, "status_logs_settings.php");
+ display_top_tabs($tab_array);
+
+ $tab_array = array();
+ if ($is_system_log) {
+ $tab_array[] = array(gettext("General"), ($logfile == 'system'), "/status_logs.php");
+ $tab_array[] = array(gettext("Gateways"), ($logfile == 'gateways'), "/status_logs.php?logfile=gateways");
+ $tab_array[] = array(gettext("Routing"), ($logfile == 'routing'), "/status_logs.php?logfile=routing");
+ $tab_array[] = array(gettext("Resolver"), ($logfile == 'resolver'), "/status_logs.php?logfile=resolver");
+ $tab_array[] = array(gettext("Wireless"), ($logfile == 'wireless'), "/status_logs.php?logfile=wireless");
+ }
+ else if ($is_filter_log) {
+ $tab_array[] = array(gettext("Normal View"), ($view == 'normal'), "/status_logs_filter.php");
+ $tab_array[] = array(gettext("Dynamic View"), ($view == 'dynamic'), "/status_logs_filter_dynamic.php?logfile=filter&amp;view=dynamic");
+ $tab_array[] = array(gettext("Summary View"), ($view == 'summary'), "/status_logs_filter_summary.php?logfile=filter&amp;view=summary");
+ }
+ else if ($is_pppoe_l2tp_vpn_log) {
+ $tab_array[] = array(gettext("PPPoE Logins"),
+ (($logfile == 'vpn') && ($vpntype == "poes")),
+ "/status_logs_vpn.php?logfile=vpn&amp;vpntype=poes");
+ $tab_array[] = array(gettext("PPPoE Service"),
+ (($logfile == 'poes') && ($vpntype == "poes")),
+ "/status_logs_vpn.php?logfile=poes&amp;vpntype=poes");
+ $tab_array[] = array(gettext("L2TP Logins"),
+ (($logfile == 'vpn') && ($vpntype == "l2tp")),
+ "/status_logs_vpn.php?logfile=vpn&amp;vpntype=l2tp");
+ $tab_array[] = array(gettext("L2TP Service"),
+ (($logfile == 'l2tps') && ($vpntype == "l2tp")),
+ "/status_logs_vpn.php?logfile=l2tps&amp;vpntype=l2tp");
+ }
+ if ($tab_array) {
+ display_top_tabs($tab_array, false, 'tabs');
+ }
+}
+
+
+// Log Table header
+function system_log_table_panel_title() {
+ global $rawfilter, $filtersubmit, $filterlogentries_submit, $filterlog, $nentries;
+ global $allowed_logs, $logfile;
+
+ $rtnstr = '';
+
+ if ($rawfilter) {
+ if (($filtersubmit) || ($filterlogentries_submit)) {
+ $rtnstr .= sprintf(gettext("%s matched %s log entries."), "<span id='count'>_ _</span>", gettext($allowed_logs[$logfile]["name"]));
+ } else {
+ $rtnstr .= sprintf(gettext("Last %s %s log entries."), "<span id='count'>_ _</span>", gettext($allowed_logs[$logfile]["name"]));
+ }
+ } else {
+ if (($filtersubmit) || ($filterlogentries_submit)) {
+ $rtnstr .= sprintf(gettext("%d matched %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
+ } else {
+ $rtnstr .= sprintf(gettext("Last %d %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
+ }
+ }
+
+ $rtnstr .= sprintf(" (" . gettext("Maximum %d") . ")", $nentries);
+
+ return $rtnstr;
+}
+
+
+// Log Filter
+function system_log_filter() {
+ global $rawfilter, $filtersubmit, $filterlogentries_submit, $filterlog, $nentries;
+ global $logfile_path, $filtertext, $filterfieldsarray, $interfacefilter, $inverse, $rows;
+
+ if ($rawfilter) {
+ if (($filtersubmit) || ($filterlogentries_submit)) {
+ $rows = dump_clog($logfile_path, $nentries, true, array("$filtertext"), $inverse);
+ } else {
+ $rows = dump_clog($logfile_path, $nentries, true, array(), $inverse);
+ }
+ } else {
+ if (($filtersubmit) || ($filterlogentries_submit)) {
+ $filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filterfieldsarray);
+ } else {
+ $filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filtertext, $interfacefilter);
+ }
+ }
+}
+
+
+// Log Filter Submit - System
+function log_filter_form_system_submit() {
+
+ global $filtersubmit, $interfacefilter, $filtertext;
+ global $filterlogentries_submit, $filterfieldsarray, $actpass, $actblock;
+ global $filter_active, $filterlogentries_qty;
+
+ $filtersubmit = getGETPOSTsettingvalue('filtersubmit', null);
+
+ if ($filtersubmit) {
+ $filter_active = true;
+ $filtertext = getGETPOSTsettingvalue('filtertext', "");
+ $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
+ }
+
+ $filterlogentries_submit = getGETPOSTsettingvalue('filterlogentries_submit', null);
+
+ if ($filterlogentries_submit) {
+ $filter_active = true;
+ $filterfieldsarray = array();
+
+ $filterfieldsarray['time'] = getGETPOSTsettingvalue('filterlogentries_time', null);
+ $filterfieldsarray['process'] = getGETPOSTsettingvalue('filterlogentries_process', null);
+ $filterfieldsarray['pid'] = getGETPOSTsettingvalue('filterlogentries_pid', null);
+ $filterfieldsarray['message'] = getGETPOSTsettingvalue('filterlogentries_message', null);
+ $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
+ }
+}
+
+// Filter Section/Form - System
+function filter_form_system() {
+
+ global $filter_active, $rawfilter, $filterfieldsarray, $filtertext, $filterlogentries_qty, $nentries, $Include_Act, $interfacefilter;
+ global $system_logs_filter_form_hidden;
+
+ if ($filter_active) {
+ $panel_state = 'in';
+ $panel_body_state = SEC_OPEN;
+ } else {
+ if ($system_logs_filter_form_hidden) {
+ $panel_state = 'out';
+ $panel_body_state = SEC_OPEN;
+ } else {
+ $panel_state = 'in';
+ $panel_body_state = SEC_CLOSED;
+ }
+ }
+
+ if (!$rawfilter) { // Advanced log filter form
+ $form = new Form(false);
+ $form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
+
+ $section = new Form_Section('Advanced Log Filter', 'filter-panel', COLLAPSIBLE|$panel_body_state);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_time',
+ null,
+ 'text',
+ $filterfieldsarray['time']
+ ))->setWidth(3)->setHelp('Time');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_process',
+ null,
+ 'text',
+ $filterfieldsarray['process']
+ ))->setWidth(2)->setHelp('Process');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_pid',
+ null,
+ 'text',
+ $filterfieldsarray['pid']
+ ))->setWidth(2)->setHelp('PID');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_qty',
+ null,
+ 'number',
+ $filterlogentries_qty,
+ ['placeholder' => $nentries]
+ ))->setWidth(2)->setHelp('Quantity');
+
+ $section->add($group);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_message',
+ null,
+ 'text',
+ $filterfieldsarray['message']
+ ))->setWidth(7)->setHelp('Message');
+
+ $btnsubmit = new Form_Button(
+ 'filterlogentries_submit',
+ ' ' . gettext('Apply Filter'),
+ null,
+ 'fa-filter'
+ );
+ } else { // Simple log filter form
+ $form = new Form(false);
+ $form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
+
+ $section = new Form_Section('Log Filter', 'filter-panel', COLLAPSIBLE|$panel_body_state);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filtertext',
+ null,
+ 'text',
+ $filtertext
+ ))->setWidth(6)->setHelp('Filter Expression');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_qty',
+ null,
+ 'number',
+ $filterlogentries_qty,
+ ['placeholder' => $nentries]
+ ))->setWidth(2)->setHelp('Quantity');
+
+ $btnsubmit = new Form_Button(
+ 'filtersubmit',
+ ' ' . gettext('Apply Filter'),
+ null,
+ 'fa-filter'
+ );
+ }
+
+ $btnsubmit->removeClass('btn-primary')->addClass('btn-sm btn-success');
+
+ $group->add(new Form_StaticText(
+ '',
+ $btnsubmit
+ ));
+
+ $group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.'));
+ $section->add($group);
+ $form->add($section);
+ print $form;
+}
+
+
+// Log Filter Submit - Firewall
+function log_filter_form_firewall_submit() {
+
+ global $filtersubmit, $interfacefilter, $filtertext;
+ global $filterlogentries_submit, $filterfieldsarray, $actpass, $actblock;
+ global $filter_active, $filterlogentries_qty;
+
+ $filtersubmit = getGETPOSTsettingvalue('filtersubmit', null);
+
+ if ($filtersubmit) {
+ $filter_active = true;
+ $interfacefilter = getGETPOSTsettingvalue('interface', null);
+ $filtertext = getGETPOSTsettingvalue('filtertext', "");
+ $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
+ }
+
+ $filterlogentries_submit = getGETPOSTsettingvalue('filterlogentries_submit', null);
+
+ if ($filterlogentries_submit) {
+ $filter_active = true;
+ $filterfieldsarray = array();
+
+ $actpass = getGETPOSTsettingvalue('actpass', null);
+ $actblock = getGETPOSTsettingvalue('actblock', null);
+ $filterfieldsarray['act'] = str_replace(" ", " ", trim($actpass . " " . $actblock));
+ $filterfieldsarray['act'] = $filterfieldsarray['act'] != "" ? $filterfieldsarray['act'] : 'All';
+ $filterfieldsarray['time'] = getGETPOSTsettingvalue('filterlogentries_time', null);
+ $filterfieldsarray['interface'] = getGETPOSTsettingvalue('filterlogentries_interfaces', null);
+ $filterfieldsarray['srcip'] = getGETPOSTsettingvalue('filterlogentries_sourceipaddress', null);
+ $filterfieldsarray['srcport'] = getGETPOSTsettingvalue('filterlogentries_sourceport', null);
+ $filterfieldsarray['dstip'] = getGETPOSTsettingvalue('filterlogentries_destinationipaddress', null);
+ $filterfieldsarray['dstport'] = getGETPOSTsettingvalue('filterlogentries_destinationport', null);
+ $filterfieldsarray['proto'] = getGETPOSTsettingvalue('filterlogentries_protocol', null);
+ $filterfieldsarray['tcpflags'] = getGETPOSTsettingvalue('filterlogentries_protocolflags', null);
+ $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
+ }
+}
+
+// Filter Section/Form - Firewall
+function filter_form_firewall() {
+
+ global $filter_active, $rawfilter, $filterfieldsarray, $filtertext, $filterlogentries_qty, $nentries, $interfacefilter;
+ global $system_logs_filter_form_hidden;
+
+ $Include_Act = explode(",", str_replace(" ", ",", $filterfieldsarray['act']));
+ if ($filterfieldsarray['interface'] == "All") {
+ $interface = "";
+ }
+
+ if ($filter_active) {
+ $panel_state = 'in';
+ $panel_body_state = SEC_OPEN;
+ } else {
+ if ($system_logs_filter_form_hidden) {
+ $panel_state = 'out';
+ $panel_body_state = SEC_OPEN;
+ } else {
+ $panel_state = 'in';
+ $panel_body_state = SEC_CLOSED;
+ }
+ }
+
+ if (!$rawfilter) { // Advanced log filter form
+ $form = new Form(false);
+ $form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
+
+ $section = new Form_Section('Advanced Log Filter', 'filter-panel', COLLAPSIBLE|$panel_body_state);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_sourceipaddress',
+ null,
+ 'text',
+ $filterfieldsarray['srcip']
+ ))->setHelp('Source IP Address');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_destinationipaddress',
+ null,
+ 'text',
+ $filterfieldsarray['dstip']
+ ))->setHelp('Destination IP Address');
+
+ $section->add($group);
+ $group = new Form_Group('');
+
+ $group->add(new Form_Checkbox(
+ 'actpass',
+ 'Pass',
+ 'Pass',
+ in_arrayi('Pass', $Include_Act),
+ 'Pass'
+ ))->setWidth(1);
+
+ $group->add(new Form_Input(
+ 'filterlogentries_time',
+ null,
+ 'text',
+ $filterfieldsarray['time']
+ ))->setWidth(3)->setHelp('Time');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_sourceport',
+ null,
+ 'text',
+ $filterfieldsarray['srcport']
+ ))->setWidth(2)->setHelp('Source Port');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_protocol',
+ null,
+ 'text',
+ $filterfieldsarray['proto']
+ ))->setWidth(2)->setHelp('Protocol');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_qty',
+ null,
+ 'number',
+ $filterlogentries_qty,
+ ['placeholder' => $nentries]
+ ))->setWidth(2)->setHelp('Quantity');
+
+ $section->add($group);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Checkbox(
+ 'actblock',
+ 'Block',
+ 'Block',
+ in_arrayi('Block', $Include_Act),
+ 'Block'
+ ))->setWidth(1);
+
+ $group->add(new Form_Input(
+ 'filterlogentries_interfaces',
+ null,
+ 'text',
+ $filterfieldsarray['interface']
+ ))->setWidth(3)->setHelp('Interface');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_destinationport',
+ null,
+ 'text',
+ $filterfieldsarray['dstport']
+ ))->setWidth(2)->setHelp('Destination Port');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_protocolflags',
+ null,
+ 'text',
+ $filterfieldsarray['tcpflags']
+ ))->setWidth(2)->setHelp('Protocol Flags');
+
+ $btnsubmit = new Form_Button(
+ 'filterlogentries_submit',
+ ' ' . gettext('Apply Filter'),
+ null,
+ 'fa-filter'
+ );
+ } else { // Simple log filter form
+ $form = new Form(false);
+ $form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
+
+ $section = new Form_Section('Log Filter', 'filter-panel', COLLAPSIBLE|$panel_body_state);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Select(
+ 'interface',
+ 'Interface',
+ $interfacefilter,
+ status_logs_build_if_list()
+ ))->setWidth(2)->setHelp('Interface');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_qty',
+ null,
+ 'number',
+ $filterlogentries_qty,
+ ['placeholder' => $nentries]
+ ))->setWidth(2)->setHelp('Quantity');
+
+ $section->add($group);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filtertext',
+ null,
+ 'text',
+ $filtertext
+ ))->setWidth(6)->setHelp('Filter Expression');
+
+ $btnsubmit = new Form_Button(
+ 'filtersubmit',
+ ' ' . gettext('Apply Filter'),
+ null,
+ 'fa-filter'
+ );
+ }
+
+ $btnsubmit->removeClass('btn-primary')->addClass('btn-sm btn-success');
+
+ $group->add(new Form_StaticText(
+ '',
+ $btnsubmit
+ ));
+
+ $group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.'));
+ $section->add($group);
+ $form->add($section);
+ print($form);
+}
+
+
+function status_logs_build_if_list() {
+ $iflist = get_configured_interface_with_descr(false, true);
+ //$iflist = get_interface_list();
+ // Allow extending of the firewall edit interfaces
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_interfaces_edit");
+ foreach ($iflist as $if => $ifdesc) {
+ $interfaces[$if] = $ifdesc;
+ }
+
+ if ($config['l2tp']['mode'] == "server") {
+ $interfaces['l2tp'] = "L2TP VPN";
+ }
+
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
+ $interfaces['pppoe'] = "PPPoE Server";
+ }
+
+ /* add ipsec interfaces */
+ if (ipsec_enabled()) {
+ $interfaces["enc0"] = "IPsec";
+ }
+
+ /* add openvpn/tun interfaces */
+ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
+ $interfaces["openvpn"] = "OpenVPN";
+ }
+
+ return($interfaces);
+}
+
+
+// Manage Log Section - Code
+function manage_log_code() {
+ global $logfile, $specific_log, $config, $pconfig, $rawfilter, $save_settings, $input_errors, $savemsg;
+
+ $specific_log = basename($logfile) . '_settings';
+
+ // Common to All Logs
+ $pconfig['cronorder'] = $config['syslog'][$specific_log]['cronorder'];
+ $pconfig['nentries'] = $config['syslog'][$specific_log]['nentries'];
+ $pconfig['logfilesize'] = $config['syslog'][$specific_log]['logfilesize'];
+ $pconfig['format'] = $config['syslog'][$specific_log]['format'];
+
+ // Specific to System General (main) Log
+ if ($logfile == 'system') {
+ $pconfig['lognginx'] = !isset($config['syslog']['nolognginx']);
+ }
+
+ // Specific to Firewall Log
+ if ($logfile == 'filter') {
+ $pconfig['logdefaultblock'] = !isset($config['syslog']['nologdefaultblock']);
+ $pconfig['logdefaultpass'] = isset($config['syslog']['nologdefaultpass']);
+ $pconfig['logbogons'] = !isset($config['syslog']['nologbogons']);
+ $pconfig['logprivatenets'] = !isset($config['syslog']['nologprivatenets']);
+ $pconfig['filterdescriptions'] = $config['syslog']['filterdescriptions'];
+ }
+
+ $save_settings = getGETPOSTsettingvalue('save_settings', null);
+
+ if ($save_settings) {
+
+ // Common to All Logs
+ $cronorder = getGETPOSTsettingvalue('cronorder', null);
+ $nentries = getGETPOSTsettingvalue('nentries', null);
+ $logfilesize = getGETPOSTsettingvalue('logfilesize', null);
+ $format = getGETPOSTsettingvalue('format', null);
+
+ // Specific to System General (main) Log
+ if ($logfile == 'system') {
+ $lognginx = getGETPOSTsettingvalue('lognginx', null);
+ }
+
+ // Specific to Firewall Log
+ if ($logfile == 'filter') {
+ $logdefaultblock = getGETPOSTsettingvalue('logdefaultblock', null);
+ $logdefaultpass = getGETPOSTsettingvalue('logdefaultpass', null);
+ $logbogons = getGETPOSTsettingvalue('logbogons', null);
+ $logprivatenets = getGETPOSTsettingvalue('logprivatenets', null);
+ $filterdescriptions = getGETPOSTsettingvalue('filterdescriptions', null);
+ }
+
+ unset($input_errors);
+ global $input_errors;
+ $pconfig = $_POST;
+
+ /* input validation */
+ // Common to All Logs
+ if (isset($nentries) && (strlen($nentries) > 0)) {
+ if (!is_numeric($nentries) || ($nentries < 5) || ($nentries > 2000)) {
+ $input_errors[] = gettext("Number of log entries to show must be between 5 and 2000.");
+ }
+ }
+
+ if (isset($logfilesize) && (strlen($logfilesize) > 0)) {
+ if (!is_numeric($logfilesize) || ($logfilesize < 100000)) {
+ $input_errors[] = gettext("Log file size must be numeric and greater than or equal to 100000.");
+ }
+ }
+
+ if (!$input_errors) {
+
+ # Clear out the specific log settings and leave only the applied settings to override the general logging options (global) settings.
+ if (isset($config['syslog'][$specific_log])) {
+ unset($config['syslog'][$specific_log]);
+ }
+
+ // Common to All Logs
+ if ($cronorder != '') { # if not using the general logging options setting (global)
+ $config['syslog'][$specific_log]['cronorder'] = $cronorder;
+ }
+
+ if (isset($nentries) && (strlen($nentries) > 0)) {
+ $config['syslog'][$specific_log]['nentries'] = (int)$nentries;
+ }
+
+ if (isset($logfilesize) && (strlen($logfilesize) > 0)) {
+ $config['syslog'][$specific_log]['logfilesize'] = (int)$logfilesize;
+ }
+
+ if ($format != '') { # if not using the general logging options setting (global)
+ $config['syslog'][$specific_log]['format'] = $format;
+ }
+
+ // Specific to System General (main) Log
+ if ($logfile == 'system') {
+ $oldnolognginx = isset($config['syslog']['nolognginx']);
+ $config['syslog']['nolognginx'] = $lognginx ? false : true;
+
+ if ($oldnolognginx !== $config['syslog']['nolognginx']) {
+ $logging_changed = $nginx_logging_changed = true;
+ }
+ }
+
+ // Specific to Firewall Log
+ if ($logfile == 'filter') {
+ $oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']);
+ $oldnologdefaultpass = isset($config['syslog']['nologdefaultpass']);
+ $oldnologbogons = isset($config['syslog']['nologbogons']);
+ $oldnologprivatenets = isset($config['syslog']['nologprivatenets']);
+
+ $config['syslog']['nologdefaultblock'] = $logdefaultblock ? false : true;
+ $config['syslog']['nologdefaultpass'] = $logdefaultpass ? true : false;
+ $config['syslog']['nologbogons'] = $logbogons ? false : true;
+ $config['syslog']['nologprivatenets'] = $logprivatenets ? false : true;
+
+ if (is_numeric($filterdescriptions) && $filterdescriptions > 0) {
+ $config['syslog']['filterdescriptions'] = $filterdescriptions;
+ } else {
+ unset($config['syslog']['filterdescriptions']);
+ }
+
+ if (
+ ($oldnologdefaultblock !== $config['syslog']['nologdefaultblock']) ||
+ ($oldnologdefaultpass !== $config['syslog']['nologdefaultpass']) ||
+ ($oldnologbogons !== $config['syslog']['nologbogons']) ||
+ ($oldnologprivatenets !== $config['syslog']['nologprivatenets'])) {
+ $logging_changed = $firewall_logging_changed = true;
+ }
+ }
+
+
+ // If any of the logging settings were changed then backup and sync (standard write_config). Otherwise only write config (don't backup, don't sync).
+ if ($logging_changed) {
+ write_config($desc = gettext("Log Display Settings Saved: ") . gettext($allowed_logs[$logfile]["name"]), $backup = true, $write_config_only = false);
+ $retval = 0;
+ $retval = system_syslogd_start();
+ $savemsg = gettext("The changes have been applied successfully.");
+ } else {
+ write_config($desc = gettext("Log Display Settings Saved (no backup, no sync): ") . gettext($allowed_logs[$logfile]["name"]), $backup = false, $write_config_only = true);
+ $savemsg = '';
+ }
+
+ // Specific to System General (main) Log
+ if ($logfile == 'system') {
+ if ($nginx_logging_changed) {
+ ob_flush();
+ flush();
+ log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
+ send_event("service restart webgui");
+ $savemsg .= "<br />" . gettext("WebGUI process is restarting.");
+ }
+ }
+
+ // Specific to Firewall Log
+ if ($logfile == 'filter') {
+ if ($firewall_logging_changed) {
+ require_once("filter.inc");
+ $retval |= filter_configure();
+ filter_pflog_start(true);
+
+ $savemsg = get_std_save_message($retval);
+ }
+ }
+ }
+ }
+
+
+ // Formatted/Raw Display
+ if ($config['syslog'][$specific_log]['format'] == 'formatted') {
+ $rawfilter = false;
+ } else if ($config['syslog'][$specific_log]['format'] == 'raw') {
+ $rawfilter = true;
+ } else { // Use the general logging options setting (global).
+ $rawfilter = isset($config['syslog']['rawfilter']);
+ }
+}
+
+# Manage Log Section/Form
+function manage_log_section() {
+
+ global $input_errors, $allowed_logs, $logfile, $config, $pconfig;
+ global $system_logs_manage_log_form_hidden;
+
+ if ($input_errors) {
+ print_input_errors($input_errors);
+ $manage_log_active = true;
+ }
+
+ if ($filter_active) {
+ $panel_state = 'in';
+ $panel_body_state = SEC_OPEN;
+ } else {
+ if ($system_logs_manage_log_form_hidden) {
+ $panel_state = 'out';
+ $panel_body_state = SEC_OPEN;
+ } else {
+ $panel_state = 'in';
+ $panel_body_state = SEC_CLOSED;
+ }
+ }
+
+ $form = new Form(false);
+ $form->setAttribute('id', 'manage-log-form')->addClass('collapse ' . $panel_state);
+
+ $section = new Form_Section(gettext('Manage') . ' ' . gettext($allowed_logs[$logfile]["name"]) . ' ' . gettext('Log'), 'manage-log-panel', COLLAPSIBLE|$panel_body_state);
+
+ $section->addInput(new Form_StaticText(
+ '',
+ 'These settings override the "General Logging Options" settings.'
+ ));
+
+
+ // Common to All Logs
+ $group = new Form_Group('Forward/Reverse Display');
+
+ $group->add(new Form_Checkbox(
+ 'cronorder',
+ null,
+ 'Forward',
+ ($pconfig['cronorder'] == 'forward') ? true : false,
+ 'forward'
+ ))->displayAsRadio()->setHelp('(newest at bottom)');
+
+ $group->add(new Form_Checkbox(
+ 'cronorder',
+ null,
+ 'Reverse',
+ ($pconfig['cronorder'] == 'reverse') ? true : false,
+ 'reverse'
+ ))->displayAsRadio()->setHelp('(newest at top)');
+
+ $group->add(new Form_Checkbox(
+ 'cronorder',
+ null,
+ 'General Logging Options Setting',
+ ($pconfig['cronorder'] == '') ? true : false,
+ ''
+ ))->displayAsRadio();
+
+ $group->setHelp('Show log entries in forward or reverse order.');
+ $section->add($group);
+
+ $group = new Form_Group('GUI Log Entries');
+
+ // Use the general logging options setting (global) as placeholder.
+ $group->add(new Form_Input(
+ 'nentries',
+ 'GUI Log Entries',
+ 'number',
+ $pconfig['nentries'],
+ ['min' => 5, 'max' => 2000, 'placeholder' => $config['syslog']['nentries'] ? $config['syslog']['nentries'] : "50"]
+ ))->setWidth(2);
+
+ $group->setHelp('This is the number of log entries displayed in the GUI. It does not affect how many entries are contained in the log.');
+ $section->add($group);
+
+ $group = new Form_Group('Log file size (Bytes)');
+
+ // Use the general logging options setting (global) as placeholder.
+ $group->add(new Form_Input(
+ 'logfilesize',
+ 'Log file size (Bytes)',
+ 'number',
+ $pconfig['logfilesize'],
+ ['min' => 100000, 'placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"]
+ ))->setWidth(2);
+ $group->setHelp("The log is held in a constant-size circular log file. This field controls how large the log file is, and thus how many entries may exist inside the log. The default is approximately 500KB." .
+ '<br /><br />' .
+ "NOTE: The log size is changed the next time it is cleared. To immediately change the log size, first save the options to set the size, then clear the log using the \"Clear Log\" action below. ");
+ $section->add($group);
+
+ $group = new Form_Group('Formatted/Raw Display');
+
+ $group->add(new Form_Checkbox(
+ 'format',
+ null,
+ 'Formatted',
+ ($pconfig['format'] == 'formatted') ? true : false,
+ 'formatted'
+ ))->displayAsRadio();
+
+ $group->add(new Form_Checkbox(
+ 'format',
+ null,
+ 'Raw',
+ ($pconfig['format'] == 'raw') ? true : false,
+ 'raw'
+ ))->displayAsRadio();
+
+ $group->add(new Form_Checkbox(
+ 'format',
+ null,
+ 'General Logging Options Setting',
+ ($pconfig['format'] == '') ? true : false,
+ ''
+ ))->displayAsRadio();
+
+ $group->setHelp('Show the log entries as formatted or raw output as generated by the service. The raw output will reveal more detailed information, but it is more difficult to read.');
+ $section->add($group);
+
+
+ // Specific to System General (main) Log
+ if ($logfile == 'system') {
+ $section->addInput(new Form_Checkbox(
+ 'lognginx',
+ 'Web Server Log',
+ 'Log errors from the web server process',
+ $pconfig['lognginx']
+ ))->setHelp('If this is checked, errors from the nginx web server process for the GUI or Captive Portal will appear in the system log.');
+ }
+
+
+ // Specific to Firewall Log
+ if ($logfile == 'filter') {
+ $section->addInput(new Form_Checkbox(
+ 'logdefaultblock',
+ 'Log firewall default blocks',
+ 'Log packets matched from the default block rules in the ruleset',
+ $pconfig['logdefaultblock']
+ ))->setHelp('Packets that are blocked by the implicit default block rule will not be logged if this option is unchecked. Per-rule logging options are still respected.');
+
+ $section->addInput(new Form_Checkbox(
+ 'logdefaultpass',
+ null,
+ 'Log packets matched from the default pass rules put in the ruleset',
+ $pconfig['logdefaultpass']
+ ))->setHelp('Packets that are allowed by the implicit default pass rule will be logged if this option is checked. Per-rule logging options are still respected. ');
+
+ $section->addInput(new Form_Checkbox(
+ 'logbogons',
+ null,
+ 'Log packets blocked by \'Block Bogon Networks\' rules',
+ $pconfig['logbogons']
+ ));
+
+ $section->addInput(new Form_Checkbox(
+ 'logprivatenets',
+ null,
+ 'Log packets blocked by \'Block Private Networks\' rules',
+ $pconfig['logprivatenets']
+ ));
+
+ $section->addInput(new Form_Select(
+ 'filterdescriptions',
+ 'Where to show rule descriptions',
+ !isset($pconfig['filterdescriptions']) ? '0':$pconfig['filterdescriptions'],
+ array(
+ '0' => gettext('Dont load descriptions'),
+ '1' => gettext('Display as column'),
+ '2' => gettext('Display as second row')
+ )
+ ))->setHelp('Show the applied rule description below or in the firewall log rows' . '<br />' .
+ 'Displaying rule descriptions for all lines in the log might affect performance with large rule sets');
+ }
+
+
+ // Common to All Logs
+ $group = new Form_Group('Action');
+
+ $btnsavesettings = new Form_Button(
+ 'save_settings',
+ ' ' . gettext('Save'),
+ null,
+ 'fa-save'
+ );
+
+ $btnsavesettings->addClass('btn-sm btn-primary');
+
+ $group->add(new Form_StaticText(
+ '',
+ $btnsavesettings
+ ))->setHelp('Saves changed settings.');
+
+
+ $btnclear = new Form_Button(
+ 'clear',
+ ' ' . gettext('Clear log'),
+ null,
+ 'fa-trash'
+ );
+
+ $btnclear->removeClass('btn-primary')->addClass('btn-sm btn-danger');
+
+ $group->add(new Form_StaticText(
+ '',
+ $btnclear
+ ))->setHelp('Clears local log file and reinitializes it as an empty log. Save any settings changes first.');
+
+ $section->add($group);
+
+ $form->add($section);
+ print $form;
+}
+?>
diff --git a/src/usr/local/www/status_logs_filter.php b/src/usr/local/www/status_logs_filter.php
index 132c76b..e1883d3 100644
--- a/src/usr/local/www/status_logs_filter.php
+++ b/src/usr/local/www/status_logs_filter.php
@@ -63,9 +63,9 @@
##|*MATCH=status_logs_filter.php*
##|-PRIV
-require("guiconfig.inc");
+require_once("status_logs_common.inc");
require_once("ipsec.inc");
-require_once("filter_log.inc");
+
# --- AJAX RESOLVE ---
if (isset($_POST['resolve'])) {
@@ -82,6 +82,7 @@ if (isset($_POST['resolve'])) {
exit;
}
+
/*
Build a list of allowed log files so we can reject others to prevent the page
from acting on unauthorized files.
@@ -94,26 +95,20 @@ $allowed_logs = array(
// The logs to display are specified in a GET argument. Default to 'system' logs
if (!$_GET['logfile']) {
$logfile = 'filter';
+ $view = 'normal';
} else {
$logfile = $_GET['logfile'];
+ $view = $_GET['view'];
if (!array_key_exists($logfile, $allowed_logs)) {
/* Do not let someone attempt to load an unauthorized log. */
$logfile = 'filter';
+ $view = 'normal';
}
}
-$filter_logfile = "{$g['varlog_path']}/" . basename($logfile) . ".log";
-
-function getGETPOSTsettingvalue($settingname, $default) {
- $settingvalue = $default;
- if ($_GET[$settingname]) {
- $settingvalue = $_GET[$settingname];
- }
- if ($_POST[$settingname]) {
- $settingvalue = $_POST[$settingname];
- }
- return $settingvalue;
-}
+if ($view == 'normal') { $view_title = gettext("Normal View"); }
+if ($view == 'dynamic') { $view_title = gettext("Dynamic View"); }
+if ($view == 'summary') { $view_title = gettext("Summary View"); }
$rulenum = getGETPOSTsettingvalue('getrulenum', null);
@@ -124,442 +119,41 @@ if ($rulenum) {
exit;
}
-$filtersubmit = getGETPOSTsettingvalue('filtersubmit', null);
-
-if ($filtersubmit) {
- $filter_active = true;
- $interfacefilter = getGETPOSTsettingvalue('interface', null);
- $filtertext = getGETPOSTsettingvalue('filtertext', "");
- $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
-}
-
-$filterlogentries_submit = getGETPOSTsettingvalue('filterlogentries_submit', null);
-
-if ($filterlogentries_submit) {
- $filter_active = true;
- $filterfieldsarray = array();
-
- $actpass = getGETPOSTsettingvalue('actpass', null);
- $actblock = getGETPOSTsettingvalue('actblock', null);
- $filterfieldsarray['act'] = str_replace(" ", " ", trim($actpass . " " . $actblock));
- $filterfieldsarray['act'] = $filterfieldsarray['act'] != "" ? $filterfieldsarray['act'] : 'All';
- $filterfieldsarray['time'] = getGETPOSTsettingvalue('filterlogentries_time', null);
- $filterfieldsarray['interface'] = getGETPOSTsettingvalue('filterlogentries_interfaces', null);
- $filterfieldsarray['srcip'] = getGETPOSTsettingvalue('filterlogentries_sourceipaddress', null);
- $filterfieldsarray['srcport'] = getGETPOSTsettingvalue('filterlogentries_sourceport', null);
- $filterfieldsarray['dstip'] = getGETPOSTsettingvalue('filterlogentries_destinationipaddress', null);
- $filterfieldsarray['dstport'] = getGETPOSTsettingvalue('filterlogentries_destinationport', null);
- $filterfieldsarray['proto'] = getGETPOSTsettingvalue('filterlogentries_protocol', null);
- $filterfieldsarray['tcpflags'] = getGETPOSTsettingvalue('filterlogentries_protocolflags', null);
- $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
-}
-
-# Manage Log - Code
-
-$specific_log = basename($logfile) . '_settings';
-
-# All
-$pconfig['cronorder'] = $config['syslog'][$specific_log]['cronorder'];
-$pconfig['nentries'] = $config['syslog'][$specific_log]['nentries'];
-$pconfig['logfilesize'] = $config['syslog'][$specific_log]['logfilesize'];
-$pconfig['format'] = $config['syslog'][$specific_log]['format'];
-
-# System General (main) Specific
-$pconfig['loglighttpd'] = !isset($config['syslog']['nologlighttpd']);
-
-# Firewall Specific
-$pconfig['logdefaultblock'] = !isset($config['syslog']['nologdefaultblock']);
-$pconfig['logdefaultpass'] = isset($config['syslog']['nologdefaultpass']);
-$pconfig['logbogons'] = !isset($config['syslog']['nologbogons']);
-$pconfig['logprivatenets'] = !isset($config['syslog']['nologprivatenets']);
-$pconfig['filterdescriptions'] = $config['syslog']['filterdescriptions'];
-
-$save_settings = getGETPOSTsettingvalue('save_settings', null);
-if ($save_settings) {
+// Log Filter Submit - Firewall
+log_filter_form_firewall_submit();
- # All
- $cronorder = getGETPOSTsettingvalue('cronorder', null);
- $nentries = getGETPOSTsettingvalue('nentries', null);
- $logfilesize = getGETPOSTsettingvalue('logfilesize', null);
- $format = getGETPOSTsettingvalue('format', null);
- # System General (main) Specific
- $loglighttpd = getGETPOSTsettingvalue('loglighttpd', null);
+// Manage Log Section - Code
+manage_log_code();
- # Firewall Specific
- $logdefaultblock = getGETPOSTsettingvalue('logdefaultblock', null);
- $logdefaultpass = getGETPOSTsettingvalue('logdefaultpass', null);
- $logbogons = getGETPOSTsettingvalue('logbogons', null);
- $logprivatenets = getGETPOSTsettingvalue('logprivatenets', null);
- $filterdescriptions = getGETPOSTsettingvalue('filterdescriptions', null);
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- if (isset($nentries) && (strlen($nentries) > 0)) {
- if (!is_numeric($nentries) || ($nentries < 5) || ($nentries > 2000)) {
- $input_errors[] = gettext("Number of log entries to show must be between 5 and 2000.");
- }
- }
-
- if (isset($logfilesize) && (strlen($logfilesize) > 0)) {
- if (!is_numeric($logfilesize) || ($logfilesize < 100000)) {
- $input_errors[] = gettext("Log file size must be numeric and greater than or equal to 100000.");
- }
- }
+// Status Logs Common - Code
+status_logs_common_code();
- if (!$input_errors) {
- # Clear out the specific log settings and leave only the applied settings to override the general logging options (global) settings.
- unset($config['syslog'][$specific_log]);
-
- # All
- if ($cronorder != '') { # if not using the general logging options setting (global)
- $config['syslog'][$specific_log]['cronorder'] = $cronorder;
- }
-
- if (isset($nentries) && (strlen($nentries) > 0)) {
- $config['syslog'][$specific_log]['nentries'] = (int)$nentries;
- }
-
- if (isset($logfilesize) && (strlen($logfilesize) > 0)) {
- $config['syslog'][$specific_log]['logfilesize'] = (int)$logfilesize;
- }
-
- if ($format != '') { # if not using the general logging options setting (global)
- $config['syslog'][$specific_log]['format'] = $format;
- }
-
- # System General (main) Specific
- if ($logfile == 'system') {
- $oldnologlighttpd = isset($config['syslog']['nologlighttpd']);
- $config['syslog']['nologlighttpd'] = $loglighttpd ? false : true;
-
- if ($oldnologlighttpd !== $config['syslog']['nologlighttpd']) {
- $logging_changed = $lighttpd_logging_changed = true;
- }
- }
-
- # Firewall Specific
- if ($logfile == 'filter') {
- $oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']);
- $oldnologdefaultpass = isset($config['syslog']['nologdefaultpass']);
- $oldnologbogons = isset($config['syslog']['nologbogons']);
- $oldnologprivatenets = isset($config['syslog']['nologprivatenets']);
-
- $config['syslog']['nologdefaultblock'] = $logdefaultblock ? false : true;
- $config['syslog']['nologdefaultpass'] = $logdefaultpass ? true : false;
- $config['syslog']['nologbogons'] = $logbogons ? false : true;
- $config['syslog']['nologprivatenets'] = $logprivatenets ? false : true;
-
- if (is_numeric($filterdescriptions) && $filterdescriptions > 0) {
- $config['syslog']['filterdescriptions'] = $filterdescriptions;
- } else {
- unset($config['syslog']['filterdescriptions']);
- }
-
- if (
- ($oldnologdefaultblock !== $config['syslog']['nologdefaultblock']) ||
- ($oldnologdefaultpass !== $config['syslog']['nologdefaultpass']) ||
- ($oldnologbogons !== $config['syslog']['nologbogons']) ||
- ($oldnologprivatenets !== $config['syslog']['nologprivatenets'])) {
- $logging_changed = $firewall_logging_changed = true;
- }
- }
-
-
- // If any of the logging settings were changed then backup and sync (standard write_config). Otherwise only write config (don't backup, don't sync).
- if ($logging_changed) {
- write_config($desc = "Log Display Settings Saved: " . gettext($allowed_logs[$logfile]["name"]), $backup = true, $write_config_only = false);
- $retval = 0;
- $retval = system_syslogd_start();
- } else {
- write_config($desc = "Log Display Settings Saved (no backup, no sync): " . gettext($allowed_logs[$logfile]["name"]), $backup = false, $write_config_only = true);
- }
-
- $savemsg = gettext("The changes have been applied successfully.");
-
- # System General (main) Specific
- if ($logfile == 'system') {
- if ($lighttpd_logging_changed) {
- ob_flush();
- flush();
- log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
- send_event("service restart webgui");
- $savemsg .= "<br />" . gettext("WebGUI process is restarting.");
- }
- }
-
- # Firewall Specific
- if ($logfile == 'filter') {
- if ($firewall_logging_changed) {
- require_once("filter.inc");
- $retval |= filter_configure();
- filter_pflog_start(true);
-
- $savemsg = get_std_save_message($retval);
- }
- }
- }
-}
-
-
-# Formatted/Raw Display
-if ($config['syslog'][$specific_log]['format'] == 'formatted') {
- $rawfilter = false;
-} else if ($config['syslog'][$specific_log]['format'] == 'raw') {
- $rawfilter = true;
-} else { # Use the general logging options setting (global).
- $rawfilter = isset($config['syslog']['rawfilter']);
-}
-
-
-isset($config['syslog'][$specific_log]['nentries']) ? $nentries = $config['syslog'][$specific_log]['nentries'] : $nentries = $config['syslog']['nentries'];
-
-# Override Display Quantity
-if ($filterlogentries_qty) {
- $nentries = $filterlogentries_qty;
-}
-
-if (!$nentries || !is_numeric($nentries)) {
- $nentries = 50;
-}
-
-if ($_POST['clear']) {
- clear_log_file($filter_logfile);
-}
-
-/* Setup shortcuts if they exist */
-
-if (!empty($allowed_logs[$logfile]["shortcut"])) {
- $shortcut_section = $allowed_logs[$logfile]["shortcut"];
-}
-
-$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"]));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"]), $view_title);
include("head.inc");
if (!$input_errors && $savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
$manage_log_active = false;
}
-function build_if_list() {
- $iflist = get_configured_interface_with_descr(false, true);
- //$iflist = get_interface_list();
- // Allow extending of the firewall edit interfaces
- pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_interfaces_edit");
- foreach ($iflist as $if => $ifdesc) {
- $interfaces[$if] = $ifdesc;
- }
-
- if ($config['l2tp']['mode'] == "server") {
- $interfaces['l2tp'] = "L2TP VPN";
- }
-
- if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
- $interfaces['pppoe'] = "PPPoE Server";
- }
-
- /* add ipsec interfaces */
- if (ipsec_enabled()) {
- $interfaces["enc0"] = "IPsec";
- }
-
- /* add openvpn/tun interfaces */
- if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
- $interfaces["openvpn"] = "OpenVPN";
- }
-
- return($interfaces);
-}
-
-$Include_Act = explode(",", str_replace(" ", ",", $filterfieldsarray['act']));
-
-if ($filterfieldsarray['interface'] == "All") {
- $interface = "";
-}
-
-$tab_array = array();
-$tab_array[] = array(gettext("System"), ($logfile == 'system'), "status_logs.php");
-$tab_array[] = array(gettext("Firewall"), ($logfile == 'filter'), "status_logs_filter.php");
-$tab_array[] = array(gettext("DHCP"), ($logfile == 'dhcpd'), "status_logs.php?logfile=dhcpd");
-$tab_array[] = array(gettext("Portal Auth"), ($logfile == 'portalauth'), "status_logs.php?logfile=portalauth");
-$tab_array[] = array(gettext("IPsec"), ($logfile == 'ipsec'), "status_logs.php?logfile=ipsec");
-$tab_array[] = array(gettext("PPP"), ($logfile == 'ppp'), "status_logs.php?logfile=ppp");
-$tab_array[] = array(gettext("VPN"), false, "status_logs_vpn.php");
-$tab_array[] = array(gettext("Load Balancer"), ($logfile == 'relayd'), "status_logs.php?logfile=relayd");
-$tab_array[] = array(gettext("OpenVPN"), ($logfile == 'openvpn'), "status_logs.php?logfile=openvpn");
-$tab_array[] = array(gettext("NTP"), ($logfile == 'ntpd'), "status_logs.php?logfile=ntpd");
-$tab_array[] = array(gettext("Settings"), false, "status_logs_settings.php");
-display_top_tabs($tab_array);
-
-$tab_array = array();
-$tab_array[] = array(gettext("Normal View"), true, "/status_logs_filter.php");
-$tab_array[] = array(gettext("Dynamic View"), false, "/status_logs_filter_dynamic.php");
-$tab_array[] = array(gettext("Summary View"), false, "/status_logs_filter_summary.php");
-display_top_tabs($tab_array, false, 'nav nav-tabs');
-
-if ($filter_active) {
- $filter_state = SEC_OPEN;
-} else {
- $filter_state = SEC_CLOSED;
-}
-
-if (!$rawfilter) { // Advanced log filter form
- $form = new Form(false);
-
- $section = new Form_Section('Advanced Log Filter', 'adv-filter-panel', COLLAPSIBLE|$filter_state);
-
- $group = new Form_Group('');
-
- $group->add(new Form_Input(
- 'filterlogentries_sourceipaddress',
- null,
- 'text',
- $filterfieldsarray['srcip']
- ))->setHelp('Source IP Address');
-
- $group->add(new Form_Input(
- 'filterlogentries_destinationipaddress',
- null,
- 'text',
- $filterfieldsarray['dstip']
- ))->setHelp('Destination IP Address');
-
- $section->add($group);
- $group = new Form_Group('');
-
- $group->add(new Form_Checkbox(
- 'actpass',
- null,
- 'Pass',
- in_arrayi('Pass', $Include_Act),
- 'Pass'
- ))->setWidth(1);
-
- $group->add(new Form_Input(
- 'filterlogentries_time',
- null,
- 'text',
- $filterfieldsarray['time']
- ))->setWidth(3)->setHelp('Time');
-
- $group->add(new Form_Input(
- 'filterlogentries_sourceport',
- null,
- 'text',
- $filterfieldsarray['srcport']
- ))->setWidth(2)->setHelp('Source Port');
-
- $group->add(new Form_Input(
- 'filterlogentries_protocol',
- null,
- 'text',
- $filterfieldsarray['proto']
- ))->setWidth(2)->setHelp('Protocol');
-
- $group->add(new Form_Input(
- 'filterlogentries_qty',
- null,
- 'number',
- $filterlogentries_qty,
- ['placeholder' => $nentries]
- ))->setWidth(2)->setHelp('Quantity');
-
- $section->add($group);
-
- $group = new Form_Group('');
+// Tab Array
+tab_array_logs_common();
- $group->add(new Form_Checkbox(
- 'actblock',
- null,
- 'Block',
- in_arrayi('Block', $Include_Act),
- 'Block'
- ))->setWidth(1);
- $group->add(new Form_Input(
- 'filterlogentries_interfaces',
- null,
- 'text',
- $filterfieldsarray['interface']
- ))->setWidth(2)->setHelp('Interface');
-
- $group->add(new Form_Input(
- 'filterlogentries_destinationport',
- null,
- 'text',
- $filterfieldsarray['dstport']
- ))->setWidth(2)->setHelp('Destination Port');
-
- $group->add(new Form_Input(
- 'filterlogentries_protocolflags',
- null,
- 'text',
- $filterfieldsarray['tcpflags']
- ))->setWidth(2)->setHelp('Protocol Flags');
-
- $btnsubmit = new Form_Button(
- 'filterlogentries_submit',
- ' ' . gettext('Apply Filter'),
- null,
- 'fa-filter'
- );
-} else { // Simple log filter form
- $form = new Form(false);
-
- $section = new Form_Section('Log Filter', 'basic-filter-panel', COLLAPSIBLE|$filter_state);
-
- $group = new Form_Group('');
-
- $group->add(new Form_Select(
- 'interface',
- null,
- $interfacefilter,
- build_if_list()
- ))->setWidth(2)->setHelp('Interface');
-
- $group->add(new Form_Input(
- 'filterlogentries_qty',
- null,
- 'number',
- $filterlogentries_qty,
- ['placeholder' => $nentries]
- ))->setWidth(2)->setHelp('Quantity');
-
- $section->add($group);
-
- $group = new Form_Group('');
-
- $group->add(new Form_Input(
- 'filtertext',
- null,
- 'text',
- $filtertext
- ))->setWidth(6)->setHelp('Filter Expression');
-
- $btnsubmit = new Form_Button(
- 'filtersubmit',
- ' ' . gettext('Apply Filter'),
- null,
- 'fa-filter'
- );
+// Manage Log - Section/Form
+if ($system_logs_manage_log_form_hidden) {
+ manage_log_section();
}
-$btnsubmit->removeClass('btn-primary')->addClass('btn-success')->addClass('btn-sm');
-$group->add(new Form_StaticText(
- '',
- $btnsubmit
-));
+// Filter Section/Form - Firewall
+filter_form_firewall();
-$group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.'));
-$section->add($group);
-$form->add($section);
-print($form);
// Now the forms are complete we can draw the log table and its controls
if (!$rawfilter) {
@@ -569,24 +163,14 @@ if (!$rawfilter) {
$interfacefilter = $iflist[$interfacefilter];
}
- if ($filterlogentries_submit) {
- $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filterfieldsarray);
- } else {
- $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filtertext, $interfacefilter);
- }
+ system_log_filter();
?>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">
<?php
- if ((!$filtertext) && (!$filterfieldsarray)) {
- printf(gettext("Last %d %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
- } else {
- printf(gettext("%d matched %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
- }
-
- printf(" (" . gettext("Maximum %d") . ")", $nentries);
+ print(system_log_table_panel_title());
?>
</h2>
</div>
@@ -595,9 +179,9 @@ if (!$rawfilter) {
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
<tr class="text-nowrap">
- <th><?=gettext("Act")?></th>
+ <th><?=gettext("Action")?></th>
<th><?=gettext("Time")?></th>
- <th><?=gettext("IF")?></th>
+ <th><?=gettext("Interface")?></th>
<?php
if ($config['syslog']['filterdescriptions'] === "1") {
?>
@@ -609,7 +193,7 @@ if (!$rawfilter) {
?>
<th><?=gettext("Source")?></th>
<th><?=gettext("Destination")?></th>
- <th><?=gettext("Proto")?></th>
+ <th><?=gettext("Protocol")?></th>
</tr>
</thead>
<tbody>
@@ -635,7 +219,7 @@ if (!$rawfilter) {
$margin_left = '0.4em';
}
?>
- <i style="margin-left:<?php echo $margin_left;?>" class="fa <?php echo $icon_act;?> icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('status_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
+ <i style="margin-left:<?=$margin_left;?>" class="fa <?=$icon_act;?> icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('status_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
<?php
if ($filterent['count']) {
echo $filterent['count'];
@@ -731,7 +315,13 @@ if (!$rawfilter) {
} else {
?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title"><?=gettext("Last ")?><?=$nentries?> <?=gettext($allowed_logs[$logfile]["name"])?><?=gettext(" log entries")?></h2></div>
+ <div class="panel-heading">
+ <h2 class="panel-title">
+<?php
+ print(system_log_table_panel_title());
+?>
+ </h2>
+ </div>
<div class="table table-responsive">
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
@@ -742,14 +332,19 @@ if (!$rawfilter) {
</thead>
<tbody>
<?php
- if ($filtertext) {
- $rows = dump_clog($filter_logfile, $nentries, true, array("$filtertext"));
- } else {
- $rows = dump_clog($filter_logfile, $nentries, true, array());
- }
+ system_log_filter();
?>
</tbody>
</table>
+
+<script type="text/javascript">
+//<![CDATA[
+events.push(function() {
+ $("#count").html(<?=$rows?>);
+});
+//]]>
+</script>
+
<?php
if ($rows == 0) {
print_info_box(gettext('No logs to display'));
@@ -761,221 +356,21 @@ if (!$rawfilter) {
}
?>
-<div id="infoblock">
-
+<div class="infoblock">
<?php
-
print_info_box('<a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F">' .
gettext("TCP Flags") . '</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR' . '<br />' .
- '<i class="fa fa-minus-square-o icon-primary"></i> = Add to block list., <i class="fa fa-plus-square-o icon-primary"></i> = Pass traffic, <i class="fa fa-info icon-primary"></i> = Resolve');
-
+ '<i class="fa fa-minus-square-o icon-primary"></i> = Add to block list., <i class="fa fa-plus-square-o icon-primary"></i> = Pass traffic, <i class="fa fa-info icon-primary"></i> = Resolve', 'info', false);
?>
</div>
<?php
# Manage Log - Section/Form
-
-if ($input_errors) {
- print_input_errors($input_errors);
- $manage_log_active = true;
-}
-
-if ($manage_log_active) {
- $manage_log_state = SEC_OPEN;
-} else {
- $manage_log_state = SEC_CLOSED;
-}
-
-$form = new Form(false);
-
-$section = new Form_Section(gettext('Manage') . ' ' . gettext($allowed_logs[$logfile]["name"]) . ' ' . gettext('Log'), 'log-manager-panel', COLLAPSIBLE|$manage_log_state);
-
-$section->addInput(new Form_StaticText(
- '',
- 'These settings override the "General Logging Options" settings.'
-));
-
-
-# All
-$group = new Form_Group('Forward/Reverse Display');
-
-$group->add(new Form_Checkbox(
- 'cronorder',
- null,
- 'Forward',
- ($pconfig['cronorder'] == 'forward') ? true : false,
- 'forward'
-))->displayAsRadio()->setHelp('(newest at bottom)');
-
-$group->add(new Form_Checkbox(
- 'cronorder',
- null,
- 'Reverse',
- ($pconfig['cronorder'] == 'reverse') ? true : false,
- 'reverse'
-))->displayAsRadio()->setHelp('(newest at top)');
-
-$group->add(new Form_Checkbox(
- 'cronorder',
- null,
- 'General Logging Options Setting',
- ($pconfig['cronorder'] == '') ? true : false,
- ''
-))->displayAsRadio();
-
-$group->setHelp('Show log entries in forward or reverse order.');
-$section->add($group);
-
-$group = new Form_Group('GUI Log Entries');
-
-# Use the general logging options setting (global) as placeholder.
-$group->add(new Form_Input(
- 'nentries',
- 'GUI Log Entries',
- 'number',
- $pconfig['nentries'],
- ['min' => 5, 'max' => 2000, 'placeholder' => $config['syslog']['nentries']]
-))->setWidth(2);
-
-$group->setHelp('This is the number of log entries displayed in the GUI. It does not affect how many entries are contained in the log.');
-$section->add($group);
-
-$group = new Form_Group('Log file size (Bytes)');
-
-# Use the general logging options setting (global) as placeholder.
-$group->add(new Form_Input(
- 'logfilesize',
- 'Log file size (Bytes)',
- 'number',
- $pconfig['logfilesize'],
- ['min' => 100000, 'placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"]
-))->setWidth(2);
-$group->setHelp("The log is held in a constant-size circular log file. This field controls how large the log file is, and thus how many entries may exist inside the log. The default is approximately 500KB." .
- '<br /><br />' .
- "NOTE: The log size is changed the next time it is cleared. To immediately change the log size, first save the options to set the size, then clear the log using the \"Clear Log\" action below. ");
-$section->add($group);
-
-$group = new Form_Group('Formatted/Raw Display');
-
-$group->add(new Form_Checkbox(
- 'format',
- null,
- 'Formatted',
- ($pconfig['format'] == 'formatted') ? true : false,
- 'formatted'
-))->displayAsRadio();
-
-$group->add(new Form_Checkbox(
- 'format',
- null,
- 'Raw',
- ($pconfig['format'] == 'raw') ? true : false,
- 'raw'
-))->displayAsRadio();
-
-$group->add(new Form_Checkbox(
- 'format',
- null,
- 'General Logging Options Setting',
- ($pconfig['format'] == '') ? true : false,
- ''
-))->displayAsRadio();
-
-$group->setHelp('Show the log entries as formatted or raw output as generated by the service. The raw output will reveal more detailed information, but it is more difficult to read.');
-$section->add($group);
-
-
-# System General (main) Specific
-if ($logfile == 'system') {
- $section->addInput(new Form_Checkbox(
- 'loglighttpd',
- 'Web Server Log',
- 'Log errors from the web server process',
- $pconfig['loglighttpd']
- ))->setHelp('If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the system log.');
-}
-
-
-# Firewall Specific
-if ($logfile == 'filter') {
-$section->addInput(new Form_Checkbox(
- 'logdefaultblock',
- 'Log firewall default blocks',
- 'Log packets matched from the default block rules in the ruleset',
- $pconfig['logdefaultblock']
-))->setHelp('Packets that are blocked by the implicit default block rule will not be logged if this option is unchecked. Per-rule logging options are still respected.');
-
-$section->addInput(new Form_Checkbox(
- 'logdefaultpass',
- null,
- 'Log packets matched from the default pass rules put in the ruleset',
- $pconfig['logdefaultpass']
-))->setHelp('Packets that are allowed by the implicit default pass rule will be logged if this option is checked. Per-rule logging options are still respected. ');
-
-$section->addInput(new Form_Checkbox(
- 'logbogons',
- null,
- 'Log packets blocked by \'Block Bogon Networks\' rules',
- $pconfig['logbogons']
-));
-
-$section->addInput(new Form_Checkbox(
- 'logprivatenets',
- null,
- 'Log packets blocked by \'Block Private Networks\' rules',
- $pconfig['logprivatenets']
-));
-
-$section->addInput(new Form_Select(
- 'filterdescriptions',
- 'Where to show rule descriptions',
- !isset($pconfig['filterdescriptions']) ? '0':$pconfig['filterdescriptions'],
- array(
- '0' => 'Dont load descriptions',
- '1' => 'Display as column',
- '2' => 'Display as second row'
- )
-))->setHelp('Show the applied rule description below or in the firewall log rows' . '<br />' .
- 'Displaying rule descriptions for all lines in the log might affect performance with large rule sets');
+if (!$system_logs_manage_log_form_hidden) {
+ manage_log_section();
}
-
-
-$group = new Form_Group('Action');
-
-$btnsavesettings = new Form_Button(
- 'save_settings',
- gettext('Save'),
- null
-);
-
-$btnsavesettings->addClass('btn-sm');
-
-$group->add(new Form_StaticText(
- '',
- $btnsavesettings
-))->setHelp('Saves changed settings.');
-
-
-$btnclear = new Form_Button(
- 'clear',
- ' ' . gettext('Clear log'),
- null,
- 'fa-trash'
-);
-
-$btnclear->removeClass('btn-primary')->addClass('btn-danger')->addClass('btn-sm');
-
-$group->add(new Form_StaticText(
- '',
- $btnclear
-))->setHelp('Clears local log file and reinitializes it as an empty log. Save any settings changes first.');
-
-$section->add($group);
-$form->add($section);
-print $form;
?>
-
<!-- AJAXY STUFF -->
<script type="text/javascript">
//<![CDATA[
@@ -1004,7 +399,7 @@ function resolve_ip_callback(transport) {
var resolve_class = htmlspecialchars(response.resolve_ip.replace(/[.:]/g, '-'));
var resolve_text = '<small><br />' + htmlspecialchars(response.resolve_text) + '<\/small>';
- jQuery('span.RESOLVE-' + resolve_class).html(resolve_text);
+ $('span.RESOLVE-' + resolve_class).html(resolve_text);
}
// From http://stackoverflow.com/questions/5499078/fastest-method-to-escape-html-tags-as-html-entities
diff --git a/src/usr/local/www/status_logs_filter_dynamic.php b/src/usr/local/www/status_logs_filter_dynamic.php
index 07b8fee..08b86ec 100755
--- a/src/usr/local/www/status_logs_filter_dynamic.php
+++ b/src/usr/local/www/status_logs_filter_dynamic.php
@@ -63,27 +63,84 @@
##|*MATCH=status_logs_filter_dynamic.php*
##|-PRIV
-require("guiconfig.inc");
+
+/* AJAX related routines */
+require_once("guiconfig.inc");
require_once("filter_log.inc");
+handle_ajax();
-$filter_logfile = "{$g['varlog_path']}/filter.log";
-/* Hardcode this. AJAX doesn't do so well with large numbers */
-$nentries = 50;
+require_once("status_logs_common.inc");
-/* AJAX related routines */
-handle_ajax($nentries, $nentries + 20);
-
-if ($_POST['clear']) {
- clear_log_file($filter_logfile);
+/*
+Build a list of allowed log files so we can reject others to prevent the page
+from acting on unauthorized files.
+*/
+$allowed_logs = array(
+ "filter" => array("name" => "Firewall",
+ "shortcut" => "filter"),
+);
+
+// The logs to display are specified in a GET argument. Default to 'system' logs
+if (!$_GET['logfile']) {
+ $logfile = 'filter';
+ $view = 'normal';
+} else {
+ $logfile = $_GET['logfile'];
+ $view = $_GET['view'];
+ if (!array_key_exists($logfile, $allowed_logs)) {
+ /* Do not let someone attempt to load an unauthorized log. */
+ $logfile = 'filter';
+ $view = 'normal';
+ }
}
-$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100);
+if ($view == 'normal') { $view_title = gettext("Normal View"); }
+if ($view == 'dynamic') { $view_title = gettext("Dynamic View"); }
+if ($view == 'summary') { $view_title = gettext("Summary View"); }
+
+
+// Log Filter Submit - Firewall
+log_filter_form_firewall_submit();
-$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Firewall"), gettext("Dynamic View"));
-$shortcut_section = "firewall";
+
+// Manage Log Section - Code
+manage_log_code();
+
+
+// Status Logs Common - Code
+status_logs_common_code();
+
+
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"]), $view_title);
include("head.inc");
+if (!$input_errors && $savemsg) {
+ print_info_box($savemsg, 'success');
+ $manage_log_active = false;
+}
+
+
+// Tab Array
+tab_array_logs_common();
+
+
+// Manage Log - Section/Form
+if ($system_logs_manage_log_form_hidden) {
+ manage_log_section();
+}
+
+
+// Force the formatted mode filter and form. Raw mode is not applicable in the dynamic view.
+$rawfilter = false;
+
+
+// Log Filter Submit - Firewall
+filter_form_firewall();
+
+
+// Now the forms are complete we can draw the log table and its controls
+system_log_filter();
?>
<script type="text/javascript">
@@ -95,13 +152,27 @@ include("head.inc");
var isBusy = false;
var isPaused = false;
var nentries = <?=$nentries; ?>;
+
<?php
- if (isset($config['syslog']['reverse'])) {
- echo "var isReverse = true;\n";
- } else {
- echo "var isReverse = false;\n";
+ # Build query string.
+ if ($filterlogentries_submit) { # Formatted mode.
+ $filter_query_string = "type=formatted&filter=" . urlencode(json_encode($filterfieldsarray ));
+ }
+ if ($filtersubmit) { # Raw mode.
+ $filter_query_string = "type=raw&filter=" . urlencode(json_encode($filtertext )) . "&interfacefilter=" . $interfacefilter;
}
+
+
+ # First get the "General Logging Options" (global) chronological order setting. Then apply specific log override if set.
+ $reverse = isset($config['syslog']['reverse']);
+ $specific_log = basename($logfile, '.log') . '_settings';
+ if ($config['syslog'][$specific_log]['cronorder'] == 'forward') $reverse = false;
+ if ($config['syslog'][$specific_log]['cronorder'] == 'reverse') $reverse = true;
?>
+ var filter_query_string = "<?=$filter_query_string . '&logfile=' . $logfile_path . '&nentries=' . $nentries?>";
+
+ var isReverse = "<?=$reverse?>";
+
/* Called by the AJAX updater */
function format_log_line(row) {
if (row[8] == '6') {
@@ -183,7 +254,7 @@ function fetch_new_rules() {
return;
}
isBusy = true;
- getURL('status_logs_filter_dynamic.php?lastsawtime=' + lastsawtime, fetch_new_rules_callback);
+ getURL('status_logs_filter_dynamic.php?' + filter_query_string + '&lastsawtime=' + lastsawtime, fetch_new_rules_callback);
}
function fetch_new_rules_callback(callback_data) {
@@ -226,7 +297,7 @@ function in_arrayi(needle, haystack) {
}
function update_table_rows(data) {
- if (isPaused) {
+ if ((isPaused) || (data.length < 1)) {
return;
}
@@ -247,7 +318,7 @@ function update_table_rows(data) {
data = data.slice(startat, data.length);
- var rows = jQuery('#filter-log-entries>tr');
+ var rows = $('#filter-log-entries>tr');
// Number of rows to move by
var move = rows.length + data.length - nentries;
@@ -256,43 +327,48 @@ function update_table_rows(data) {
move = 0;
}
+ if (($("#count").text() == 0) && (data.length < nentries)){
+ move += rows.length;
+ }
+
+ var tr_classes = 'text-nowrap';
+
if (isReverse == false) {
for (var i = move; i < rows.length; i++) {
- jQuery(rows[i - move]).html(jQuery(rows[i]).html());
+ $(rows[i - move]).html($(rows[i]).html());
}
- var tbody = jQuery('#filter-log-entries');
+ var tbody = $('#filter-log-entries');
for (var i = 0; i < data.length; i++) {
var rowIndex = rows.length - move + i;
if (rowIndex < rows.length) {
- jQuery(rows[rowIndex]).html(data[i]);
+ $(rows[rowIndex]).html(data[i]);
+ $(rows[rowIndex]).className = tr_classes;
} else {
- jQuery(tbody).append('<tr>' + data[i] + '</tr>');
+ $(tbody).append('<tr class="' + tr_classes + '">' + data[i] + '</tr>');
}
}
} else {
for (var i = rows.length - 1; i >= move; i--) {
- jQuery(rows[i]).html(jQuery(rows[i - move]).html());
+ $(rows[i]).html($(rows[i - move]).html());
}
- var tbody = jQuery('#filter-log-entries');
+ var tbody = $('#filter-log-entries');
for (var i = 0; i < data.length; i++) {
var rowIndex = move - 1 - i;
if (rowIndex >= 0) {
- jQuery(rows[rowIndex]).html(data[i]);
+ $(rows[rowIndex]).html(data[i]);
+ $(rows[rowIndex]).className = tr_classes;
} else {
- jQuery(tbody).prepend('<tr>' + data[i] + '</tr>');
+ $(tbody).prepend('<tr class="' + tr_classes + '">' + data[i] + '</tr>');
}
}
}
- // Much easier to go through each of the rows once they've all be added.
- rows = jQuery('#filter-log-entries>tr');
- for (var i = 0; i < rows.length; i++) {
- rows[i].className = i % 2 == 0 ? 'listMRodd' : 'listMReven';
- }
+ var rowCount = $('#filter-log-entries>tr').length;
+ $("#count").html(rowCount);
$('.fa').tooltip();
}
@@ -325,45 +401,30 @@ function toggleListDescriptions() {
//]]>
</script>
-<?php
-$tab_array = array();
-$tab_array[] = array(gettext("System"), false, "status_logs.php");
-$tab_array[] = array(gettext("Firewall"), true, "status_logs_filter.php");
-$tab_array[] = array(gettext("DHCP"), false, "status_logs.php?logfile=dhcpd");
-$tab_array[] = array(gettext("Portal Auth"), false, "status_logs.php?logfile=portalauth");
-$tab_array[] = array(gettext("IPsec"), false, "status_logs.php?logfile=ipsec");
-$tab_array[] = array(gettext("PPP"), false, "status_logs.php?logfile=ppp");
-$tab_array[] = array(gettext("VPN"), false, "status_logs_vpn.php");
-$tab_array[] = array(gettext("Load Balancer"), false, "status_logs.php?logfile=relayd");
-$tab_array[] = array(gettext("OpenVPN"), false, "status_logs.php?logfile=openvpn");
-$tab_array[] = array(gettext("NTP"), false, "status_logs.php?logfile=ntpd");
-$tab_array[] = array(gettext("Settings"), false, "status_logs_settings.php");
-display_top_tabs($tab_array);
-
-$tab_array = array();
-$tab_array[] = array(gettext("Normal View"), false, "/status_logs_filter.php");
-$tab_array[] = array(gettext("Dynamic View"), true, "/status_logs_filter_dynamic.php");
-$tab_array[] = array(gettext("Summary View"), false, "/status_logs_filter_summary.php");
-display_top_tabs($tab_array, false, 'nav nav-tabs');
-?>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">
- <?=gettext('Last ') . $nentries . gettext(' records. ') . gettext('Pause ')?><input type="checkbox" onclick="javascript:toggle_pause();" />
+<?php
+ // Force the raw mode table panel title so that JQuery can update it dynamically.
+ $rawfilter = true;
+
+ print(system_log_table_panel_title());
+?>
+<?=" " . gettext('Pause') . " "?><input type="checkbox" onclick="javascript:toggle_pause();" />
</h2>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-hover table-condensed">
<thead>
- <tr>
- <th><?=gettext("Act")?></th>
+ <tr class="text-nowrap">
+ <th><?=gettext("Action")?></th>
<th><?=gettext("Time")?></th>
- <th><?=gettext("IF")?></th>
+ <th><?=gettext("Interface")?></th>
<th><?=gettext("Source")?></th>
<th><?=gettext("Destination")?></th>
- <th><?=gettext("Proto")?></th>
+ <th><?=gettext("Protocol")?></th>
</tr>
</thead>
<tbody id="filter-log-entries">
@@ -372,7 +433,6 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
$tcpcnt = 0;
foreach ($filterlog as $filterent) {
- $evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
$rowIndex++;
if ($filterent['version'] == '6') {
$srcIP = "[" . htmlspecialchars($filterent['srcip']) . "]";
@@ -394,7 +454,7 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
$dstPort = "";
}
?>
- <tr>
+ <tr class="text-nowrap">
<td>
<?php
if ($filterent['act'] == "block") {
@@ -403,7 +463,7 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
$icon_act = "fa-check text-success";
}
?>
- <i class="fa <?php echo $icon_act;?> icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('status_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
+ <i class="fa <?=$icon_act;?> icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('status_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
</td>
<td><?=htmlspecialchars($filterent['time'])?></td>
<td><?=htmlspecialchars($filterent['interface'])?></td>
@@ -420,16 +480,45 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
<?php
} // e-o-foreach()
?>
+<?php
+ if (count($filterlog) == 0) {
+ print '<tr class="text-nowrap"><td colspan=6>';
+ print_info_box(gettext('No logs to display'));
+ print '</td></tr>';
+ }
+?>
</tbody>
</table>
+
+<script type="text/javascript">
+//<![CDATA[
+events.push(function() {
+ $("#count").html(<?=count($filterlog);?>);
+});
+//]]>
+</script>
+
</div>
</div>
</div>
-<?php
+<?php
if ($tcpcnt > 0) {
+?>
+<div class="infoblock">
+<?php
print_info_box('<a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F">' .
- gettext("TCP Flags") . '</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR');
+ gettext("TCP Flags") . '</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR', 'info', false);
+?>
+</div>
+<?php
+}
+?>
+
+<?php
+# Manage Log - Section/Form
+if (!$system_logs_manage_log_form_hidden) {
+ manage_log_section();
}
?>
diff --git a/src/usr/local/www/status_logs_filter_summary.php b/src/usr/local/www/status_logs_filter_summary.php
index ebb4db0..efa7d15 100644
--- a/src/usr/local/www/status_logs_filter_summary.php
+++ b/src/usr/local/www/status_logs_filter_summary.php
@@ -60,14 +60,58 @@
##|*MATCH=status_logs_filter_summary.php*
##|-PRIV
-require_once("guiconfig.inc");
-include_once("filter_log.inc");
+require_once("status_logs_common.inc");
-$filter_logfile = "{$g['varlog_path']}/filter.log";
$lines = 5000;
$entriesperblock = 5;
-$filterlog = conv_log_filter($filter_logfile, $lines, $lines);
+
+/*
+Build a list of allowed log files so we can reject others to prevent the page
+from acting on unauthorized files.
+*/
+$allowed_logs = array(
+ "filter" => array("name" => "Firewall",
+ "shortcut" => "filter"),
+);
+
+// The logs to display are specified in a GET argument. Default to 'system' logs
+if (!$_GET['logfile']) {
+ $logfile = 'filter';
+ $view = 'normal';
+} else {
+ $logfile = $_GET['logfile'];
+ $view = $_GET['view'];
+ if (!array_key_exists($logfile, $allowed_logs)) {
+ /* Do not let someone attempt to load an unauthorized log. */
+ $logfile = 'filter';
+ $view = 'normal';
+ }
+}
+
+if ($view == 'normal') { $view_title = gettext("Normal View"); }
+if ($view == 'dynamic') { $view_title = gettext("Dynamic View"); }
+if ($view == 'summary') { $view_title = gettext("Summary View"); }
+
+
+// Status Logs Common - Code
+status_logs_common_code();
+
+
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"]), $view_title);
+include("head.inc");
+
+if (!$input_errors && $savemsg) {
+ print_info_box($savemsg, 'success');
+ $manage_log_active = false;
+}
+
+
+// Tab Array
+tab_array_logs_common();
+
+
+$filterlog = conv_log_filter($logfile_path, $lines, $lines);
$gotlines = count($filterlog);
$fields = array(
'act' => gettext("Actions"),
@@ -88,6 +132,61 @@ foreach (array_keys($fields) as $f) {
$totals = array();
+
+foreach ($filterlog as $fe) {
+ $specialfields = array('srcport', 'dstport');
+ foreach (array_keys($fields) as $field) {
+ if (!in_array($field, $specialfields)) {
+ $summary[$field][$fe[$field]]++;
+ }
+ }
+ /* Handle some special cases */
+ if ($fe['srcport']) {
+ $summary['srcport'][$fe['proto'].'/'.$fe['srcport']]++;
+ } else {
+ $summary['srcport'][$fe['srcport']]++;
+ }
+ if ($fe['dstport']) {
+ $summary['dstport'][$fe['proto'].'/'.$fe['dstport']]++;
+ } else {
+ $summary['dstport'][$fe['dstport']]++;
+ }
+}
+
+print("<br />");
+$infomsg = sprintf(gettext('This is a summary of the last %1$s lines of the firewall log (Max %2$s).'), $gotlines, $lines);
+?>
+<div>
+ <div class="infoblock blockopen">
+ <?=print_info_box($infomsg, 'info', false);?>
+ </div>
+</div>
+
+<script src="d3pie/d3pie.min.js"></script>
+<script src="d3pie/d3.min.js"></script>
+
+<?php
+
+$chartnum=0;
+foreach (array_keys($fields) as $field) {
+?>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=$fields[$field]?></h2></div>
+ <div class="panel-body">
+ <div id="pieChart<?=$chartnum?>" class="text-center">
+<?php
+ pie_block($summary, $field , $entriesperblock, $chartnum);
+ stat_block($summary, $field , $entriesperblock);
+ $chartnum++;
+?>
+ </div>
+ </div>
+</div>
+<?php
+}
+?>
+
+<?php
function cmp($a, $b) {
if ($a == $b) {
return 0;
@@ -110,7 +209,7 @@ function stat_block($summary, $stat, $num) {
$numentries++;
$outstr = $k[$i];
if (is_ipaddr($outstr)) {
- print('<tr><td>' . $outstr . '</td>' . '<td>' . $summary[$stat][$k[$i]] . '</td><td><a href="diag_dns.php?host=' . $outstr . '" class="btn btn-xs btn-success" title="' . gettext("Reverse Resolve with DNS") . '">Lookup</a></td></tr>');
+ print('<tr><td>' . $outstr . '</td>' . '<td>' . $summary[$stat][$k[$i]] . '</td><td><a href="diag_dns.php?host=' . $outstr . '" class="btn btn-xs btn-success" title="' . gettext("Reverse Resolve with DNS") . '">' . gettext("Lookup") . '</a></td></tr>');
} elseif (substr_count($outstr, '/') == 1) {
list($proto, $port) = explode('/', $outstr);
@@ -132,7 +231,9 @@ function stat_block($summary, $stat, $num) {
print "</table>";
print('</div>');
}
+?>
+<?php
// Create the JSON document for the chart to be displayed
// Todo: Be good to investigate building this with json_encode and friends some time
function pie_block($summary, $stat, $num, $chartnum) {
@@ -248,77 +349,8 @@ var pie = new d3pie("pieChart<?=$chartnum?>", {
</script>
<?php
}
-
-foreach ($filterlog as $fe) {
- $specialfields = array('srcport', 'dstport');
- foreach (array_keys($fields) as $field) {
- if (!in_array($field, $specialfields)) {
- $summary[$field][$fe[$field]]++;
- }
- }
- /* Handle some special cases */
- if ($fe['srcport']) {
- $summary['srcport'][$fe['proto'].'/'.$fe['srcport']]++;
- } else {
- $summary['srcport'][$fe['srcport']]++;
- }
- if ($fe['dstport']) {
- $summary['dstport'][$fe['proto'].'/'.$fe['dstport']]++;
- } else {
- $summary['dstport'][$fe['dstport']]++;
- }
-}
-
-$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Firewall"), gettext("Summary View"));
-$shortcut_section = "firewall";
-include("head.inc");
-
-$tab_array = array();
-$tab_array[] = array(gettext("System"), false, "status_logs.php");
-$tab_array[] = array(gettext("Firewall"), true, "status_logs_filter.php");
-$tab_array[] = array(gettext("DHCP"), false, "status_logs.php?logfile=dhcpd");
-$tab_array[] = array(gettext("Portal Auth"), false, "status_logs.php?logfile=portalauth");
-$tab_array[] = array(gettext("IPsec"), false, "status_logs.php?logfile=ipsec");
-$tab_array[] = array(gettext("PPP"), false, "status_logs.php?logfile=ppp");
-$tab_array[] = array(gettext("VPN"), false, "status_logs_vpn.php");
-$tab_array[] = array(gettext("Load Balancer"), false, "status_logs.php?logfile=relayd");
-$tab_array[] = array(gettext("OpenVPN"), false, "status_logs.php?logfile=openvpn");
-$tab_array[] = array(gettext("NTP"), false, "status_logs.php?logfile=ntpd");
-$tab_array[] = array(gettext("Settings"), false, "status_logs_settings.php");
-display_top_tabs($tab_array);
-
-$tab_array = array();
-$tab_array[] = array(gettext("Normal View"), false, "/status_logs_filter.php");
-$tab_array[] = array(gettext("Dynamic View"), false, "/status_logs_filter_dynamic.php");
-$tab_array[] = array(gettext("Summary View"), true, "/status_logs_filter_summary.php");
-display_top_tabs($tab_array, false, 'nav nav-tabs');
-
-print("<br />");
-$infomsg = sprintf('This is a summary of the last %1$s lines of the firewall log (Max %2$s).', $gotlines, $lines);
-print_info_box($infomsg, info);
?>
-<script src="d3pie/d3pie.min.js"></script>
-<script src="d3pie/d3.min.js"></script>
-
<?php
-
-$chartnum=0;
-foreach (array_keys($fields) as $field) {
-?>
-<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title"><?=$fields[$field]?></h2></div>
- <div class="panel-body">
- <div id="pieChart<?=$chartnum?>" align="center">
-<?php
- pie_block($summary, $field , $entriesperblock, $chartnum);
- stat_block($summary, $field , $entriesperblock);
- $chartnum++;
-?>
- </div>
- </div>
-</div>
-<?php
-}
-
include("foot.inc");
+?>
diff --git a/src/usr/local/www/status_logs_settings.php b/src/usr/local/www/status_logs_settings.php
index 8fa193a..587b281 100644
--- a/src/usr/local/www/status_logs_settings.php
+++ b/src/usr/local/www/status_logs_settings.php
@@ -89,7 +89,7 @@ $pconfig['logdefaultblock'] = !isset($config['syslog']['nologdefaultblock']);
$pconfig['logdefaultpass'] = isset($config['syslog']['nologdefaultpass']);
$pconfig['logbogons'] = !isset($config['syslog']['nologbogons']);
$pconfig['logprivatenets'] = !isset($config['syslog']['nologprivatenets']);
-$pconfig['loglighttpd'] = !isset($config['syslog']['nologlighttpd']);
+$pconfig['lognginx'] = !isset($config['syslog']['nolognginx']);
$pconfig['rawfilter'] = isset($config['syslog']['rawfilter']);
$pconfig['filterdescriptions'] = $config['syslog']['filterdescriptions'];
$pconfig['disablelocallogging'] = isset($config['syslog']['disablelocallogging']);
@@ -163,12 +163,12 @@ if ($_POST['resetlogs'] == gettext("Reset Log Files")) {
$oldnologdefaultpass = isset($config['syslog']['nologdefaultpass']);
$oldnologbogons = isset($config['syslog']['nologbogons']);
$oldnologprivatenets = isset($config['syslog']['nologprivatenets']);
- $oldnologlighttpd = isset($config['syslog']['nologlighttpd']);
+ $oldnolognginx = isset($config['syslog']['nolognginx']);
$config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true;
$config['syslog']['nologdefaultpass'] = $_POST['logdefaultpass'] ? true : false;
$config['syslog']['nologbogons'] = $_POST['logbogons'] ? false : true;
$config['syslog']['nologprivatenets'] = $_POST['logprivatenets'] ? false : true;
- $config['syslog']['nologlighttpd'] = $_POST['loglighttpd'] ? false : true;
+ $config['syslog']['nolognginx'] = $_POST['lognginx'] ? false : true;
$config['syslog']['rawfilter'] = $_POST['rawfilter'] ? true : false;
if (is_numeric($_POST['filterdescriptions']) && $_POST['filterdescriptions'] > 0) {
$config['syslog']['filterdescriptions'] = $_POST['filterdescriptions'];
@@ -194,7 +194,7 @@ if ($_POST['resetlogs'] == gettext("Reset Log Files")) {
$savemsg = get_std_save_message($retval);
- if ($oldnologlighttpd !== isset($config['syslog']['nologlighttpd'])) {
+ if ($oldnolognginx !== isset($config['syslog']['nolognginx'])) {
ob_flush();
flush();
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
@@ -220,10 +220,13 @@ $remoteloghelp = gettext("This option will allow the logging daemon to bind to a
gettext("If you pick a single IP, remote syslog servers must all be of that IP type. If you wish to mix IPv4 and IPv6 remote syslog servers, you must bind to all interfaces.") .
"<br /><br />" .
gettext("NOTE: If an IP address cannot be located on the chosen interface, the daemon will bind to all addresses.");
+
if ($input_errors) {
print_input_errors($input_errors);
-} else if ($savemsg) {
- print_info_box($savemsg);
+}
+
+if ($savemsg) {
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
@@ -299,11 +302,11 @@ $section->addInput(new Form_Checkbox(
));
$section->addInput(new Form_Checkbox(
- 'loglighttpd',
+ 'lognginx',
'Web Server Log',
'Log errors from the web server process',
- $pconfig['loglighttpd']
-))->setHelp('If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the main system log');
+ $pconfig['lognginx']
+))->setHelp('If this is checked, errors from the web server process for the GUI or Captive Portal will appear in the main system log');
$section->addInput(new Form_Checkbox(
'rawfilter',
@@ -317,9 +320,9 @@ $section->addInput(new Form_Select(
'Where to show rule descriptions',
!isset($pconfig['filterdescriptions']) ? '0':$pconfig['filterdescriptions'],
array(
- '0' => 'Dont load descriptions',
- '1' => 'Display as column',
- '2' => 'Display as second row'
+ '0' => gettext('Dont load descriptions'),
+ '1' => gettext('Display as column'),
+ '2' => gettext('Display as second row')
)
))->setHelp('Show the applied rule description below or in the firewall log rows' . '<br />' .
'Displaying rule descriptions for all lines in the log might affect performance with large rule sets');
diff --git a/src/usr/local/www/status_logs_vpn.php b/src/usr/local/www/status_logs_vpn.php
index a1335e7..30d4e7b 100644
--- a/src/usr/local/www/status_logs_vpn.php
+++ b/src/usr/local/www/status_logs_vpn.php
@@ -1,4 +1,3 @@
-#!/usr/local/bin/php
<?php
/*
status_logs_vpn.php
@@ -65,52 +64,238 @@
##|-PRIV
-$vpns = array('poes' => 'PPPoE', 'l2tp' => 'L2TP');
-
-$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("VPN"));
-require("guiconfig.inc");
+require_once("status_logs_common.inc");
require_once("vpn.inc");
-$nentries = $config['syslog']['nentries'];
-if (!$nentries) {
- $nentries = 50;
-}
+/*
+Build a list of allowed log files so we can reject others to prevent the page
+from acting on unauthorized files.
+*/
+$allowed_logs = array(
+ "vpn" => array("name" => gettext("VPN Logins"),
+ "shortcut" => "poes"),
+ "poes" => array("name" => gettext("PPPoE Service"),
+ "shortcut" => "pppoes"),
+ "l2tps" => array("name" => gettext("L2TP Service"),
+ "shortcut" => "l2tps"),
+);
-if (htmlspecialchars($_POST['vpntype'])) {
- $vpntype = htmlspecialchars($_POST['vpntype']);
-} elseif (htmlspecialchars($_GET['vpntype'])) {
- $vpntype = htmlspecialchars($_GET['vpntype']);
-} else {
+// The logs to display are specified in a GET argument. Default to 'system' logs
+if (!$_GET['logfile']) {
+ $logfile = 'vpn';
$vpntype = "poes";
-}
-if (htmlspecialchars($_POST['mode'])) {
- $mode = htmlspecialchars($_POST['mode']);
-} elseif (htmlspecialchars($_GET['mode'])) {
- $mode = htmlspecialchars($_GET['mode']);
} else {
- $mode = "login";
+ $logfile = $_GET['logfile'];
+ $vpntype = $_GET['vpntype'];
+ if (!array_key_exists($logfile, $allowed_logs)) {
+ /* Do not let someone attempt to load an unauthorized log. */
+ $logfile = 'vpn';
+ $vpntype = "poes";
+ }
+}
+
+if ($vpntype == 'poes') { $allowed_logs['vpn']['name'] = gettext("PPPoE Logins"); }
+if ($vpntype == 'l2tp') { $allowed_logs['vpn']['name'] = gettext("L2TP Logins"); }
+
+
+// Log Filter Submit - VPN
+log_filter_form_vpn_submit();
+
+
+// Manage Log Section - Code
+manage_log_code();
+
+
+// Status Logs Common - Code
+status_logs_common_code();
+
+
+if ($filtertext) {
+ $filtertextmeta="?filtertext=$filtertext";
}
-switch ($vpntype) {
- case 'poes':
- $logname = "poes";
- break;
- case 'l2tp':
- $logname = "l2tps";
- break;
+
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("VPN"), gettext($allowed_logs[$logfile]["name"]));
+include("head.inc");
+
+if (!$input_errors && $savemsg) {
+ print_info_box($savemsg, 'success');
+ $manage_log_active = false;
}
-if ($_POST['clear']) {
- if ($mode != "raw") {
- clear_log_file("/var/log/vpn.log");
+
+// Tab Array
+tab_array_logs_common();
+
+
+// Manage Log - Section/Form
+if ($system_logs_manage_log_form_hidden) {
+ manage_log_section();
+}
+
+
+// Filter Section/Form - VPN
+filter_form_vpn();
+
+
+// Now the forms are complete we can draw the log table and its controls
+if (!$rawfilter) {
+ system_log_filter();
+
+ // Remove those not of the selected vpn type (poes / l2tp).
+ if ($logfile == "vpn") {
+ foreach ($filterlog as $key => $filterent) {
+ if (!preg_match('/' . $vpntype . '/', $filterent['type'])) {
+ unset($filterlog[$key]);
+ }
+ }
+ }
+?>
+
+<div class="panel panel-default">
+ <div class="panel-heading">
+ <h2 class="panel-title">
+<?php
+ print(system_log_table_panel_title());
+?>
+ </h2>
+ </div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
+<?php
+ if ($logfile == "vpn") {
+?>
+ <thead>
+ <tr class="text-nowrap">
+ <th><?=gettext("Time")?></th>
+ <th><?=gettext("Action")?></th>
+ <th><?=gettext("User")?></th>
+ <th><?=gettext("IP Address")?></th>
+ </tr>
+ </thead>
+ <tbody>
+<?php
+ foreach ($filterlog as $filterent) {
+?>
+ <tr class="text-nowrap">
+ <td>
+ <?=htmlspecialchars($filterent['time'])?>
+ </td>
+ <td style="word-wrap:break-word; word-break:break-all; white-space:normal">
+ <?php if ($filterent['action'] == "login") { ?>
+ <i class="fa fa-arrow-left" title="in"></i>
+ <?php } else if ($filterent['action'] == "logout") { ?>
+ <i class="fa fa-arrow-right" title="out"></i>
+ <?php } else { ?>
+ <i><?=htmlspecialchars($filterent['action'])?></i>
+ <?php } ?>
+ </td>
+ <td>
+ <?=htmlspecialchars($filterent['user'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($filterent['ip_address'])?>
+ </td>
+ </tr>
+<?php
+ } // e-o-foreach
+?>
+ </tbody>
+<?php
} else {
- clear_log_file("/var/log/{$logname}.log");
+?>
+ <thead>
+ <tr class="text-nowrap">
+ <th><?=gettext("Time")?></th>
+ <th><?=gettext("Type")?></th>
+ <th><?=gettext("PID")?></th>
+ <th style="width:100%"><?=gettext("Log Message")?></th>
+ </tr>
+ </thead>
+ <tbody>
+<?php
+ foreach ($filterlog as $filterent) {
+?>
+ <tr class="text-nowrap">
+ <td>
+ <?=htmlspecialchars($filterent['time'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($filterent['type'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($filterent['pid'])?>
+ </td>
+ <td style="word-wrap:break-word; word-break:break-all; white-space:normal">
+ <?=htmlspecialchars($filterent['message'])?>
+ </td>
+ </tr>
+<?php
+ } // e-o-foreach
+?>
+ </tbody>
+<?php
+ }
+?>
+ </table>
+<?php
+ if (count($filterlog) == 0) {
+ print_info_box(gettext('No logs to display'));
+ }
+?>
+ </div>
+ </div>
+</div>
+<?php
+} else {
+?>
+<div class="panel panel-default">
+ <div class="panel-heading">
+ <h2 class="panel-title">
+<?php
+ print(system_log_table_panel_title());
+?>
+ </h2>
+ </div>
+ <div class="panel-body">
+ <pre><?php
+ $rows = dump_clog_no_table($logfile_path, $nentries, true, array($filtertext));
+ ?></pre>
+
+<script type="text/javascript">
+//<![CDATA[
+events.push(function() {
+ $("#count").html(<?=$rows?>);
+});
+//]]>
+</script>
+
+<?php
+ if ($rows == 0) {
+ print_info_box(gettext('No logs to display'));
}
+?>
+ </div>
+</div>
+<?php
+}
+?>
+
+<?php
+# Manage Log - Section/Form
+if (!$system_logs_manage_log_form_hidden) {
+ manage_log_section();
}
+?>
+<?php
function dump_clog_vpn($logfile, $tail) {
global $g, $config, $vpntype;
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
+ $specific_log = basename($logfile, '.log') . '_settings';
+ if ($config['syslog'][$specific_log]['cronorder'] == 'forward') $sor = "";
+ if ($config['syslog'][$specific_log]['cronorder'] == 'reverse') $sor = "-r";
$logarr = "";
@@ -118,6 +303,7 @@ function dump_clog_vpn($logfile, $tail) {
$rows = 0;
foreach ($logarr as $logent) {
+ $rows++;
$logent = preg_split("/\s+/", $logent, 6);
$llent = explode(",", $logent[5]);
$iftype = substr($llent[1], 0, 4);
@@ -139,88 +325,204 @@ function dump_clog_vpn($logfile, $tail) {
}
return($rows);
}
-
-include("head.inc");
-
-$tab_array = array();
-$tab_array[] = array(gettext("System"), false, "status_logs.php");
-$tab_array[] = array(gettext("Firewall"), false, "status_logs_filter.php");
-$tab_array[] = array(gettext("DHCP"), false, "status_logs.php?logfile=dhcpd");
-$tab_array[] = array(gettext("Portal Auth"), false, "status_logs.php?logfile=portalauth");
-$tab_array[] = array(gettext("IPsec"), false, "status_logs.php?logfile=ipsec");
-$tab_array[] = array(gettext("PPP"), false, "status_logs.php?logfile=ppp");
-$tab_array[] = array(gettext("VPN"), true, "status_logs_vpn.php");
-$tab_array[] = array(gettext("Load Balancer"), false, "status_logs.php?logfile=relayd");
-$tab_array[] = array(gettext("OpenVPN"), false, "status_logs.php?logfile=openvpn");
-$tab_array[] = array(gettext("NTP"), false, "status_logs.php?logfile=ntpd");
-$tab_array[] = array(gettext("Settings"), false, "status_logs_settings.php");
-display_top_tabs($tab_array);
-
-$tab_array = array();
-$tab_array[] = array(gettext("PPPoE Logins"),
- (($vpntype == "poes") && ($mode != "raw")),
- "/status_logs_vpn.php?vpntype=poes");
-$tab_array[] = array(gettext("PPPoE Raw"),
- (($vpntype == "poes") && ($mode == "raw")),
- "/status_logs_vpn.php?vpntype=poes&amp;mode=raw");
-$tab_array[] = array(gettext("L2TP Logins"),
- (($vpntype == "l2tp") && ($mode != "raw")),
- "/status_logs_vpn.php?vpntype=l2tp");
-$tab_array[] = array(gettext("L2TP Raw"),
- (($vpntype == "l2tp") && ($mode == "raw")),
- "/status_logs_vpn.php?vpntype=l2tp&amp;mode=raw");
-display_top_tabs($tab_array, false, 'nav nav-tabs');
-?>
-
-<!-- Raw logs are displayed as preformatted text. vpn logs are displayed as a table-->
-<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title"><?=gettext("Last ")?><?=$nentries?> <?=$vpns[$vpntype]?><?=gettext(" log entries")?></h2></div>
- <div class="panel-body">
-<?php
- if ($mode != "raw") {
?>
- <div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Time")?></th>
- <th><?=gettext("Action")?></th>
- <th><?=gettext("User")?></th>
- <th><?=gettext("IP address")?></th>
- </tr>
- </thead>
- <tbody>
-<?php
- $rows = dump_clog_vpn("/var/log/vpn.log", $nentries); // dump_clog_vpn provides all the need <td></td>/<tr></tr> tags
-?>
- </tbody>
- </table>
+
<?php
- if ($rows == 0) {
- print_info_box('No logs to display');
- }
+// Log Filter Submit - VPN
+function log_filter_form_vpn_submit() {
+
+ global $filtersubmit, $interfacefilter, $filtertext;
+ global $filterlogentries_submit, $filterfieldsarray, $actpass, $actblock;
+ global $filter_active, $filterlogentries_qty;
+
+ $filtersubmit = getGETPOSTsettingvalue('filtersubmit', null);
+
+ if ($filtersubmit) {
+ $filter_active = true;
+ $filtertext = getGETPOSTsettingvalue('filtertext', "");
+ $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
+ }
+
+ $filterlogentries_submit = getGETPOSTsettingvalue('filterlogentries_submit', null);
+
+ if ($filterlogentries_submit) {
+ $filter_active = true;
+ $filterfieldsarray = array();
+
+ $filterfieldsarray['time'] = getGETPOSTsettingvalue('filterlogentries_time', null);
+ $filterfieldsarray['type'] = getGETPOSTsettingvalue('filterlogentries_type', null);
+ $filterfieldsarray['pid'] = getGETPOSTsettingvalue('filterlogentries_pid', null);
+ $filterfieldsarray['message'] = getGETPOSTsettingvalue('filterlogentries_message', null);
+ $filterfieldsarray['action'] = getGETPOSTsettingvalue('filterlogentries_action', null);
+ $filterfieldsarray['user'] = getGETPOSTsettingvalue('filterlogentries_user', null);
+ $filterfieldsarray['ip_address'] = getGETPOSTsettingvalue('filterlogentries_ip_address', null);
+ $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
+ }
+}
?>
- </div>
+
<?php
+// Filter Section/Form - VPN
+function filter_form_vpn() {
+
+ global $filter_active, $rawfilter, $filterfieldsarray, $filtertext, $filterlogentries_qty, $nentries, $Include_Act, $interfacefilter;
+ global $logfile;
+ global $system_logs_filter_form_hidden;
+
+ if ($filter_active) {
+ $panel_state = 'in';
+ $panel_body_state = SEC_OPEN;
+ } else {
+ if ($system_logs_filter_form_hidden) {
+ $panel_state = 'out';
+ $panel_body_state = SEC_OPEN;
} else {
-?>
- <pre>
-<?php
- if (dump_clog_no_table("/var/log/{$logname}.log", $nentries) == 0) {
- print('No logs to display');
+ $panel_state = 'in';
+ $panel_body_state = SEC_CLOSED;
}
-?>
- </pre>
-<?php
+ }
+
+ if (!$rawfilter) { // Advanced log filter form
+ $form = new Form(false);
+ $form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
+
+ $section = new Form_Section('Advanced Log Filter', 'filter-panel', COLLAPSIBLE|$panel_body_state);
+
+ if ($logfile == "vpn") {
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_time',
+ null,
+ 'text',
+ $filterfieldsarray['time']
+ ))->setWidth(3)->setHelp('Time');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_action',
+ null,
+ 'text',
+ $filterfieldsarray['action']
+ ))->setWidth(3)->setHelp('Action');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_qty',
+ null,
+ 'number',
+ $filterlogentries_qty,
+ ['placeholder' => $nentries]
+ ))->setWidth(2)->setHelp('Quantity');
+
+ $section->add($group);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_user',
+ null,
+ 'text',
+ $filterfieldsarray['user']
+ ))->setWidth(3)->setHelp('User');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_ip_address',
+ null,
+ 'text',
+ $filterfieldsarray['ip_address']
+ ))->setWidth(4)->setHelp('IP Address');
+ } else {
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_time',
+ null,
+ 'text',
+ $filterfieldsarray['time']
+ ))->setWidth(3)->setHelp('Time');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_type',
+ null,
+ 'text',
+ $filterfieldsarray['type']
+ ))->setWidth(2)->setHelp('Type');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_pid',
+ null,
+ 'text',
+ $filterfieldsarray['pid']
+ ))->setWidth(2)->setHelp('PID');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_qty',
+ null,
+ 'number',
+ $filterlogentries_qty,
+ ['placeholder' => $nentries]
+ ))->setWidth(2)->setHelp('Quantity');
+
+ $section->add($group);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_message',
+ null,
+ 'text',
+ $filterfieldsarray['message']
+ ))->setWidth(7)->setHelp('Log Message');
+
}
+ $btnsubmit = new Form_Button(
+ 'filterlogentries_submit',
+ ' ' . gettext('Apply Filter'),
+ null,
+ 'fa-filter'
+ );
+ } else { // Simple log filter form
+ $form = new Form(false);
+ $form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
+
+ $section = new Form_Section('Log Filter', 'filter-panel', COLLAPSIBLE|$panel_body_state);
+
+ $group = new Form_Group('');
+
+ $group->add(new Form_Input(
+ 'filtertext',
+ null,
+ 'text',
+ $filtertext
+ ))->setWidth(6)->setHelp('Filter Expression');
+
+ $group->add(new Form_Input(
+ 'filterlogentries_qty',
+ null,
+ 'number',
+ $filterlogentries_qty,
+ ['placeholder' => $nentries]
+ ))->setWidth(2)->setHelp('Quantity');
+
+ $btnsubmit = new Form_Button(
+ 'filtersubmit',
+ ' ' . gettext('Apply Filter'),
+ null,
+ 'fa-filter'
+ );
+ }
+
+ $btnsubmit->removeClass('btn-primary')->addClass('btn-success')->addClass('btn-sm');
+
+ $group->add(new Form_StaticText(
+ '',
+ $btnsubmit
+ ));
+
+ $group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.'));
+ $section->add($group);
+ $form->add($section);
+ print $form;
+}
?>
- <form action="status_logs_vpn.php" method="post">
- <input type="hidden" name="vpntype" id="vpntype" value="<?=$vpntype?>" />
- <input type="hidden" name="mode" id="mode" value="<?=$mode?>" />
- <input name="clear" type="submit" class="btn btn-danger" value="<?=gettext("Clear log")?>" />
- </form>
- <p>
- </p>
- </div>
-</div>
-<?php include("foot.inc");
+
+<?php include("foot.inc"); ?>
diff --git a/src/usr/local/www/status_ntpd.php b/src/usr/local/www/status_ntpd.php
index 2f07e4a..e1fe2b9 100644
--- a/src/usr/local/www/status_ntpd.php
+++ b/src/usr/local/www/status_ntpd.php
@@ -81,28 +81,28 @@ if (!isset($config['ntpd']['noquery'])) {
switch (substr($line, 0, 1)) {
case " ":
- $server['status'] = "Unreach/Pending";
+ $server['status'] = gettext("Unreach/Pending");
break;
case "*":
- $server['status'] = "Active Peer";
+ $server['status'] = gettext("Active Peer");
break;
case "+":
- $server['status'] = "Candidate";
+ $server['status'] = gettext("Candidate");
break;
case "o":
- $server['status'] = "PPS Peer";
+ $server['status'] = gettext("PPS Peer");
break;
case "#":
- $server['status'] = "Selected";
+ $server['status'] = gettext("Selected");
break;
case ".":
- $server['status'] = "Excess Peer";
+ $server['status'] = gettext("Excess Peer");
break;
case "x":
- $server['status'] = "False Ticker";
+ $server['status'] = gettext("False Ticker");
break;
case "-":
- $server['status'] = "Outlier";
+ $server['status'] = gettext("Outlier");
break;
}
@@ -190,7 +190,7 @@ include("head.inc");
?>
<div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">Network Time Protocol Status</h2></div>
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("Network Time Protocol Status");?></h2></div>
<div class="panel-body">
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
@@ -209,38 +209,45 @@ include("head.inc");
</tr>
</thead>
<tbody>
- <?php if (isset($config['ntpd']['noquery'])): ?>
+<?php
+ if (isset($config['ntpd']['noquery'])):
+?>
<tr>
<td class="warning" colspan="11">
- Statistics unavailable because ntpq and ntpdc queries are disabled in the <a href="services_ntpd.php">NTP service settings</a>.
+ <?=sprintf(gettext("Statistics unavailable because ntpq and ntpdc queries are disabled in the %sNTP service settings%s"), '<a href="services_ntpd.php">', '</a>');?>
</td>
</tr>
- <?php elseif (count($ntpq_servers) == 0): ?>
+<?php
+ elseif (count($ntpq_servers) == 0):
+?>
<tr>
<td class="warning" colspan="11">
- No peers found, <a href="status_services.php">is the ntp service running?</a>
+ <?=sprintf(gettext("No peers found, %sis the ntp service running?%s"), '<a href="status_services.php">', '</a>');?>
</td>
</tr>
- <?php else:
+<?php
+ else:
- $i = 0;
- foreach ($ntpq_servers as $server): ?>
- <tr>
- <td><?=$server['status']?></td>
- <td><?=$server['server']?></td>
- <td><?=$server['refid']?></td>
- <td><?=$server['stratum']?></td>
- <td><?=$server['type']?></td>
- <td><?=$server['when']?></td>
- <td><?=$server['poll']?></td>
- <td><?=$server['reach']?></td>
- <td><?=$server['delay']?></td>
- <td><?=$server['offset']?></td>
- <td><?=$server['jitter']?></td>
- </tr> <?php
- $i++;
- endforeach;
- endif;
+ $i = 0;
+ foreach ($ntpq_servers as $server):
+?>
+ <tr>
+ <td><?=$server['status']?></td>
+ <td><?=$server['server']?></td>
+ <td><?=$server['refid']?></td>
+ <td><?=$server['stratum']?></td>
+ <td><?=$server['type']?></td>
+ <td><?=$server['when']?></td>
+ <td><?=$server['poll']?></td>
+ <td><?=$server['reach']?></td>
+ <td><?=$server['delay']?></td>
+ <td><?=$server['offset']?></td>
+ <td><?=$server['jitter']?></td>
+ </tr>
+<?php
+ $i++;
+ endforeach;
+ endif;
?>
</tbody>
</table>
@@ -252,13 +259,14 @@ include("head.inc");
// GPS satellite information (if available)
if (($gps_ok) && ($gps_lat) && ($gps_lon)):
- $gps_goo_lnk = 2; ?>
+ $gps_goo_lnk = 2;
+?>
- <div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title">GPS information</h2></div>
- <div class="panel-body">
- <table class="table table-striped table-hover table-condensed">
- <thead>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("GPS information");?></h2></div>
+ <div class="panel-body">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
<tr>
<th>
<?=gettext("Clock Latitude"); ?>
@@ -266,61 +274,76 @@ if (($gps_ok) && ($gps_lat) && ($gps_lon)):
<th>
<?=gettext("Clock Longitude"); ?>
</th>
- <?php if (isset($gps_alt)) { ?>
- <th>
- <?=gettext("Clock Altitude")?>
- </th>
- <?php $gps_goo_lnk++;
- }
+<?php
+ if (isset($gps_alt)) {
+?>
+ <th>
+ <?=gettext("Clock Altitude")?>
+ </th>
+<?php
+ $gps_goo_lnk++;
+ }
- if (isset($gps_sat) || isset($gps_satview)) { ?>
- <th>
- <?=gettext("Satellites")?>
- </th> <?php
- $gps_goo_lnk++;
- }?>
- </tr>
- </thead>
+ if (isset($gps_sat) || isset($gps_satview)) {
+?>
+ <th>
+ <?=gettext("Satellites")?>
+ </th>
+<?php
+ $gps_goo_lnk++;
+ }
+?>
+ </tr>
+ </thead>
- <tbody>
- <tr>
- <td>
- <?=printf("%.5f", $gps_lat); ?> (<?=printf("%d", $gps_lat_deg); ?>&deg; <?=printf("%.5f", $gps_lat_min*60); ?><?=$gps_vars[4]; ?>)
- </td>
- <td>
- <?=printf("%.5f", $gps_lon); ?> (<?=printf("%d", $gps_lon_deg); ?>&deg; <?=printf("%.5f", $gps_lon_min*60); ?><?=$gps_vars[6]; ?>)
- </td>
+ <tbody>
+ <tr>
+ <td>
+ <?=printf("%.5f", $gps_lat); ?> (<?=printf("%d", $gps_lat_deg); ?>&deg; <?=printf("%.5f", $gps_lat_min*60); ?><?=$gps_vars[4]; ?>)
+ </td>
+ <td>
+ <?=printf("%.5f", $gps_lon); ?> (<?=printf("%d", $gps_lon_deg); ?>&deg; <?=printf("%.5f", $gps_lon_min*60); ?><?=$gps_vars[6]; ?>)
+ </td>
- <?php if (isset($gps_alt)) { ?>
- <td>
- <?=$gps_alt . ' ' . $gps_alt_unit?>
- </td>
- }
+<?php
+ if (isset($gps_alt)) {
+?>
+ <td>
+ <?=$gps_alt . ' ' . $gps_alt_unit?>
+ </td>
+<?php
+ }
- if (isset($gps_sat) || isset($gps_satview)) { ?>
- <td align="center"> <?php
- if (isset($gps_satview)) {
- print('in view ' . intval($gps_satview));
- }
+ if (isset($gps_sat) || isset($gps_satview)) {
+?>
+ <td class="text-center">
+<?php
+ if (isset($gps_satview)) {
+ print(gettext('in view ') . intval($gps_satview));
+ }
- if (isset($gps_sat) && isset($gps_satview)) {
- print(', ');
- }
- if (isset($gps_sat)) {
- print('in use ' . $gps_sat);
- } ?>
- </td> <?php
- }
- ?>
- </tr>
- <tr>
- <td colspan="<?=$gps_goo_lnk; ?>"><a target="_gmaps" href="http://maps.google.com/?q=<?=$gps_lat; ?>,<?=$gps_lon; ?>">Google Maps Link</a></td>
- </tr>
- </tbody>
- </table>
- </div>
+ if (isset($gps_sat) && isset($gps_satview)) {
+ print(', ');
+ }
+ if (isset($gps_sat)) {
+ print(gettext('in use ') . $gps_sat);
+ }
+?>
+ </td>
+<?php
+ }
+?>
+ </tr>
+ <tr>
+ <td colspan="<?=$gps_goo_lnk; ?>"><a target="_gmaps" href="http://maps.google.com/?q=<?=$gps_lat; ?>,<?=$gps_lon; ?>"><?=gettext("Google Maps Link");?></a></td>
+ </tr>
+ </tbody>
+ </table>
</div>
+</div>
-<?php endif;
+<?php
+endif;
-include("foot.inc"); ?>
+include("foot.inc");
+?>
diff --git a/src/usr/local/www/status_openvpn.php b/src/usr/local/www/status_openvpn.php
index bc7e266..ca516b6 100644
--- a/src/usr/local/www/status_openvpn.php
+++ b/src/usr/local/www/status_openvpn.php
@@ -96,14 +96,14 @@ include("head.inc"); ?>
//<![CDATA[
function killClient(mport, remipp) {
var busy = function(index,icon) {
- jQuery(icon).bind("onclick","");
- jQuery(icon).attr('src',jQuery(icon).attr('src').replace("\.gif", "_d.gif"));
- jQuery(icon).css("cursor","wait");
+ $(icon).bind("onclick","");
+ $(icon).attr('src',$(icon).attr('src').replace("\.gif", "_d.gif"));
+ $(icon).css("cursor","wait");
}
- jQuery('img[name="i:' + mport + ":" + remipp + '"]').each(busy);
+ $('img[name="i:' + mport + ":" + remipp + '"]').each(busy);
- jQuery.ajax(
+ $.ajax(
"<?=$_SERVER['SCRIPT_NAME'];?>" +
"?action=kill&port=" + mport + "&remipp=" + remipp,
{ type: "get", complete: killComplete }
@@ -117,8 +117,8 @@ include("head.inc"); ?>
return;
}
- jQuery('tr[name="r:' + values[1] + ":" + values[2] + '"]').each(
- function(index,row) { jQuery(row).fadeOut(1000); }
+ $('tr[name="r:' + values[1] + ":" + values[2] + '"]').each(
+ function(index,row) { $(row).fadeOut(1000); }
);
}
//]]>
@@ -158,9 +158,9 @@ include("head.inc"); ?>
<td><?=format_bytes($conn['bytes_recv']);?></td>
<td>
<a
- onclick="killClient('<?php echo $server['mgmt']; ?>', '<?php echo $conn['remote_host']; ?>');" style="cursor:pointer;"
+ onclick="killClient('<?=$server['mgmt'];?>', '<?=$conn['remote_host'];?>');" style="cursor:pointer;"
id="<?php echo "i:{$server['mgmt']}:{$conn['remote_host']}"; ?>"
- title="<?php echo gettext("Kill client connection from") . " " . $conn['remote_host']; ?>">
+ title="<?php echo sprintf(gettext("Kill client connection from %s"), $conn['remote_host']); ?>">
<i class="fa fa-times"></i>
</a>
</td>
@@ -253,10 +253,10 @@ include("head.inc"); ?>
<th><?=gettext("Name"); ?></th>
<th><?=gettext("Status"); ?></th>
<th><?=gettext("Connected Since"); ?></th>
- <th><?=gettext("Virtual Addr"); ?></th>
+ <th><?=gettext("Virtual Address"); ?></th>
<th><?=gettext("Remote Host"); ?></th>
<th><?=gettext("Bytes Sent"); ?></th>
- <th><?=gettext("Bytes Rcvd"); ?></th>
+ <th><?=gettext("Bytes Received"); ?></th>
<th><?=gettext("Service"); ?></th>
</tr>
</thead>
@@ -309,10 +309,10 @@ include("head.inc"); ?>
<th><?=gettext("Name"); ?></th>
<th><?=gettext("Status"); ?></th>
<th><?=gettext("Connected Since"); ?></th>
- <th><?=gettext("Virtual Addr"); ?></th>
+ <th><?=gettext("Virtual Address"); ?></th>
<th><?=gettext("Remote Host"); ?></th>
<th><?=gettext("Bytes Sent"); ?></th>
- <th><?=gettext("Bytes Rcvd"); ?></th>
+ <th><?=gettext("Bytes Received"); ?></th>
<th><?=gettext("Service"); ?></th>
</tr>
</thead>
diff --git a/src/usr/local/www/status_pkglogs.php b/src/usr/local/www/status_pkglogs.php
index 991a56a..b387fd3 100755
--- a/src/usr/local/www/status_pkglogs.php
+++ b/src/usr/local/www/status_pkglogs.php
@@ -127,7 +127,7 @@ if ($pkgwithlogging == false) {
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?=printf(gettext('Last %1$s %2$s log entries'), $nentries, $curtab)?></h2></div>
- <div>class="panel-body">
+ <div class="panel-body">
<pre>
<?php
$package = $config['installedpackages']['package'][$apkgid];
diff --git a/src/usr/local/www/status_queues.php b/src/usr/local/www/status_queues.php
index c67cf93..34f3ba3 100644
--- a/src/usr/local/www/status_queues.php
+++ b/src/usr/local/www/status_queues.php
@@ -84,7 +84,7 @@ if (!file_exists("{$g['varrun_path']}/qstats.pid") || !isvalidpid("{$g['varrun_p
}
$fd = @fsockopen("unix://{$g['varrun_path']}/qstats");
if (!$fd) {
- $error = "Something wrong happened during communication with stat gathering";
+ $error = gettext("Something wrong happened during communication with stat gathering");
} else {
$stats = "";
while (!feof($fd)) {
@@ -94,7 +94,7 @@ if (!$fd) {
@file_put_contents("{$g['tmp_path']}/qstats", $stats);
$altqstats = @parse_xml_config("{$g['tmp_path']}/qstats", array("altqstats"));
if ($altqstats == -1) {
- $error = "No queue statistics could be read.";
+ $error = gettext("No queue statistics could be read.");
}
}
if ($_REQUEST['getactivity']) {
@@ -129,13 +129,13 @@ if ($_REQUEST['getactivity']) {
if ($packet_s < 0) {
$packet_s = 0;
}
- $finscript .= "jQuery('#queue{$q->queuename}width').css('width','{$packet_s}%');";
- $finscript .= "jQuery('#queue{$q->queuename}pps').val('" . number_format($q->pps, 1) . "');";
- $finscript .= "jQuery('#queue{$q->queuename}bps').val('" . format_bits($q->bandwidth) . "');";
- $finscript .= "jQuery('#queue{$q->queuename}borrows').val('{$q->borrows}');";
- $finscript .= "jQuery('#queue{$q->queuename}suspends').val('{$q->suspends}');";
- $finscript .= "jQuery('#queue{$q->queuename}drops').val('{$q->drops}');";
- $finscript .= "jQuery('#queue{$q->queuename}length').val('{$q->queuelength}');";
+ $finscript .= "$('#queue{$q->queuename}width').css('width','{$packet_s}%');";
+ $finscript .= "$('#queue{$q->queuename}pps').val('" . number_format($q->pps, 1) . "');";
+ $finscript .= "$('#queue{$q->queuename}bps').val('" . format_bits($q->bandwidth) . "');";
+ $finscript .= "$('#queue{$q->queuename}borrows').val('{$q->borrows}');";
+ $finscript .= "$('#queue{$q->queuename}suspends').val('{$q->suspends}');";
+ $finscript .= "$('#queue{$q->queuename}drops').val('{$q->drops}');";
+ $finscript .= "$('#queue{$q->queuename}length').val('{$q->queuelength}');";
}
unset($statistics, $altqstats);
header("Content-type: text/javascript");
@@ -160,8 +160,8 @@ if (!is_array($config['shaper']['queue']) || count($config['shaper']['queue']) <
//<![CDATA[
function getqueueactivity() {
var url = "/status_queues.php";
- var pars = "getactivity=yes&stats=" + jQuery("#selStatistic").val();
- jQuery.ajax(
+ var pars = "getactivity=yes&stats=" + $("#selStatistic").val();
+ $.ajax(
url,
{
type: 'post',
@@ -172,7 +172,7 @@ if (!is_array($config['shaper']['queue']) || count($config['shaper']['queue']) <
function activitycallback(transport) {
setTimeout('getqueueactivity()', 5100);
}
- jQuery(document).ready(function() {
+ $(document).ready(function() {
setTimeout('getqueueactivity()', 150);
});
//]]>
@@ -190,9 +190,9 @@ else: ?>
<tr>
<th><?=gettext("Queue"); ?></th>
<th><?=gettext("Statistics"); ?>
- <select id="selStatistic">
- <option value="0">PPS</option>
- <option value="1">Bandwidth</option>
+ <select id="selStatistic" class="form-control">
+ <option value="0"><?=gettext("PPS");?></option>
+ <option value="1"><?=gettext("Bandwidth");?></option>
</select>
</th>
<th><?=gettext("PPS"); ?></th>
@@ -211,28 +211,24 @@ else: ?>
<?php endif; ?>
</tbody>
</table>
- <br />
+ <br />
+ <div class="infoblock blockopen">
<?php
- print_info_box(gettext("Queue graphs take 5 seconds to sample data"));
+ print_info_box(gettext("Queue graphs take 5 seconds to sample data"), 'info', false);
?>
+ </div>
</div>
</div>
<br/>
-<?php
-
-
-
-?>
-
<script type="text/javascript">
//<![CDATA[
function StatsShowHide(classname) {
- var firstrow = jQuery("." + classname).first();
+ var firstrow = $("." + classname).first();
if (firstrow.is(':visible')) {
- jQuery("." + classname).hide();
+ $("." + classname).hide();
} else {
- jQuery("." + classname).show();
+ $("." + classname).show();
}
}
//]]>
@@ -245,11 +241,7 @@ include("foot.inc");
function processQueues($altqstats, $level, $parent_name) {
global $g;
global $if_queue_list;
- $gray_value = 190 + $level * 10;
- if ($gray_value > 250) {
- $gray_value = 255;
- }
- $row_background = str_repeat(dechex($gray_value), 3);
+
$parent_name = $parent_name . " queuerow" . $altqstats['name'] . $altqstats['interface'];
$prev_if = $altqstats['interface'];
foreach ($altqstats['queue'] as $q) {
@@ -265,8 +257,8 @@ function processQueues($altqstats, $level, $parent_name) {
$prev_if = $q['interface'];
}
?>
- <tr class="<?php echo $parent_name?>">
- <td style="background-color:#<?php echo $row_background?>;padding-left:<?php echo $level * 20?>px;">
+ <tr class="<?=$parent_name;?>">
+ <td class="<?=$row_class?>" style="padding-left:<?=$level * 20?>px;">
<?php
if (is_array($q['queue'])) {
echo "<a href=\"#\" onclick=\"StatsShowHide('queuerow{$q['name']}{$q['interface']}');return false\">+/-</a>";
@@ -280,17 +272,17 @@ function processQueues($altqstats, $level, $parent_name) {
</td>
<?php
$cpuUsage = 0;
- echo "<td style=\"background-color:#{$row_background}\" >";
- echo "<div class=\"progress\" style=\"height: 7px;width: 170px;\">
- <div class=\"progress-bar\" role=\"progressbar\" id=\"queue{$q['name']}{$q['interface']}width\" aria-valuenow=\"70\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: " . ($cpuUsage*100) . "%;\"></div>
- </div>";
- echo "</td>";
- echo "<td style=\"background-color:#{$row_background}\"><input style=\"border:0;width:70px;text-align:right;\" size=\"10\" name=\"queue{$q['name']}{$q['interface']}pps\" id=\"queue{$q['name']}{$q['interface']}pps\" value=\"(" . gettext("Loading") . ")\" /></td>";
- echo "<td style=\"background-color:#{$row_background}\"><input style=\"border:0;width:80px;text-align:right;\" size=\"10\" name=\"queue{$q['name']}{$q['interface']}bps\" id=\"queue{$q['name']}{$q['interface']}bps\" value=\"\" /></td>";
- echo "<td style=\"background-color:#{$row_background}\"><input style=\"border:0;width:70px;text-align:right;\" size=\"10\" name=\"queue{$q['name']}{$q['interface']}borrows\" id=\"queue{$q['name']}{$q['interface']}borrows\" value=\"\" /></td>";
- echo "<td style=\"background-color:#{$row_background}\"><input style=\"border:0;width:70px;text-align:right;\" size=\"10\" name=\"queue{$q['name']}{$q['interface']}suspends\" id=\"queue{$q['name']}{$q['interface']}suspends\" value=\"\" /></td>";
- echo "<td style=\"background-color:#{$row_background}\"><input style=\"border:0;width:70px;text-align:right;\" size=\"10\" name=\"queue{$q['name']}{$q['interface']}drops\" id=\"queue{$q['name']}{$q['interface']}drops\" value=\"\" /></td>";
- echo "<td style=\"background-color:#{$row_background}\"><input style=\"border:0;width:70px;text-align:right;\" size=\"10\" name=\"queue{$q['name']}{$q['interface']}length\" id=\"queue{$q['name']}{$q['interface']}length\" value=\"\" /></td>";
+ print('<td>');
+ print('<div class="progress" style="height: 7px;width: 170px;">');
+ print(' <div class="progress-bar" role="progressbar" id="queue' . $q['name'] . $q['interface'] . 'width" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width: ' . $cpuUsage*100 . '%;\"></div>');
+ print(' </div>');
+ print('</td>');
+ print('<td><input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'pps" id="queue' . $q['name'] . $q['interface'] . 'pps" value="(' . gettext("Loading") . ')" /></td>');
+ print('<td><input readonly style="border:0;width:80px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'bps" id="queue' . $q['name'] . $q['interface'] . 'bps" value="" /></td>');
+ print('<td><input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'borrows" id="queue' . $q['name'] . $q['interface'] . 'borrows" value="" /></td>');
+ print('<td><input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'suspends" id="queue' . $q['name'] . $q['interface'] . 'suspends" value="" /></td>');
+ print('<td><input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'drops" id="queue' . $q['name'] . $q['interface'] . 'drops" value="" /></td>');
+ print('<td><input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'length" id="queue' . $q['name'] . $q['interface'] . 'length" value="" /></td>');
?>
</tr>
<?php
diff --git a/src/usr/local/www/status_rrd_graph.php b/src/usr/local/www/status_rrd_graph.php
index cbd084e..4a3134d 100644
--- a/src/usr/local/www/status_rrd_graph.php
+++ b/src/usr/local/www/status_rrd_graph.php
@@ -230,7 +230,7 @@ if (is_numeric($_GET['end'])) {
/* this should never happen */
if ($end < $start) {
- log_error("start $start is smaller than end $end");
+ log_error(sprintf(gettext("start %d is smaller than end %d"), $start, $end));
$end = $now;
}
@@ -297,7 +297,16 @@ $graph_length = array(
"year" => 31622400,
"fouryear" => 126230400);
-$pgtitle = array(gettext("Status"), gettext("RRD Graphs"));
+switch ($curcat) {
+ case "vpnusers":
+ $curcattext = gettext("VPN Users");
+ break;
+ default:
+ $curcattext = ucfirst($curcat);
+ break;
+}
+
+$pgtitle = array(gettext("Status"), gettext("RRD Graphs"), gettext($curcattext . " Graphs"));
/* Load all CP zones */
if ($captiveportal && is_array($config['captiveportal'])) {
@@ -563,7 +572,7 @@ $group->add(new Form_Select(
))->setHelp('Period');
if ($curcat == 'custom') {
- $group->setHelp('Any changes to these option may not take affect until the next auto-refresh.');
+ $group->setHelp('Any changes to these options may not take affect until the next auto-refresh.');
}
$section->add($group);
@@ -598,7 +607,7 @@ if ($curcat == 'custom') {
))->setHelp('End');
if ($curcat != 'custom') {
- $group->setHelp('Any changes to these option may not take affect until the next auto-refresh');
+ $group->setHelp('Any changes to these options may not take affect until the next auto-refresh');
}
$section->add($group);
@@ -613,7 +622,7 @@ if ($curcat == 'custom') {
$id = preg_replace('/\./', '_', $id);
?>
<div class="panel panel-default">
- <img align="center" name="<?=$id?>" id="<?=$id?>" alt="<?=$prettydb?> Graph" src="status_rrd_graph_img.php?start=<?=$start?>&amp;end=<?=$end?>&amp;database=<?=$curdatabase?>&amp;style=<?=$curstyle?>&amp;graph=<?=$graph?>" />
+ <img class="img-responsive center-block" id="<?=$id?>" alt="<?=$prettydb?> <?=gettext("Graph");?>" src="status_rrd_graph_img.php?start=<?=$start?>&amp;end=<?=$end?>&amp;database=<?=$curdatabase?>&amp;style=<?=$curstyle?>&amp;graph=<?=$graph?>" />
</div>
<?php
@@ -690,8 +699,8 @@ if ($curcat == 'custom') {
$start = $dates['start'];
$end = $dates['end'];
?>
- <div class="panel panel-default" align="center">
- <img name="<?=$id?>" id="<?=$id?>" alt="<?=$prettydb?> Graph" src="status_rrd_graph_img.php?start=<?=$start?>&amp;end=<?=$end?>&amp;database=<?=$curdatabase?>&amp;style=<?=$curstyle?>&amp;graph=<?=$graph?>" />
+ <div class="panel panel-default">
+ <img class="img-responsive center-block" id="<?=$id?>" alt="<?=$prettydb?> Graph" src="status_rrd_graph_img.php?start=<?=$start?>&amp;end=<?=$end?>&amp;database=<?=$curdatabase?>&amp;style=<?=$curstyle?>&amp;graph=<?=$graph?>" />
</div>
<?php
}
diff --git a/src/usr/local/www/status_rrd_graph_img.php b/src/usr/local/www/status_rrd_graph_img.php
index 9d203c3..32d3d4d 100644
--- a/src/usr/local/www/status_rrd_graph_img.php
+++ b/src/usr/local/www/status_rrd_graph_img.php
@@ -101,7 +101,7 @@ if (is_numeric($_GET['end'])) {
/* this should never happen */
if ($end < $start) {
- log_error("start $start is smaller than end $end");
+ log_error(sprintf(gettext("start %d is smaller than end %d"), $start, $end));
$end = $now;
}
@@ -441,7 +441,7 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "HRULE:\"$curif-in_bits_95#{$colortraffic95[1]}:$curif-in (95%)\" ";
$graphcmd .= "HRULE:\"$curif-out_bits_95#{$colortraffic95[0]}:$curif-out (95%)\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t\t\t maximum\t average\t\t current\t period\t 95th percentile\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t\t maximum\t average\t\t current\t period\t 95th percentile\\n\" ";
$graphcmd .= "COMMENT:\"IPv4 in-pass\t\" ";
$graphcmd .= "GPRINT:\"$curif-in_bits_pass:MAX:%7.2lf %sb/s\" ";
$graphcmd .= "GPRINT:\"$curif-in_bits_pass:AVERAGE:%7.2lf %Sb/s\" ";
@@ -596,7 +596,7 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "{$AREA}:\"tput-out_bits_pass_neg#{$colortrafficup[0]}:out-pass \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t maximum average current period\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t maximum average current period\\n\" ";
$graphcmd .= "COMMENT:\"in-pass\t\" ";
$graphcmd .= "GPRINT:\"tput-in_bits_pass:MAX:%7.2lf %sb/s\" ";
$graphcmd .= "GPRINT:\"tput-in_bits_pass:AVERAGE:%7.2lf %Sb/s\" ";
@@ -695,7 +695,7 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "$AREA:\"$curif-out6_pps_pass_neg#{$colorpacketsup[2]}:$curif-out6-pass:STACK\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t maximum\t\t average\t current\t period\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t maximum average current period\\n\" ";
$graphcmd .= "COMMENT:\"in-pass\t\" ";
$graphcmd .= "GPRINT:\"$curif-in_pps_pass:MAX:%7.2lf %s pps\" ";
$graphcmd .= "GPRINT:\"$curif-in_pps_pass:AVERAGE:%7.2lf %S pps\" ";
@@ -762,7 +762,7 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "LINE2:\"$curif-rate#{$colorwireless[1]}:$curif-rate\" ";
$graphcmd .= "LINE2:\"$curif-channel#{$colorwireless[2]}:$curif-channel\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t maximum\t\t average\t current\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t maximum\t\t average\t current\\n\" ";
$graphcmd .= "COMMENT:\"SNR\t\t\" ";
$graphcmd .= "GPRINT:\"$curif-snr:MAX:%7.2lf dBi \" ";
$graphcmd .= "GPRINT:\"$curif-snr:AVERAGE:%7.2lf dBi \" ";
@@ -774,8 +774,8 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "GPRINT:\"$curif-rate:LAST:%7.2lf Mb\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"Channel\t\" ";
- $graphcmd .= "GPRINT:\"$curif-channel:MAX:%7.2lf \" ";
- $graphcmd .= "GPRINT:\"$curif-channel:AVERAGE:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-channel:MAX:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-channel:AVERAGE:%7.2lf \" ";
$graphcmd .= "GPRINT:\"$curif-channel:LAST:%7.2lf\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
@@ -790,10 +790,10 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "DEF:\"$curif-users=$rrddbpath$curdatabase:users:AVERAGE:step=$step\" ";
$graphcmd .= "LINE2:\"$curif-users#{$colorvpnusers[0]}:$curif-users\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t\t maximum\t\t average\t current\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t maximum\t\t average\t current\\n\" ";
$graphcmd .= "COMMENT:\"Users Online\t\" ";
- $graphcmd .= "GPRINT:\"$curif-users:MAX:%7.2lf \" ";
- $graphcmd .= "GPRINT:\"$curif-users:AVERAGE:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-users:MAX:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-users:AVERAGE:%7.2lf \" ";
$graphcmd .= "GPRINT:\"$curif-users:LAST:%7.2lf \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
@@ -817,7 +817,7 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "LINE1:\"$curif-srcip#{$colorstates[3]}:$curif-srcip\" ";
$graphcmd .= "LINE1:\"$curif-dstip#{$colorstates[4]}:$curif-dstip\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t minimum average maximum current period\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t minimum average maximum current period\\n\" ";
$graphcmd .= "COMMENT:\"state changes\" ";
$graphcmd .= "GPRINT:\"$curif-pfrate:MIN:%7.2lf %s cps\" ";
$graphcmd .= "GPRINT:\"$curif-pfrate:AVERAGE:%7.2lf %s cps\" ";
@@ -826,28 +826,28 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "GPRINT:\"$curif-pfrate_t:AVERAGE:%7.2lf %s chg\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"filter states\" ";
- $graphcmd .= "GPRINT:\"$curif-pfstates:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-pfstates:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-pfstates:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-pfstates:LAST:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-pfstates:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-pfstates:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-pfstates:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-pfstates:LAST:%7.2lf %s \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"nat states \" ";
- $graphcmd .= "GPRINT:\"$curif-pfnat:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-pfnat:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-pfnat:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-pfnat:LAST:%7.2lf %s \" ";
+ $graphcmd .= "COMMENT:\"nat states \" ";
+ $graphcmd .= "GPRINT:\"$curif-pfnat:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-pfnat:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-pfnat:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-pfnat:LAST:%7.2lf %s \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"Source addr. \" ";
- $graphcmd .= "GPRINT:\"$curif-srcip:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-srcip:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-srcip:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-srcip:LAST:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-srcip:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-srcip:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-srcip:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-srcip:LAST:%7.2lf %s \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Dest. addr. \" ";
- $graphcmd .= "GPRINT:\"$curif-dstip:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-dstip:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-dstip:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"$curif-dstip:LAST:%7.2lf %s \" ";
+ $graphcmd .= "COMMENT:\"Dest. addr. \" ";
+ $graphcmd .= "GPRINT:\"$curif-dstip:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-dstip:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-dstip:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"$curif-dstip:LAST:%7.2lf %s \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
} elseif ((strstr($curdatabase, "-processor.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
@@ -869,36 +869,36 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "AREA:\"interrupt#{$colorprocessor[3]}:interrupt:STACK\" ";
$graphcmd .= "LINE2:\"processes#{$colorprocessor[4]}:processes\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t minimum average maximum current\\n\" ";
- $graphcmd .= "COMMENT:\"User util. \" ";
- $graphcmd .= "GPRINT:\"user:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"user:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"user:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"user:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\t\t minimum average maximum current\\n\" ";
+ $graphcmd .= "COMMENT:\"User util. \" ";
+ $graphcmd .= "GPRINT:\"user:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"user:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"user:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"user:LAST:%7.2lf %S \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Nice util. \" ";
- $graphcmd .= "GPRINT:\"nice:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"nice:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"nice:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"nice:LAST:%7.2lf %s \" ";
+ $graphcmd .= "COMMENT:\"Nice util. \" ";
+ $graphcmd .= "GPRINT:\"nice:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"nice:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"nice:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"nice:LAST:%7.2lf %s \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"System util. \" ";
- $graphcmd .= "GPRINT:\"system:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"system:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"system:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"system:LAST:%7.2lf %s \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Interrupt \" ";
- $graphcmd .= "GPRINT:\"interrupt:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"interrupt:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"interrupt:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"interrupt:LAST:%7.2lf %s \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Processes \" ";
- $graphcmd .= "GPRINT:\"processes:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"processes:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"processes:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"processes:LAST:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"system:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"system:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"system:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"system:LAST:%7.2lf %s \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Interrupt \" ";
+ $graphcmd .= "GPRINT:\"interrupt:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"interrupt:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"interrupt:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"interrupt:LAST:%7.2lf %s \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Processes \" ";
+ $graphcmd .= "GPRINT:\"processes:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"processes:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"processes:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"processes:LAST:%7.2lf %s \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
} elseif ((strstr($curdatabase, "-memory.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
@@ -920,36 +920,36 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "LINE2:\"cache#{$colormemory[3]}:cache\" ";
$graphcmd .= "LINE2:\"wire#{$colormemory[4]}:wire\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t minimum average maximum current\\n\" ";
- $graphcmd .= "COMMENT:\"Active. \" ";
- $graphcmd .= "GPRINT:\"active:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"active:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"active:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"active:LAST:%7.2lf %S \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Inactive. \" ";
- $graphcmd .= "GPRINT:\"inactive:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"inactive:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"inactive:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"inactive:LAST:%7.2lf %S \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Free. \" ";
- $graphcmd .= "GPRINT:\"free:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"free:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"free:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"free:LAST:%7.2lf %S \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Cached. \" ";
- $graphcmd .= "GPRINT:\"cache:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"cache:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"cache:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"cache:LAST:%7.2lf %S \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Wired. \" ";
- $graphcmd .= "GPRINT:\"wire:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"wire:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"wire:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"wire:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\t\t minimum average maximum current\\n\" ";
+ $graphcmd .= "COMMENT:\"Active. \" ";
+ $graphcmd .= "GPRINT:\"active:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"active:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"active:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"active:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Inactive. \" ";
+ $graphcmd .= "GPRINT:\"inactive:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"inactive:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"inactive:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"inactive:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Free. \" ";
+ $graphcmd .= "GPRINT:\"free:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"free:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"free:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"free:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Cached. \" ";
+ $graphcmd .= "GPRINT:\"cache:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cache:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cache:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cache:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Wired. \" ";
+ $graphcmd .= "GPRINT:\"wire:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"wire:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"wire:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"wire:LAST:%7.2lf %S \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
} elseif ((strstr($curdatabase, "-mbuf.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
@@ -969,30 +969,30 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "LINE2:\"total#{$colormbuf[2]}:total\" ";
$graphcmd .= "LINE2:\"max#{$colormbuf[3]}:max\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t minimum average maximum current\\n\" ";
- $graphcmd .= "COMMENT:\"Current. \" ";
- $graphcmd .= "GPRINT:\"current:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"current:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"current:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"current:LAST:%7.2lf %S \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Cache. \" ";
- $graphcmd .= "GPRINT:\"cache:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"cache:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"cache:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"cache:LAST:%7.2lf %S \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Total. \" ";
- $graphcmd .= "GPRINT:\"total:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"total:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"total:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"total:LAST:%7.2lf %S \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"Max. \" ";
- $graphcmd .= "GPRINT:\"max:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"max:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"max:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"max:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\t\t minimum average maximum current\\n\" ";
+ $graphcmd .= "COMMENT:\"Current. \" ";
+ $graphcmd .= "GPRINT:\"current:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"current:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"current:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"current:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Cache. \" ";
+ $graphcmd .= "GPRINT:\"cache:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cache:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cache:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cache:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Total. \" ";
+ $graphcmd .= "GPRINT:\"total:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"total:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"total:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"total:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Max. \" ";
+ $graphcmd .= "GPRINT:\"max:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"max:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"max:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"max:LAST:%7.2lf %S \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
} elseif ((strstr($curdatabase, "-queues.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
@@ -1078,18 +1078,18 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
\"CDEF:r1=delay,60,MIN\" \\
\"CDEF:r2=delay,180,MIN\" \\
\"CDEF:r3=delay,420,MIN\" \\
- COMMENT:\"\t\t\t\t\tDelay\t\t\tPacket loss\\n\" \\
- AREA:delay#$colorqualityrtt[0]:\"> 420 ms\" \\
- GPRINT:delay:MIN:\"\t\tMin\\: %7.2lf ms\" \\
+ COMMENT:\"\t\t\t\t\tDelay\t\t\t\tPacket loss\\n\" \\
+ AREA:delay#$colorqualityrtt[0]:\"> 420 ms\" \\
+ GPRINT:delay:MIN:\"\t\tMin\\: %7.2lf ms\" \\
GPRINT:loss:MIN:\"\tMin\\: %3.1lf %%\\n\" \\
- AREA:r3#$colorqualityrtt[1]:\"180-420 ms\" \\
- GPRINT:delay:AVERAGE:\"\t\tAvg\\: %7.2lf ms\" \\
+ AREA:r3#$colorqualityrtt[1]:\"180-420 ms\" \\
+ GPRINT:delay:AVERAGE:\"\t\tAvg\\: %7.2lf ms\" \\
GPRINT:loss:AVERAGE:\"\tAvg\\: %3.1lf %%\\n\" \\
- AREA:r2#$colorqualityrtt[2]:\"60-180 ms\" \\
- GPRINT:delay:MAX:\"\t\tMax\\: %7.2lf ms\" \\
+ AREA:r2#$colorqualityrtt[2]:\"60-180 ms\" \\
+ GPRINT:delay:MAX:\"\t\tMax\\: %7.2lf ms\" \\
GPRINT:loss:MAX:\"\tMax\\: %3.1lf %%\\n\" \\
- AREA:r1#$colorqualityrtt[3]:\"20-60 ms\\n\" \\
- AREA:r0#$colorqualityrtt[4]:\"< 20 ms\" \\
+ AREA:r1#$colorqualityrtt[3]:\"20-60 ms\\n\" \\
+ AREA:r0#$colorqualityrtt[4]:\"< 20 ms\" \\
GPRINT:delay:LAST:\"\t\tLast\\: %7.2lf ms\" \\
GPRINT:loss:LAST:\"\tLast\: %3.1lf %%\\n\" \\
AREA:loss10#$colorqualityloss:\"Packet loss\\n\" \\
@@ -1143,10 +1143,10 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "DEF:\"$curif-rssi=$rrddbpath$curdatabase:rssi:AVERAGE:step=$step\" ";
$graphcmd .= "LINE2:\"$curif-rssi#{$colorwireless[0]}:$curif-rssi\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t maximum\t\t average\t current\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t maximum\t\t average\t current\\n\" ";
$graphcmd .= "COMMENT:\"RSSI\t\t\" ";
- $graphcmd .= "GPRINT:\"$curif-rssi:MAX:%7.2lf \" ";
- $graphcmd .= "GPRINT:\"$curif-rssi:AVERAGE:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-rssi:MAX:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-rssi:AVERAGE:%7.2lf \" ";
$graphcmd .= "GPRINT:\"$curif-rssi:LAST:%7.2lf \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
@@ -1182,10 +1182,10 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "DEF:\"$curif-concurrentusers=$rrddbpath$curdatabase:concurrentusers:AVERAGE:step=$step\" ";
$graphcmd .= "AREA:\"$curif-concurrentusers#{$colorcaptiveportalusers[0]}:Concurrent Users\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t maximum\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t maximum\\n\" ";
$graphcmd .= "COMMENT:\"Users Online\t\" ";
- $graphcmd .= "GPRINT:\"$curif-concurrentusers:LAST:%8.0lf \" ";
- $graphcmd .= "GPRINT:\"$curif-concurrentusers:AVERAGE:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-concurrentusers:LAST:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-concurrentusers:AVERAGE:%8.0lf \" ";
$graphcmd .= "GPRINT:\"$curif-concurrentusers:MAX:%8.0lf \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
@@ -1206,30 +1206,30 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "LINE2:\"cjit#{$colorntpd[2]}:cjit\" ";
$graphcmd .= "LINE2:\"wander#{$colorntpd[3]}:wander\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t minimum average maximum current\\n\" ";
- $graphcmd .= "COMMENT:\"Offset \" ";
- $graphcmd .= "GPRINT:\"offset:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"offset:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"offset:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"offset:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\t\t minimum average maximum current\\n\" ";
+ $graphcmd .= "COMMENT:\"Offset \" ";
+ $graphcmd .= "GPRINT:\"offset:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"offset:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"offset:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"offset:LAST:%7.2lf %S \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"System jitter \" ";
- $graphcmd .= "GPRINT:\"sjit:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"sjit:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"sjit:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"sjit:LAST:%7.2lf %S \" ";
+ $graphcmd .= "GPRINT:\"sjit:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"sjit:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"sjit:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"sjit:LAST:%7.2lf %S \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"Clock jitter \" ";
- $graphcmd .= "GPRINT:\"cjit:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"cjit:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"cjit:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"cjit:LAST:%7.2lf %S \" ";
+ $graphcmd .= "GPRINT:\"cjit:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cjit:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cjit:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cjit:LAST:%7.2lf %S \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"Clk freq wander\" ";
- $graphcmd .= "GPRINT:\"wander:MIN:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"wander:AVERAGE:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"wander:MAX:%7.2lf %s \" ";
- $graphcmd .= "GPRINT:\"wander:LAST:%7.2lf %S \" ";
+ $graphcmd .= "GPRINT:\"wander:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"wander:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"wander:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"wander:LAST:%7.2lf %S \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
} elseif ((strstr($curdatabase, "-dhcpd.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
@@ -1247,20 +1247,20 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "LINE2:\"$curif-staticleases#{$colordhcpd[1]}:Static Leases\" ";
$graphcmd .= "LINE1:\"$curif-dhcprange#{$colordhcpd[2]}:DHCP Range\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t\tmaximum\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t\tmaximum\\n\" ";
$graphcmd .= "COMMENT:\"Active Leases\t\" ";
- $graphcmd .= "GPRINT:\"$curif-leases:LAST:%8.0lf \" ";
- $graphcmd .= "GPRINT:\"$curif-leases:AVERAGE:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-leases:LAST:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-leases:AVERAGE:%8.0lf \" ";
$graphcmd .= "GPRINT:\"$curif-leases:MAX:%8.0lf \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"Static Leases\t\" ";
- $graphcmd .= "GPRINT:\"$curif-staticleases:LAST:%8.0lf \" ";
- $graphcmd .= "GPRINT:\"$curif-staticleases:AVERAGE:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-staticleases:LAST:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-staticleases:AVERAGE:%8.0lf \" ";
$graphcmd .= "GPRINT:\"$curif-staticleases:MAX:%8.0lf \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"DHCP Range\t\t\" ";
- $graphcmd .= "GPRINT:\"$curif-dhcprange:LAST:%8.0lf \" ";
- $graphcmd .= "GPRINT:\"$curif-dhcprange:AVERAGE:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-dhcprange:LAST:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-dhcprange:AVERAGE:%8.0lf \" ";
$graphcmd .= "GPRINT:\"$curif-dhcprange:MAX:%8.0lf \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
diff --git a/src/usr/local/www/status_rrd_graph_settings.php b/src/usr/local/www/status_rrd_graph_settings.php
index 2bd5231..ecb0490 100644
--- a/src/usr/local/www/status_rrd_graph_settings.php
+++ b/src/usr/local/www/status_rrd_graph_settings.php
@@ -92,8 +92,7 @@ $periods = array("absolute" => gettext("Absolute Timespans"),
if ($_POST['ResetRRD']) {
mwexec('/bin/rm /var/db/rrd/*');
enable_rrd_graphing();
- setup_gateways_monitor();
- $savemsg = "RRD data has been cleared. New RRD files have been generated.";
+ $savemsg = gettext("RRD data has been cleared. New RRD files have been generated.");
} elseif ($_POST) {
unset($input_errors);
$pconfig = $_POST;
@@ -141,7 +140,7 @@ foreach ($databases as $database) {
}
}
-$pgtitle = array(gettext("Status"), gettext("RRD Graphs"));
+$pgtitle = array(gettext("Status"), gettext("RRD Graphs"), gettext("Settings"));
include("head.inc");
$tab_array[] = array(gettext("System"), ($curcat == "system"), "status_rrd_graph.php?cat=system");
diff --git a/src/usr/local/www/status_services.php b/src/usr/local/www/status_services.php
index a944696..6f7cbb0 100755
--- a/src/usr/local/www/status_services.php
+++ b/src/usr/local/www/status_services.php
@@ -118,6 +118,10 @@ if (count($services) > 0) {
<input id="id" type="hidden" name="id" value=""/>
<input id="zone" type="hidden" name="zone" value=""/>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Services')?></h2></div>
+ <div class="panel-body">
+
<div class="panel-body panel-default">
<div class="table-responsive">
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
@@ -161,7 +165,7 @@ if (count($services) > 0) {
}
?>
<td>
- <?=$running ? '<span class="text-success">Running</span>':'<span class="text-danger">Stopped</span>'?>
+ <?=$running ? '<span class="text-success">' . gettext("Running") . '</span>':'<span class="text-danger">' . gettext("Stopped") . '</span>'?>
</td>
<td>
<?=get_service_control_links($service)?>
@@ -184,6 +188,10 @@ if (count($services) > 0) {
</table>
</div>
</div>
+
+ </div>
+</div>
+
</form>
<?php
} else {
diff --git a/src/usr/local/www/status_upnp.php b/src/usr/local/www/status_upnp.php
index bab17eb..9c63c66 100644
--- a/src/usr/local/www/status_upnp.php
+++ b/src/usr/local/www/status_upnp.php
@@ -93,19 +93,21 @@ if (!$config['installedpackages'] ||
?>
-<div class="panel-body panel-default">
- <div class="table-responsive">
- <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
- <thead>
- <tr>
- <th><?=gettext("Port")?></th>
- <th><?=gettext("Protocol")?></th>
- <th><?=gettext("Internal IP")?></th>
- <th><?=gettext("Int. Port")?></th>
- <th><?=gettext("Description")?></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext(gettext("UPnP &amp; NAT-PMP Rules"))?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
+ <thead>
+ <tr>
+ <th><?=gettext("Port")?></th>
+ <th><?=gettext("Protocol")?></th>
+ <th><?=gettext("Internal IP")?></th>
+ <th><?=gettext("Int. Port")?></th>
+ <th><?=gettext("Description")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$i = 0;
@@ -118,31 +120,35 @@ foreach ($rdr_entries as $rdr_entry) {
$rdr_iport = $matches[6];
?>
- <tr>
- <td>
- <?=$rdr_port?>
- </td>
- <td>
- <?=$rdr_proto?>
- </td>
- <td>
- <?=$rdr_ip?>
- </td>
- <td>
- <?=$rdr_iport?>
- </td>
- <td>
- <?=$rdr_label?>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?=$rdr_port?>
+ </td>
+ <td>
+ <?=$rdr_proto?>
+ </td>
+ <td>
+ <?=$rdr_ip?>
+ </td>
+ <td>
+ <?=$rdr_iport?>
+ </td>
+ <td>
+ <?=$rdr_label?>
+ </td>
+ </tr>
<?php
}
$i++;
}
?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
</div>
+</div>
+
+<div>
<form action="status_upnp.php" method="post">
<nav class="action-buttons">
<button class="btn btn-danger btn-sm" type="submit" name="clear" id="clear" value="<?=gettext("Clear all sessions")?>">
diff --git a/src/usr/local/www/status_wireless.php b/src/usr/local/www/status_wireless.php
index dfe3659..4211a4e 100644
--- a/src/usr/local/www/status_wireless.php
+++ b/src/usr/local/www/status_wireless.php
@@ -242,10 +242,12 @@ display_top_tabs($tab_array);
</button>
</nav>
</form>
-
+<div class="infoblock">
<?php
-print_info_box('<b>Flags:</b> A = authorized, E = Extended Rate (802.11g), P = Power saving mode<br />' .
+print_info_box(gettext('<b>Flags:</b> A = authorized, E = Extended Rate (802.11g), P = Power saving mode<br />' .
'<b>Capabilities:</b> E = ESS (infrastructure mode), I = IBSS (ad-hoc mode), P = privacy (WEP/TKIP/AES), ' .
- 'S = Short preamble, s = Short slot time', info);
-
+ 'S = Short preamble, s = Short slot time'), 'info', false);
+?>
+</div>
+<?php
include("foot.inc");
diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php
index 8f0bd11..69d3069 100644
--- a/src/usr/local/www/system.php
+++ b/src/usr/local/www/system.php
@@ -93,6 +93,9 @@ $pconfig['webguicss'] = $config['system']['webgui']['webguicss'];
$pconfig['webguifixedmenu'] = $config['system']['webgui']['webguifixedmenu'];
$pconfig['dashboardcolumns'] = $config['system']['webgui']['dashboardcolumns'];
$pconfig['webguileftcolumnhyper'] = isset($config['system']['webgui']['webguileftcolumnhyper']);
+$pconfig['dashboardavailablewidgetspanel'] = isset($config['system']['webgui']['dashboardavailablewidgetspanel']);
+$pconfig['systemlogsfilterpanel'] = isset($config['system']['webgui']['systemlogsfilterpanel']);
+$pconfig['systemlogsmanagelogpanel'] = isset($config['system']['webgui']['systemlogsmanagelogpanel']);
$pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']);
if (!$pconfig['timezone']) {
@@ -178,16 +181,16 @@ if ($_POST) {
$dnsname="dns{$dnscounter}";
$dnsgwname="dns{$dnscounter}gw";
if (($_POST[$dnsname] && !is_ipaddr($_POST[$dnsname]))) {
- $input_errors[] = gettext("A valid IP address must be specified for DNS server $dnscounter.");
+ $input_errors[] = sprintf(gettext("A valid IP address must be specified for DNS server %s."), $dnscounter);
} else {
if (($_POST[$dnsgwname] <> "") && ($_POST[$dnsgwname] <> "none")) {
// A real gateway has been selected.
if (is_ipaddr($_POST[$dnsname])) {
if ((is_ipaddrv4($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false)) {
- $input_errors[] = gettext("You can not specify IPv6 gateway '{$_POST[$dnsgwname]}' for IPv4 DNS server '{$_POST[$dnsname]}'");
+ $input_errors[] = sprintf(gettext('You can not specify IPv6 gateway "%1$s" for IPv4 DNS server "%2$s".'), $_POST[$dnsgwname], $_POST[$dnsname]);
}
if ((is_ipaddrv6($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false)) {
- $input_errors[] = gettext("You can not specify IPv4 gateway '{$_POST[$dnsgwname]}' for IPv6 DNS server '{$_POST[$dnsname]}'");
+ $input_errors[] = sprintf(gettext('You can not specify IPv4 gateway "%1$s" for IPv6 DNS server "%2$s".'), $_POST[$dnsgwname], $_POST[$dnsname]);
}
} else {
// The user selected a gateway but did not provide a DNS address. Be nice and set the gateway back to "none".
@@ -229,12 +232,21 @@ if ($_POST) {
if ($_POST['language'] && $_POST['language'] != $config['system']['language']) {
$config['system']['language'] = $_POST['language'];
- set_language($config['system']['language']);
+ set_language();
}
unset($config['system']['webgui']['webguileftcolumnhyper']);
$config['system']['webgui']['webguileftcolumnhyper'] = $_POST['webguileftcolumnhyper'] ? true : false;
+ unset($config['system']['webgui']['dashboardavailablewidgetspanel']);
+ $config['system']['webgui']['dashboardavailablewidgetspanel'] = $_POST['dashboardavailablewidgetspanel'] ? true : false;
+
+ unset($config['system']['webgui']['systemlogsfilterpanel']);
+ $config['system']['webgui']['systemlogsfilterpanel'] = $_POST['systemlogsfilterpanel'] ? true : false;
+
+ unset($config['system']['webgui']['systemlogsmanagelogpanel']);
+ $config['system']['webgui']['systemlogsmanagelogpanel'] = $_POST['systemlogsmanagelogpanel'] ? true : false;
+
/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
$olddnsservers = $config['system']['dnsserver'];
unset($config['system']['dnsserver']);
@@ -345,7 +357,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg, success);
+ print_info_box($savemsg, 'success');
}
?>
<div id="container">
@@ -371,7 +383,7 @@ $section->addInput(new Form_Input(
'local hosts not running mDNS.');
$form->add($section);
-$section = new Form_Section('DNS server settings');
+$section = new Form_Section('DNS Server Settings');
for ($i=1; $i<5; $i++) {
// if (!isset($pconfig['dns'.$i]))
@@ -406,7 +418,7 @@ for ($i=1; $i<5; $i++) {
$group->add(new Form_Select(
'dns' . $i . 'gw',
- null,
+ 'Gateway',
$pconfig['dns' . $i . 'gw'],
$options
))->setHelp(($i == 4) ? 'Gateway':null);;
@@ -424,22 +436,22 @@ for ($i=1; $i<5; $i++) {
$section->addInput(new Form_Checkbox(
'dnsallowoverride',
- 'DNS server override',
+ 'DNS Server Override',
'Allow DNS server list to be overridden by DHCP/PPP on WAN',
$pconfig['dnsallowoverride']
-))->setHelp(sprintf(gettext('If this option is set, %s will use DNS servers'.
+))->setHelp(sprintf(gettext('If this option is set, %s will use DNS servers '.
'assigned by a DHCP/PPP server on WAN for its own purposes (including '.
'the DNS forwarder). However, they will not be assigned to DHCP and PPTP '.
'VPN clients.'), $g['product_name']));
$section->addInput(new Form_Checkbox(
'dnslocalhost',
- 'Disable DNS forwarder',
+ 'Disable DNS Forwarder',
'Do not use the DNS Forwarder as a DNS server for the firewall',
$pconfig['dnslocalhost']
-))->setHelp('By default localhost (127.0.0.1) will be used as the first DNS'.
+))->setHelp('By default localhost (127.0.0.1) will be used as the first DNS '.
'server where the DNS Forwarder or DNS Resolver is enabled and set to '.
- 'listen on Localhost, so system can use the local DNS service to perform'.
+ 'listen on Localhost, so system can use the local DNS service to perform '.
'lookups. Checking this box omits localhost from the list of DNS servers.');
$form->add($section);
@@ -495,7 +507,7 @@ $section->addInput(new Form_Select(
'webguifixedmenu',
'Top Navigation',
$pconfig['webguifixedmenu'],
- ["" => "Scrolls with page", "fixed" => "Fixed (Remains visible at top of page)"]
+ ["" => gettext("Scrolls with page"), "fixed" => gettext("Fixed (Remains visible at top of page)")]
))->setHelp("The fixed option is intended for large screens only.");
$section->addInput(new Form_Input(
@@ -506,6 +518,34 @@ $section->addInput(new Form_Input(
[min => 1, max => 4]
))->setHelp('<span class="badge" title="This feature is in BETA">BETA</span>');
+$group = new Form_Group('Associated Panels Show/Hide');
+
+$group->add(new Form_Checkbox(
+ 'dashboardavailablewidgetspanel',
+ null,
+ 'Available Widgets',
+ $pconfig['dashboardavailablewidgetspanel']
+ ))->setHelp('Show the Available Widgets panel on the Dashboard.');
+
+$group->add(new Form_Checkbox(
+ 'systemlogsfilterpanel',
+ null,
+ 'Log Filter',
+ $pconfig['systemlogsfilterpanel']
+))->setHelp('Show the Log Filter panel in System Logs.');
+
+$group->add(new Form_Checkbox(
+ 'systemlogsmanagelogpanel',
+ null,
+ 'Manage Log',
+ $pconfig['systemlogsmanagelogpanel']
+))->setHelp('Show the Manage Log panel in System Logs.');
+
+$group->setHelp('These options allow certain panels to be automatically hidden on page load. A control is provided in the title bar to un-hide the panel.
+<br /><span class="badge" title="This feature is in BETA">BETA</span>');
+
+$section->add($group);
+
$section->addInput(new Form_Checkbox(
'webguileftcolumnhyper',
'Left Column Labels',
diff --git a/src/usr/local/www/system_advanced_admin.php b/src/usr/local/www/system_advanced_admin.php
index 17c3635..8087224 100644
--- a/src/usr/local/www/system_advanced_admin.php
+++ b/src/usr/local/www/system_advanced_admin.php
@@ -393,7 +393,7 @@ $section->addInput(new Form_Input(
'users/browsers to access the GUI concurrently.');
$section->addInput(new Form_Checkbox(
- 'disablehttpredirect',
+ 'webgui-redirect',
'WebGUI redirect',
'Disable webConfigurator redirect rule',
$pconfig['disablehttpredirect']
@@ -413,7 +413,7 @@ $section->addInput(new Form_Checkbox(
'this option).');
$section->addInput(new Form_Checkbox(
- 'quietlogin',
+ 'webgui-login-messages',
'WebGUI login messages',
'Disable logging of webConfigurator successful logins',
$pconfig['quietlogin']
@@ -508,10 +508,10 @@ $section->addInput(new Form_Input(
))->setHelp('Note: Leave this blank for the default of 22.');
-if (!$g['enableserial_force'] && ($g['platform'] == $g['product_name'] || $g['platform'] == "cdrom")) {
- $form->add($section);
- $section = new Form_Section('Serial Communications');
+$form->add($section);
+$section = new Form_Section('Serial Communications');
+if (!$g['enableserial_force'] && ($g['platform'] == $g['product_name'] || $g['platform'] == "cdrom")) {
$section->addInput(new Form_Checkbox(
'enableserial',
'Serial Terminal',
@@ -521,21 +521,23 @@ if (!$g['enableserial_force'] && ($g['platform'] == $g['product_name'] || $g['pl
'the serial port. You can still access the console menu from the internal video '.
'card/keyboard. A <b>null modem</b> serial cable or adapter is required to use the '.
'serial console.');
+}
- $section->addInput(new Form_Select(
- 'serialspeed',
- 'Serial Speed',
- $pconfig['serialspeed'],
- array_combine(array(115200, 57600, 38400, 19200, 14400, 9600), array(115200, 57600, 38400, 19200, 14400, 9600))
- ))->setHelp('Allows selection of different speeds for the serial console port.');
+$section->addInput(new Form_Select(
+ 'serialspeed',
+ 'Serial Speed',
+ $pconfig['serialspeed'],
+ array_combine(array(115200, 57600, 38400, 19200, 14400, 9600), array(115200, 57600, 38400, 19200, 14400, 9600))
+))->setHelp('Allows selection of different speeds for the serial console port.');
+if (!$g['enableserial_force'] && ($g['platform'] == $g['product_name'] || $g['platform'] == "cdrom")) {
$section->addInput(new Form_Select(
'primaryconsole',
'Primary Console',
$pconfig['primaryconsole'],
array(
- 'serial' => 'Serial Console',
- 'video' => 'VGA Console',
+ 'serial' => gettext('Serial Console'),
+ 'video' => gettext('VGA Console'),
)
))->setHelp('Select the preferred console if multiple consoles are present. '.
'The preferred console will show pfSense boot script output. All consoles '.
@@ -556,6 +558,7 @@ $form->add($section);
print $form;
?>
+</div>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
@@ -596,3 +599,4 @@ if ($restart_webgui) {
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
send_event("service restart webgui");
}
+?>
diff --git a/src/usr/local/www/system_advanced_firewall.php b/src/usr/local/www/system_advanced_firewall.php
index 124e130..f831959 100644
--- a/src/usr/local/www/system_advanced_firewall.php
+++ b/src/usr/local/www/system_advanced_firewall.php
@@ -393,8 +393,10 @@ if ($_POST) {
$retval = filter_configure();
if (stristr($retval, "error") <> true) {
$savemsg = get_std_save_message($retval);
+ $class = 'success';
} else {
$savemsg = $retval;
+ $class = 'warning';
}
}
}
@@ -406,7 +408,7 @@ if ($input_errors) {
print_input_errors($input_errors);
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, $class);
}
$tab_array = array();
@@ -449,9 +451,9 @@ $section->addInput($input = new Form_Select(
$config['system']['optimization'],
array(
'normal' => 'Normal',
- 'high-latency' => 'High-latency',
- 'aggressive' => 'Aggressive',
- 'conservative' => 'Conservative',
+ 'high-latency' => gettext('High-latency'),
+ 'aggressive' => gettext('Aggressive'),
+ 'conservative' => gettext('Conservative'),
)
))->setHelp('Select the type of state table optimization to use');
@@ -468,7 +470,7 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_Checkbox(
'disablescrub',
'Disable Firewall Scrub',
- 'Disables the PF scrubbing option which can sometimes interfere with NFS and PPTP traffic.',
+ 'Disables the PF scrubbing option which can sometimes interfere with NFS traffic.',
isset($config['system']['disablescrub'])
));
@@ -543,8 +545,7 @@ $section->addInput(new Form_Checkbox(
'Disable Auto-added VPN rules',
'Disable all auto-added VPN rules.',
isset($config['system']['disablevpnrules'])
-))->setHelp('<span>Note: This disables automatically added rules for IPsec, '.
- 'PPTP.</span>');
+))->setHelp('Note: This disables automatically added rules for IPsec.');
$section->addInput(new Form_Checkbox(
'disablereplyto',
@@ -592,9 +593,9 @@ $section->addInput(new Form_Select(
'Update Frequency',
empty($pconfig['bogonsinterval']) ? 'monthly' : $pconfig['bogonsinterval'],
array(
- 'monthly' => 'Monthly',
- 'weekly' => 'Weekly',
- 'daily' => 'Daily',
+ 'monthly' => gettext('Monthly'),
+ 'weekly' => gettext('Weekly'),
+ 'daily' => gettext('Daily'),
)
))->setHelp('The frequency of updating the lists of IP addresses that are '.
'reserved (but not RFC 1918) or not yet assigned by IANA.');
@@ -617,11 +618,11 @@ if (count($config['interfaces']) > 1) {
'NAT Reflection mode for port forwards',
$value,
array(
- 'disable' => 'disabled',
- 'proxy' => 'NAT + proxy',
- 'purenat' => 'Pure NAT',
+ 'disable' => gettext('disabled'),
+ 'proxy' => gettext('NAT + proxy'),
+ 'purenat' => gettext('Pure NAT'),
)
- ))->setHelp('<ul><li>The pure NAT mode uses a set of NAT rules to direct '.
+ ))->setHelp('</span><ul class="help-block"><li>The pure NAT mode uses a set of NAT rules to direct '.
'packets to the target of the port forward. It has better scalability, '.
'but it must be possible to accurately determine the interface and '.
'gateway IP used for communication with the target at the time the '.
@@ -634,7 +635,7 @@ if (count($config['interfaces']) > 1) {
'the time the rules are loaded. Reflection rules are not created for '.
'ranges larger than 500 ports and will not be used for more than 1000 '.
'ports total between all port forwards. Only TCP and UDP protocols are '.
- 'supported.</li></ul>Individual rules may be configured to override '.
+ 'supported.</li></ul><span class="help-block">Individual rules may be configured to override '.
'this system setting on a per-rule basis.');
$section->addInput(new Form_Input(
@@ -728,7 +729,7 @@ $form->add($section);
print $form;
-?>
+?></div>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
@@ -741,13 +742,13 @@ events.push(function() {
var htext = '<span class="text-success">';
if (val == 'normal') {
- htext += 'The default optimization algorithm';
+ htext += '<?=gettext("The default optimization algorithm");?>';
} else if (val == 'high-latency') {
- htext += 'Used for eg. satellite links. Expires idle connections later than default';
+ htext += '<?=gettext("Used for eg. satellite links. Expires idle connections later than default");?>';
} else if (val == 'aggressive') {
- htext += 'Expires idle connections quicker. More efficient use of CPU and memory but can drop legitimate idle connections';
+ htext += '<?=gettext("Expires idle connections quicker. More efficient use of CPU and memory but can drop legitimate idle connections");?>';
} else if (val == 'conservative') {
- htext += 'Tries to avoid dropping any legitimate idle connections at the expense of increased memory usage and CPU utilization';
+ htext += '<?=gettext("Tries to avoid dropping any legitimate idle connections at the expense of increased memory usage and CPU utilization");?>';
}
htext += '</span>';
@@ -768,3 +769,4 @@ events.push(function() {
</script>
<?php
include("foot.inc");
+?> \ No newline at end of file
diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php
index 389496d..5c937f7 100644
--- a/src/usr/local/www/system_advanced_misc.php
+++ b/src/usr/local/www/system_advanced_misc.php
@@ -83,7 +83,7 @@ $pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
$pconfig['crypto_hardware'] = $config['system']['crypto_hardware'];
$pconfig['thermal_hardware'] = $config['system']['thermal_hardware'];
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
-$pconfig['kill_states'] = isset($config['system']['kill_states']);
+$pconfig['gw_down_kill_states'] = isset($config['system']['gw_down_kill_states']);
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
@@ -149,6 +149,10 @@ if ($_POST) {
$input_errors[] = gettext("The proxy username contains invalid characters.");
}
+ if($_POST['proxypass'] != $_POST['proxypass_confirm']) {
+ $input_errors[] = gettext("Proxy password and confirmation must match.");
+ }
+
if (!$input_errors) {
if ($_POST['harddiskstandby'] <> "") {
@@ -177,7 +181,9 @@ if ($_POST) {
}
if ($_POST['proxypass'] <> "") {
- $config['system']['proxypass'] = $_POST['proxypass'];
+ if ($_POST['proxypass'] != DMYPWD) {
+ $config['system']['proxypass'] = $_POST['proxypass'];
+ }
} else {
unset($config['system']['proxypass']);
}
@@ -223,9 +229,9 @@ if ($_POST) {
unset($config['system']['powerd_enable']);
}
- $config['system']['powerd_ac_mode'] = $_POST['ac-power'];
- $config['system']['powerd_battery_mode'] = $_POST['battery-power'];
- $config['system']['powerd_normal_mode'] = $_POST['unknown-power'];
+ $config['system']['powerd_ac_mode'] = $_POST['powerd_ac_mode'];
+ $config['system']['powerd_battery_mode'] = $_POST['powerd_battery_mode'];
+ $config['system']['powerd_normal_mode'] = $_POST['powerd_normal_mode'];
if ($_POST['crypto_hardware']) {
$config['system']['crypto_hardware'] = $_POST['crypto_hardware'];
@@ -245,10 +251,10 @@ if ($_POST) {
unset($config['system']['schedule_states']);
}
- if ($_POST['kill_states'] == "yes") {
- $config['system']['kill_states'] = true;
+ if ($_POST['gw_down_kill_states'] == "yes") {
+ $config['system']['gw_down_kill_states'] = true;
} else {
- unset($config['system']['kill_states']);
+ unset($config['system']['gw_down_kill_states']);
}
if ($_POST['skip_rules_gw_down'] == "yes") {
@@ -303,7 +309,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg, success);
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
@@ -341,7 +347,7 @@ $section->addInput(new Form_Input(
))->setHelp('Username for authentication to proxy server. Optional, '.
'leave blank to not use authentication.');
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'proxypass',
'Proxy Password',
'password',
@@ -411,10 +417,10 @@ $section->addInput(new Form_Checkbox(
'lower CPU load.');
$modes = array(
- 'hadp' => 'Hiadaptive',
- 'adp' => 'Adaptive',
- 'min' => 'Minimum',
- 'max' => 'Maximum',
+ 'hadp' => gettext('Hiadaptive'),
+ 'adp' => gettext('Adaptive'),
+ 'min' => gettext('Minimum'),
+ 'max' => gettext('Maximum'),
);
$section->addInput(new Form_Select(
@@ -485,12 +491,12 @@ $form->add($section);
$section = new Form_Section('Gateway Monitoring');
$section->addInput(new Form_Checkbox(
- 'kill_states',
+ 'gw_down_kill_states',
'State Killing on Gateway Failure',
'Flush all states when a gateway goes down',
- $pconfig['kill_states']
+ $pconfig['gw_down_kill_states']
))->setHelp('The monitoring process will flush all states when a gateway goes down '.
- 'if this box is not checked. Check this box to disable this behavior.');
+ 'if this box is checked.');
$section->addInput(new Form_Checkbox(
'skip_rules_gw_down',
diff --git a/src/usr/local/www/system_advanced_network.php b/src/usr/local/www/system_advanced_network.php
index 4c26b36..6b271e2 100644
--- a/src/usr/local/www/system_advanced_network.php
+++ b/src/usr/local/www/system_advanced_network.php
@@ -162,8 +162,10 @@ if ($_POST) {
$retval = filter_configure();
if (stristr($retval, "error") <> true) {
$savemsg = get_std_save_message(gettext($retval));
+ $class = 'success';
} else {
$savemsg = gettext($retval);
+ $class = 'warning';
}
}
}
@@ -175,7 +177,7 @@ if ($input_errors) {
print_input_errors($input_errors);
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, $class);
}
$tab_array = array();
@@ -187,8 +189,6 @@ $tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.
$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
display_top_tabs($tab_array);
-?><div id="container"><?php
-
$form = new Form;
$section = new Form_Section('IPv6 Options');
diff --git a/src/usr/local/www/system_advanced_notifications.php b/src/usr/local/www/system_advanced_notifications.php
index 0c5ed03..99bec31 100644
--- a/src/usr/local/www/system_advanced_notifications.php
+++ b/src/usr/local/www/system_advanced_notifications.php
@@ -126,7 +126,14 @@ if ($_POST) {
// Growl
$config['notifications']['growl']['ipaddress'] = $_POST['ipaddress'];
- $config['notifications']['growl']['password'] = $_POST['password'];
+ if ($_POST['password'] != DMYPWD) {
+ if ($_POST['password'] == $_POST['password_confirm']) {
+ $config['notifications']['growl']['password'] = $_POST['password'];
+ } else {
+ $input_errors[] = gettext("Growl passwords must match");
+ }
+ }
+
$config['notifications']['growl']['name'] = $_POST['name'];
$config['notifications']['growl']['notification_name'] = $_POST['notification_name'];
@@ -153,7 +160,15 @@ if ($_POST) {
$config['notifications']['smtp']['notifyemailaddress'] = $_POST['smtpnotifyemailaddress'];
$config['notifications']['smtp']['username'] = $_POST['smtpusername'];
- $config['notifications']['smtp']['password'] = $_POST['smtppassword'];
+
+ if ($_POST['smtppassword'] != DMYPWD) {
+ if ($_POST['smtppassword'] == $_POST['smtppassword_confirm']) {
+ $config['notifications']['smtp']['password'] = $_POST['smtppassword'];
+ } else {
+ $input_errors[] = gettext("SMTP passwords must match");
+ }
+ }
+
$config['notifications']['smtp']['authentication_mechanism'] = $_POST['smtpauthmech'];
$config['notifications']['smtp']['fromaddress'] = $_POST['smtpfromaddress'];
@@ -170,10 +185,12 @@ if ($_POST) {
unset($config['system']['disablebeep']);
}
- write_config();
+ if (!$input_errors) {
+ write_config();
- pfSenseHeader("system_advanced_notifications.php");
- return;
+ pfSenseHeader("system_advanced_notifications.php");
+ return;
+ }
}
@@ -253,7 +270,7 @@ $section->addInput(new Form_Input(
))->setHelp('This is the IP address that you would like to send growl '.
'notifications to.');
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'password',
'Password',
'text',
@@ -337,12 +354,12 @@ $section->addInput(new Form_Input(
['autocomplete' => 'off']
))->setHelp('Enter the e-mail address username for SMTP authentication.');
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'smtppassword',
'Notification E-Mail auth password',
'password',
$pconfig['smtppassword']
-))->setHelp('Enter the e-mail address password for SMTP authentication.');
+))->setHelp('Enter the e-mail account password for SMTP authentication.');
$section->addInput(new Form_Select(
'smtpauthmech',
diff --git a/src/usr/local/www/system_advanced_sysctl.php b/src/usr/local/www/system_advanced_sysctl.php
index bc49a63..d1c38e0 100644
--- a/src/usr/local/www/system_advanced_sysctl.php
+++ b/src/usr/local/www/system_advanced_sysctl.php
@@ -175,7 +175,7 @@ if ($savemsg) {
}
if (is_subsystem_dirty('sysctl') && ($act != "edit" )) {
- print_info_box_np(gettext("The firewall tunables have changed. You must apply the configuration for them to take affect."));
+ print_apply_box(gettext("The firewall tunables have changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php
index 9238e66..1171c7e 100644
--- a/src/usr/local/www/system_authservers.php
+++ b/src/usr/local/www/system_authservers.php
@@ -111,7 +111,7 @@ if ($act == "del") {
/* Remove server from temp list used later on this page. */
unset($a_server[$_GET['id']]);
- $savemsg = gettext("Authentication Server") . " " . htmlspecialchars($serverdeleted) . " " . gettext("deleted") . "<br />";
+ $savemsg = sprintf(gettext("Authentication Server %s deleted"), htmlspecialchars($serverdeleted));
write_config($savemsg);
}
@@ -379,11 +379,13 @@ if($_POST && $input_errors) {
include("head.inc");
-if ($input_errors)
+if ($input_errors) {
print_input_errors($input_errors);
+}
-if ($savemsg)
+if ($savemsg) {
print_info_box($savemsg, 'success');
+}
$tab_array = array();
$tab_array[] = array(gettext("Users"), false, "system_usermanager.php");
@@ -392,43 +394,47 @@ $tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.ph
$tab_array[] = array(gettext("Servers"), true, "system_authservers.php");
display_top_tabs($tab_array);
-if (!($act == "new" || $act == "edit" || $input_errors))
-{
- ?>
- <div class="table-responsive">
- <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
- <thead>
- <tr>
- <th><?=gettext("Server Name")?></th>
- <th><?=gettext("Type")?></th>
- <th><?=gettext("Host Name")?></th>
- <th><?=gettext("Actions")?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($a_server as $i => $server): ?>
- <tr>
- <td><?=htmlspecialchars($server['name'])?></td>
- <td><?=htmlspecialchars($auth_server_types[$server['type']])?></td>
- <td><?=htmlspecialchars($server['host'])?></td>
- <td>
- <?php if ($i < (count($a_server) - 1)): ?>
- <a class="fa fa-pencil" title="<?=gettext("Edit server"); ?>" href="system_authservers.php?act=edit&amp;id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext("Delete server")?>" href="system_authservers.php?act=del&amp;id=<?=$i?>"></a>
- <?php endif?>
- </td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
+if (!($act == "new" || $act == "edit" || $input_errors)) {
+?>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Authentication Servers')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
+ <thead>
+ <tr>
+ <th><?=gettext("Server Name")?></th>
+ <th><?=gettext("Type")?></th>
+ <th><?=gettext("Host Name")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach($a_server as $i => $server): ?>
+ <tr>
+ <td><?=htmlspecialchars($server['name'])?></td>
+ <td><?=htmlspecialchars($auth_server_types[$server['type']])?></td>
+ <td><?=htmlspecialchars($server['host'])?></td>
+ <td>
+ <?php if ($i < (count($a_server) - 1)): ?>
+ <a class="fa fa-pencil" title="<?=gettext("Edit server"); ?>" href="system_authservers.php?act=edit&amp;id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext("Delete server")?>" href="system_authservers.php?act=del&amp;id=<?=$i?>"></a>
+ <?php endif?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ </div>
</div>
-
- <nav class="action-buttons">
- <a href="?act=new" class="btn btn-success btn-sm">
- <i class="fa fa-plus icon-embed-btn"></i>
- <?=gettext("Add")?>
- </a>
- </nav>
+</div>
+
+<nav class="action-buttons">
+ <a href="?act=new" class="btn btn-success btn-sm">
+ <i class="fa fa-plus icon-embed-btn"></i>
+ <?=gettext("Add")?>
+ </a>
+</nav>
<?php
include("foot.inc");
exit;
diff --git a/src/usr/local/www/system_camanager.php b/src/usr/local/www/system_camanager.php
index b9e197d..d81ce00 100644
--- a/src/usr/local/www/system_camanager.php
+++ b/src/usr/local/www/system_camanager.php
@@ -128,7 +128,7 @@ if ($act == "del") {
$name = $a_ca[$id]['descr'];
unset($a_ca[$id]);
write_config();
- $savemsg = sprintf(gettext("Certificate Authority %s and its CRLs (if any) successfully deleted"), htmlspecialchars($name)) . "<br />";
+ $savemsg = sprintf(gettext("Certificate Authority %s and its CRLs (if any) successfully deleted"), htmlspecialchars($name));
pfSenseHeader("system_camanager.php");
exit;
}
@@ -246,20 +246,20 @@ if ($_POST) {
if ($pconfig['method'] != "existing") {
/* Make sure we do not have invalid characters in the fields for the certificate */
if (preg_match("/[\?\>\<\&\/\\\"\']/", $_POST['descr'])) {
- array_push($input_errors, "The field 'Descriptive Name' contains invalid characters.");
+ array_push($input_errors, gettext("The field 'Descriptive Name' contains invalid characters."));
}
for ($i = 0; $i < count($reqdfields); $i++) {
if ($reqdfields[$i] == 'dn_email') {
if (preg_match("/[\!\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST["dn_email"])) {
- array_push($input_errors, "The field 'Distinguished name Email Address' contains invalid characters.");
+ array_push($input_errors, gettext("The field 'Distinguished name Email Address' contains invalid characters."));
}
} else if ($reqdfields[$i] == 'dn_commonname') {
if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST["dn_commonname"])) {
- array_push($input_errors, "The field 'Distinguished name Common Name' contains invalid characters.");
+ array_push($input_errors, gettext("The field 'Distinguished name Common Name' contains invalid characters."));
}
} else if (($reqdfields[$i] != "descr") && preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\.\"\']/", $_POST["$reqdfields[$i]"])) {
- array_push($input_errors, "The field '" . $reqdfieldsn[$i] . "' contains invalid characters.");
+ array_push($input_errors, sprintf(gettext("The field '%s' contains invalid characters."), $reqdfieldsn[$i]));
}
}
if (!in_array($_POST["keylen"], $ca_keylens)) {
@@ -379,19 +379,22 @@ display_top_tabs($tab_array);
if (!($act == "new" || $act == "edit" || $act == gettext("Save") || $input_errors)) {
?>
-<div class="table-responsive">
-<table class="table table-striped table-hover">
- <thead>
- <tr>
- <th><?=gettext("Name")?></th>
- <th><?=gettext("Internal")?></th>
- <th><?=gettext("Issuer")?></th>
- <th><?=gettext("Certificates")?></th>
- <th><?=gettext("Distinguished Name")?></th>
- <th><?=gettext("Actions")?></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Certificate Authorities')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover">
+ <thead>
+ <tr>
+ <th><?=gettext("Name")?></th>
+ <th><?=gettext("Internal")?></th>
+ <th><?=gettext("Issuer")?></th>
+ <th><?=gettext("Certificates")?></th>
+ <th><?=gettext("Distinguished Name")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
foreach ($a_ca as $i => $ca):
$name = htmlspecialchars($ca['descr']);
@@ -427,30 +430,33 @@ foreach ($a_ca as $i => $ca):
}
}
?>
- <tr>
- <td><?=$name?></td>
- <td><?=$internal?></td>
- <td><i><?=$issuer_name?></i></td>
- <td><?=$certcount?></td>
- <td>
- <?=$subj?>
- <br />
- <small>
- <?=gettext("Valid From")?>: <b><?=$startdate ?></b><br /><?=gettext("Valid Until")?>: <b><?=$enddate ?></b>
- </small>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext("Edit")?>" href="system_camanager.php?act=edit&amp;id=<?=$i?>"></a>
- <a class="fa fa-sign-in" title="<?=gettext("Export")?>" href="system_camanager.php?act=exp&amp;id=<?=$i?>"></a>
- <?php if ($ca['prv']): ?>
- <a class="fa fa-key" title="<?=gettext("Export key")?>" href="system_camanager.php?act=expkey&amp;id=<?=$i?>"></a>
- <?php endif?>
- <a class="fa fa-trash" title="<?=gettext("Delete")?>" href="system_camanager.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ <tr>
+ <td><?=$name?></td>
+ <td><?=$internal?></td>
+ <td><i><?=$issuer_name?></i></td>
+ <td><?=$certcount?></td>
+ <td>
+ <?=$subj?>
+ <br />
+ <small>
+ <?=gettext("Valid From")?>: <b><?=$startdate ?></b><br /><?=gettext("Valid Until")?>: <b><?=$enddate ?></b>
+ </small>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext("Edit CA")?>" href="system_camanager.php?act=edit&amp;id=<?=$i?>"></a>
+ <a class="fa fa-sign-in" title="<?=gettext("Export CA")?>" href="system_camanager.php?act=exp&amp;id=<?=$i?>"></a>
+ <?php if ($ca['prv']): ?>
+ <a class="fa fa-key" title="<?=gettext("Export key")?>" href="system_camanager.php?act=expkey&amp;id=<?=$i?>"></a>
+ <?php endif?>
+ <a class="fa fa-trash" title="<?=gettext("Delete CA")?>" href="system_camanager.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php endforeach; ?>
- </tbody>
-</table>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
<nav class="action-buttons">
<a href="?act=new" class="btn btn-success btn-sm">
@@ -458,7 +464,7 @@ foreach ($a_ca as $i => $ca):
<?=gettext("Add")?>
</a>
</nav>
-<?
+<?php
include("foot.inc");
exit;
}
@@ -633,3 +639,4 @@ foreach ($a_ca as $ca) {
}
include('foot.inc');
+?>
diff --git a/src/usr/local/www/system_certmanager.php b/src/usr/local/www/system_certmanager.php
index 9fa7e51..d9cd26b 100644
--- a/src/usr/local/www/system_certmanager.php
+++ b/src/usr/local/www/system_certmanager.php
@@ -137,7 +137,7 @@ if ($act == "del") {
unset($a_cert[$id]);
write_config();
- $savemsg = sprintf(gettext("Certificate %s successfully deleted"), htmlspecialchars($a_cert[$id]['descr'])) . "<br />";
+ $savemsg = sprintf(gettext("Certificate %s successfully deleted"), htmlspecialchars($a_cert[$id]['descr']));
pfSenseHeader("system_certmanager.php");
exit;
}
@@ -247,7 +247,7 @@ if ($act == "csr") {
}
if ($_POST) {
- // This is just the blank altername name that is added for display purposes. We don't want to validate/save it
+ // This is just the blank alternate name that is added for display purposes. We don't want to validate/save it
if ($_POST['altname_value0'] == "") {
unset($_POST['altname_type0']);
unset($_POST['altname_value0']);
@@ -371,14 +371,14 @@ if ($_POST) {
for ($i = 0; $i < count($reqdfields); $i++) {
if (preg_match('/email/', $reqdfields[$i])) { /* dn_email or csr_dn_name */
if (preg_match("/[\!\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST[$reqdfields[$i]])) {
- array_push($input_errors, "The field 'Distinguished name Email Address' contains invalid characters.");
+ array_push($input_errors, gettext("The field 'Distinguished name Email Address' contains invalid characters."));
}
} else if (preg_match('/commonname/', $reqdfields[$i])) { /* dn_commonname or csr_dn_commonname */
if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST[$reqdfields[$i]])) {
- array_push($input_errors, "The field 'Distinguished name Common Name' contains invalid characters.");
+ array_push($input_errors, gettext("The field 'Distinguished name Common Name' contains invalid characters."));
}
} else if (($reqdfields[$i] != "descr") && preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\.\"\']/", $_POST[$reqdfields[$i]])) {
- array_push($input_errors, "The field '" . $reqdfieldsn[$i] . "' contains invalid characters.");
+ array_push($input_errors, sprintf(gettext("The field '%s' contains invalid characters."), $reqdfieldsn[$i]));
}
}
@@ -777,7 +777,7 @@ $section->addInput(new Form_Input(
$section->addInput(new Form_Input(
'dn_email',
'Email Address',
- 'email',
+ 'text',
$pconfig['dn_email'],
['placeholder' => 'e.g. admin@mycompany.com']
));
@@ -808,10 +808,10 @@ foreach ($pconfig['altnames']['item'] as $item) {
'Type',
$item['type'],
array(
- 'DNS' => 'FQDN or Hostname',
- 'IP' => 'IP address',
- 'URI' => 'URI',
- 'email' => 'email address',
+ 'DNS' => gettext('FQDN or Hostname'),
+ 'IP' => gettext('IP address'),
+ 'URI' => gettext('URI'),
+ 'email' => gettext('email address'),
)
))->setHelp(($counter == $numrows) ? 'Type':null);
@@ -892,7 +892,7 @@ $section->addInput(new Form_Input(
$section->addInput(new Form_Input(
'csr_dn_email',
'Email Address',
- 'email',
+ 'text',
$pconfig['csr_dn_email'],
['placeholder' => 'e.g. admin@mycompany.com']
));
@@ -994,19 +994,29 @@ print $form;
print($form);
} else {
?>
-<div class="table-responsive">
-<table class="table table-striped table-hover">
- <thead>
- <tr>
- <th><?=gettext("Name")?></th>
- <th><?=gettext("Issuer")?></th>
- <th><?=gettext("Distinguished Name")?></th>
- <th><?=gettext("In Use")?></th>
- <th class="col-sm-2"><?=gettext("Actions")?></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Certificates')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover">
+ <thead>
+ <tr>
+ <th><?=gettext("Name")?></th>
+ <th><?=gettext("Issuer")?></th>
+ <th><?=gettext("Distinguished Name")?></th>
+ <th><?=gettext("In Use")?></th>
+
+ <th class="col-sm-2"><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
+
+$pluginparams = array();
+$pluginparams['type'] = 'certificates';
+$pluginparams['event'] = 'used_certificates';
+$certificates_used_by_packages = pkg_call_plugins('plugin_certificates', $pluginparams);
+$i = 0;
foreach ($a_cert as $i => $cert):
$name = htmlspecialchars($cert['descr']);
@@ -1035,67 +1045,90 @@ foreach ($a_cert as $i => $cert):
$caname = $ca['descr'];
}
?>
- <tr>
- <td>
- <?=$name?><br />
- <?php if ($cert['type']): ?>
- <i><?=$cert_types[$cert['type']]?></i><br />
- <?php endif?>
- <?php if (is_array($purpose)): ?>
- CA: <b><?=$purpose['ca']?></b>, Server: <b><?=$purpose['server']?></b>
- <?php endif?>
- </td>
- <td><?=$caname?></td>
- <td>
- <?=$subj?>
- <?php if (!$cert['csr']): ?>
- <br />
- <small>
- <?=gettext("Valid From")?>: <b><?=$startdate ?></b><br /><?=gettext("Valid Until")?>: <b><?=$enddate ?></b>
- </small>
- <?php endif?>
- </td>
- <td>
- <?php if (is_cert_revoked($cert)): ?>
- <i>Revoked </i>
- <?php endif?>
- <?php if (is_webgui_cert($cert['refid'])): ?>
- webConfigurator
- <?php endif?>
- <?php if (is_user_cert($cert['refid'])): ?>
- User Cert
- <?php endif?>
- <?php if (is_openvpn_server_cert($cert['refid'])): ?>
- OpenVPN Server
- <?php endif?>
- <?php if (is_openvpn_client_cert($cert['refid'])): ?>
- OpenVPN Client
- <?php endif?>
- <?php if (is_ipsec_cert($cert['refid'])): ?>
- IPsec Tunnel
- <?php endif?>
- <?php if (is_captiveportal_cert($cert['refid'])): ?>
- Captive Portal
- <?php endif?>
- </td>
- <td>
- <?php if (!$cert['csr']): ?>
- <a href="system_certmanager.php?act=exp&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export Certificate")?>"></a>
- <a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
- <a href="system_certmanager.php?act=p12&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export P12")?>"> P12</a>
- <?php else: ?>
- <a href="system_certmanager.php?act=csr&amp;id=<?=$i?>" class="fa fa-pencil" title="<?=gettext("Update CSR")?>"></a>
- <a href="system_certmanager.php?act=req&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export Request")?>"></a>
- <a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
- <?php endif?>
- <?php if (!cert_in_use($cert['refid'])): ?>
- <a href="system_certmanager.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext("Delete")?>"></a>
- <?php endif?>
- </td>
- </tr>
-<?php endforeach; ?>
- </tbody>
-</table>
+ <tr>
+ <td>
+ <?=$name?><br />
+ <?php if ($cert['type']): ?>
+ <i><?=$cert_types[$cert['type']]?></i><br />
+ <?php endif?>
+ <?php if (is_array($purpose)): ?>
+ CA: <b><?=$purpose['ca']?></b>, <?=gettext("Server")?>: <b><?=$purpose['server']?></b>
+ <?php endif?>
+ </td>
+ <td><?=$caname?></td>
+ <td>
+ <?=$subj?>
+ <?php if (!$cert['csr']): ?>
+ <br />
+ <small>
+ <?=gettext("Valid From")?>: <b><?=$startdate ?></b><br /><?=gettext("Valid Until")?>: <b><?=$enddate ?></b>
+ </small>
+ <?php endif?>
+ </td>
+ <td>
+ <?php if (is_cert_revoked($cert)): ?>
+ <i><?=gettext("Revoked")?></i>
+ <?php endif?>
+ <?php if (is_webgui_cert($cert['refid'])): ?>
+ <?=gettext("webConfigurator")?>
+ <?php endif?>
+ <?php if (is_user_cert($cert['refid'])): ?>
+ <?=gettext("User Cert")?>
+ <?php endif?>
+ <?php if (is_openvpn_server_cert($cert['refid'])): ?>
+ <?=gettext("OpenVPN Server")?>
+ <?php endif?>
+ <?php if (is_openvpn_client_cert($cert['refid'])): ?>
+ <?=gettext("OpenVPN Client")?>
+ <?php endif?>
+ <?php if (is_ipsec_cert($cert['refid'])): ?>
+ <?=gettext("IPsec Tunnel")?>
+ <?php endif?>
+ <?php if (is_captiveportal_cert($cert['refid'])): ?>
+ <?=gettext("Captive Portal")?>
+ <?php endif?>
+<?php
+ $refid = $cert['refid'];
+ if (is_array($certificates_used_by_packages)) {
+ foreach ($certificates_used_by_packages as $name => $package) {
+ if (isset($package['certificatelist'][$refid])) {
+ $hint = "" ;
+ if (is_array($package['certificatelist'][$refid])) {
+ foreach ($package['certificatelist'][$refid] as $cert_used) {
+ $hint = $hint . $cert_used['usedby']."\n";
+ }
+ }
+ $count = count($package['certificatelist'][$refid]);
+ echo "<div title='".htmlspecialchars($hint)."'>";
+ echo htmlspecialchars($package['pkgname'])." ($count)<br />";
+ echo "</div>";
+ }
+ }
+ }
+?>
+ </td>
+ <td>
+ <?php if (!$cert['csr']): ?>
+ <a href="system_certmanager.php?act=exp&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export Certificate")?>"></a>
+ <a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
+ <a href="system_certmanager.php?act=p12&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export P12")?>"> P12</a>
+ <?php else: ?>
+ <a href="system_certmanager.php?act=csr&amp;id=<?=$i?>" class="fa fa-pencil" title="<?=gettext("Update CSR")?>"></a>
+ <a href="system_certmanager.php?act=req&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export Request")?>"></a>
+ <a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
+ <?php endif?>
+ <?php if (!cert_in_use($cert['refid'])): ?>
+ <a href="system_certmanager.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext("Delete Certificate")?>"></a>
+ <?php endif?>
+ </td>
+ </tr>
+<?php
+ $i++;
+ endforeach; ?>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
<nav class="action-buttons">
@@ -1104,7 +1137,7 @@ foreach ($a_cert as $i => $cert):
<?=gettext("Add")?>
</a>
</nav>
-<?
+<?php
include("foot.inc");
exit;
}
diff --git a/src/usr/local/www/system_crlmanager.php b/src/usr/local/www/system_crlmanager.php
index e2ef21e..650ea20 100644
--- a/src/usr/local/www/system_crlmanager.php
+++ b/src/usr/local/www/system_crlmanager.php
@@ -123,7 +123,7 @@ if (!$thiscrl && (($act != "") && ($act != "new"))) {
if ($act == "del") {
$name = htmlspecialchars($thiscrl['descr']);
if (crl_in_use($id)) {
- $savemsg = sprintf(gettext("Certificate Revocation List %s is in use and cannot be deleted"), $name) . "<br />";
+ $savemsg = sprintf(gettext("Certificate Revocation List %s is in use and cannot be deleted"), $name);
} else {
foreach ($a_crl as $cid => $acrl) {
if ($acrl['refid'] == $thiscrl['refid']) {
@@ -131,7 +131,7 @@ if ($act == "del") {
}
}
write_config("Deleted CRL {$name}.");
- $savemsg = sprintf(gettext("Certificate Revocation List %s successfully deleted"), $name) . "<br />";
+ $savemsg = sprintf(gettext("Certificate Revocation List %s successfully deleted"), $name);
}
}
@@ -212,13 +212,13 @@ if ($act == "delcert") {
$certname = htmlspecialchars($thiscert['descr']);
$crlname = htmlspecialchars($thiscrl['descr']);
if (cert_unrevoke($thiscert, $thiscrl)) {
- $savemsg = sprintf(gettext("Deleted Certificate %s from CRL %s"), $certname, $crlname) . "<br />";
+ $savemsg = sprintf(gettext("Deleted Certificate %s from CRL %s"), $certname, $crlname);
// refresh IPsec and OpenVPN CRLs
openvpn_refresh_crls();
vpn_ipsec_configure();
- write_config(sprintf(gettext("Deleted Certificate %s from CRL %s"), $certname, $crlname));
+ write_config($savemsg);
} else {
- $savemsg = sprintf(gettext("Failed to delete Certificate %s from CRL %s"), $certname, $crlname) . "<br />";
+ $savemsg = sprintf(gettext("Failed to delete Certificate %s from CRL %s"), $certname, $crlname);
}
$act="edit";
}
@@ -364,7 +364,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg, 'sucess');
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
diff --git a/src/usr/local/www/system_gateway_groups.php b/src/usr/local/www/system_gateway_groups.php
index 1ccf60f..cd21fd4 100644
--- a/src/usr/local/www/system_gateway_groups.php
+++ b/src/usr/local/www/system_gateway_groups.php
@@ -106,7 +106,7 @@ if ($_POST) {
if ($_GET['act'] == "del") {
if ($a_gateway_groups[$_GET['id']]) {
- $changedesc .= gettext("removed gateway group") . " {$_GET['id']}";
+ $changedesc .= sprintf(gettext("removed gateway group %s"), $_GET['id']);
foreach ($config['filter']['rule'] as $idx => $rule) {
if ($rule['gateway'] == $a_gateway_groups[$_GET['id']]['name']) {
unset($config['filter']['rule'][$idx]['gateway']);
@@ -131,7 +131,7 @@ if ($savemsg) {
}
if (is_subsystem_dirty('staticroutes')) {
- print_info_box_np(sprintf(gettext("The gateway configuration has been changed.%sYou must apply the changes in order for them to take effect."), "<br />"));
+ print_apply_box(gettext("The gateway configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -140,58 +140,62 @@ $tab_array[] = array(gettext("Static Routes"), false, "system_routes.php");
$tab_array[] = array(gettext("Gateway Groups"), true, "system_gateway_groups.php");
display_top_tabs($tab_array);
?>
-
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed">
- <thead>
- <tr>
- <th><?=gettext("Group Name")?></th>
- <th><?=gettext("Gateways")?></th>
- <th><?=gettext("Priority")?></th>
- <th><?=gettext("Description")?></th>
- <th><?=gettext("Actions")?></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Gateway Groups')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th><?=gettext("Group Name")?></th>
+ <th><?=gettext("Gateways")?></th>
+ <th><?=gettext("Priority")?></th>
+ <th><?=gettext("Description")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
$i = 0;
foreach ($a_gateway_groups as $gateway_group):
?>
- <tr>
- <td>
- <?=$gateway_group['name']?>
- </td>
- <td>
+ <tr>
+ <td>
+ <?=$gateway_group['name']?>
+ </td>
+ <td>
<?php
foreach ($gateway_group['item'] as $item) {
$itemsplit = explode("|", $item);
print(htmlspecialchars(strtoupper($itemsplit[0])) . "<br />\n");
}
?>
- </td>
- <td>
+ </td>
+ <td>
<?php
foreach ($gateway_group['item'] as $item) {
$itemsplit = explode("|", $item);
print("Tier ". htmlspecialchars($itemsplit[1]) . "<br />\n");
}
?>
- </td>
- <td>
- <?=htmlspecialchars($gateway_group['descr'])?>
- </td>
- <td>
- <a href="system_gateway_groups_edit.php?id=<?=$i?>" class="fa fa-pencil" title="<?=gettext('Edit')?>"></a>
- <a href="system_gateway_groups_edit.php?dup=<?=$i?>" class="fa fa-clone" title="<?=gettext('Copy')?>"></a>
- <a href="system_gateway_groups.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext('Delete')?>"></a>
- </td>
- </tr>
+ </td>
+ <td>
+ <?=htmlspecialchars($gateway_group['descr'])?>
+ </td>
+ <td>
+ <a href="system_gateway_groups_edit.php?id=<?=$i?>" class="fa fa-pencil" title="<?=gettext('Edit gateway group')?>"></a>
+ <a href="system_gateway_groups_edit.php?dup=<?=$i?>" class="fa fa-clone" title="<?=gettext('Copy gateway group')?>"></a>
+ <a href="system_gateway_groups.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext('Delete gateway group')?>"></a>
+ </td>
+ </tr>
<?php
$i++;
endforeach;
?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
<nav class="action-buttons">
@@ -201,10 +205,10 @@ endforeach;
</a>
</nav>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(gettext('Remember to use these Gateway Groups in firewall rules in order to enable load balancing, failover, ' .
'or policy-based routing.' . '<br />' .
- 'Without rules directing traffic into the Gateway Groups, they will not be used.'), info)?>
+ 'Without rules directing traffic into the Gateway Groups, they will not be used.'), 'info', false)?>
</div>
<?php
include("foot.inc");
diff --git a/src/usr/local/www/system_gateway_groups_edit.php b/src/usr/local/www/system_gateway_groups_edit.php
index 4b0e1e6..c28fa8d 100644
--- a/src/usr/local/www/system_gateway_groups_edit.php
+++ b/src/usr/local/www/system_gateway_groups_edit.php
@@ -146,7 +146,7 @@ if ($_POST) {
}
/* check for overlaps */
if ($_POST['name'] == $gwname) {
- $input_errors[] = sprintf(gettext('A gateway group cannot have the same name with a gateway "%s" please choose another name.'), $_POST['name']);
+ $input_errors[] = sprintf(gettext('A gateway group cannot have the same name as a gateway "%s" please choose another name.'), $_POST['name']);
}
}
@@ -268,17 +268,18 @@ foreach ($a_gateways as $gwname => $gateway) {
))->setHelp($row == $numrows ? 'Gateway':null)
->setReadonly();
+ $tr = gettext("Tier");
$group->add(new Form_Select(
$gwname,
'Tier',
$selected,
array(
'0' => 'Never',
- '1' => 'Tier 1',
- '2' => 'Tier 2',
- '3' => 'Tier 3',
- '4' => 'Tier 4',
- '5' => 'Tier 5'
+ '1' => $tr . ' 1',
+ '2' => $tr . ' 2',
+ '3' => $tr . ' 3',
+ '4' => $tr . ' 4',
+ '5' => $tr . ' 5'
)
))->setHelp($row == $numrows ? 'Tier':null)->addClass('row')->addClass($gateway['ipprotocol']);
@@ -329,10 +330,10 @@ $section->addInput(new Form_Select(
'Trigger Level',
$pconfig['trigger'],
array(
- '0' => 'Member down',
- '1' => 'Packet Loss',
- '2' => 'High Latency',
- '3' => 'Packet Loss or High latency'
+ '0' => gettext('Member down'),
+ '1' => gettext('Packet Loss'),
+ '2' => gettext('High Latency'),
+ '3' => gettext('Packet Loss or High latency')
)
))->setHelp('When to trigger exclusion of a member');
diff --git a/src/usr/local/www/system_gateways.php b/src/usr/local/www/system_gateways.php
index 0a6905f..b28c727 100644
--- a/src/usr/local/www/system_gateways.php
+++ b/src/usr/local/www/system_gateways.php
@@ -88,6 +88,7 @@ if ($_POST) {
$retval = 0;
$retval = system_routing_configure();
+ $retval |= system_resolvconf_generate();
$retval |= filter_configure();
/* reconfigure our gateway monitor */
setup_gateways_monitor();
@@ -114,9 +115,9 @@ function can_delete_disable_gateway_item($id, $disable = false) {
$items = explode("|", $item);
if ($items[0] == $a_gateways[$id]['name']) {
if (!$disable) {
- $input_errors[] = sprintf(gettext("Gateway '%s' cannot be deleted because it is in use on Gateway Group '%s'"), $a_gateways[$id]['name'], $group['name']);
+ $input_errors[] = sprintf(gettext('Gateway "%1$s" cannot be deleted because it is in use on Gateway Group "%2$s"'), $a_gateways[$id]['name'], $group['name']);
} else {
- $input_errors[] = sprintf(gettext("Gateway '%s' cannot be disabled because it is in use on Gateway Group '%s'"), $a_gateways[$id]['name'], $group['name']);
+ $input_errors[] = sprintf(gettext('Gateway "%1$s" cannot be disabled because it is in use on Gateway Group "%2$s"'), $a_gateways[$id]['name'], $group['name']);
}
}
}
@@ -128,11 +129,11 @@ function can_delete_disable_gateway_item($id, $disable = false) {
if ($route['gateway'] == $a_gateways[$id]['name']) {
if (!$disable) {
// The user wants to delete this gateway, but there is a static route (enabled or disabled) that refers to the gateway.
- $input_errors[] = sprintf(gettext("Gateway '%s' cannot be deleted because it is in use on Static Route '%s'"), $a_gateways[$id]['name'], $route['network']);
+ $input_errors[] = sprintf(gettext('Gateway "%1$s" cannot be deleted because it is in use on Static Route "%2$s"'), $a_gateways[$id]['name'], $route['network']);
} else if (!isset($route['disabled'])) {
// The user wants to disable this gateway.
// But there is a static route that uses this gateway and is enabled (not disabled).
- $input_errors[] = sprintf(gettext("Gateway '%s' cannot be disabled because it is in use on Static Route '%s'"), $a_gateways[$id]['name'], $route['network']);
+ $input_errors[] = sprintf(gettext('Gateway "%1$s" cannot be disabled because it is in use on Static Route "%2$s"'), $a_gateways[$id]['name'], $route['network']);
}
}
}
@@ -207,7 +208,7 @@ if (isset($_POST['del_x'])) {
$items_deleted .= "{$rulei} ";
}
if (!empty($items_deleted)) {
- write_config("Gateways: removed gateways {$items_deleted}");
+ write_config(sprintf(gettext("Gateways: removed gateways %s", $items_deleted)));
mark_subsystem_dirty('staticroutes');
}
header("Location: system_gateways.php");
@@ -254,7 +255,7 @@ if ($savemsg) {
}
if (is_subsystem_dirty('staticroutes')) {
- print_info_box_np(gettext("The gateway configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The gateway configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -264,19 +265,23 @@ $tab_array[2] = array(gettext("Gateway Groups"), false, "system_gateway_groups.p
display_top_tabs($tab_array);
?>
-<table class="table">
-<thead>
- <tr>
- <th></th>
- <th><?=gettext("Name")?></th>
- <th><?=gettext("Interface")?></th>
- <th><?=gettext("Gateway")?></th>
- <th><?=gettext("Monitor IP")?></th>
- <th><?=gettext("Description")?></th>
- <th><?=gettext("Actions")?></th>
- </tr>
-</thead>
-<tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Gateways')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped tabel-hover table-condensed">
+ <thead>
+ <tr>
+ <th></th>
+ <th><?=gettext("Name")?></th>
+ <th><?=gettext("Interface")?></th>
+ <th><?=gettext("Gateway")?></th>
+ <th><?=gettext("Monitor IP")?></th>
+ <th><?=gettext("Description")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
foreach ($a_gateways as $i => $gateway):
if (isset($gateway['inactive'])) {
@@ -293,49 +298,52 @@ foreach ($a_gateways as $i => $gateway):
$title = '';
}
?>
- <tr<?=($icon != 'fa-check-circle-o')? ' class="disabled"' : ''?>>
- <td title="<?=$title?>"><i class="fa <?=$icon?>"></i></td>
- <td>
- <?=htmlspecialchars($gateway['name'])?>
+ <tr<?=($icon != 'fa-check-circle-o')? ' class="disabled"' : ''?>>
+ <td title="<?=$title?>"><i class="fa <?=$icon?>"></i></td>
+ <td>
+ <?=htmlspecialchars($gateway['name'])?>
<?php
if (isset($gateway['defaultgw'])) {
echo " <strong>(default)</strong>";
}
?>
- </td>
- <td>
- <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($gateway['friendlyiface']))?>
- </td>
- <td>
- <?=htmlspecialchars($gateway['gateway'])?>
- </td>
- <td>
- <?=htmlspecialchars($gateway['monitor'])?>
- </td>
- <td>
- <?=htmlspecialchars($gateway['descr'])?>
- </td>
- <td>
- <a href="system_gateways_edit.php?id=<?=$i?>" class="fa fa-pencil" title="<?=gettext('Edit');?>"></a>
- <a href="system_gateways_edit.php?dup=<?=$i?>" class="fa fa-clone" title="<?=gettext('Copy')?>"></a>
-
-<? if (is_numeric($gateway['attribute'])): ?>
+ </td>
+ <td>
+ <?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($gateway['friendlyiface']))?>
+ </td>
+ <td>
+ <?=htmlspecialchars($gateway['gateway'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($gateway['monitor'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($gateway['descr'])?>
+ </td>
+ <td>
+ <a href="system_gateways_edit.php?id=<?=$i?>" class="fa fa-pencil" title="<?=gettext('Edit gateway');?>"></a>
+ <a href="system_gateways_edit.php?dup=<?=$i?>" class="fa fa-clone" title="<?=gettext('Copy gateway')?>"></a>
+
+<?php if (is_numeric($gateway['attribute'])): ?>
<?php if (isset($gateway['disabled'])) {
?>
- <a href="?act=toggle&amp;id=<?=$i?>" class="fa fa-check-square-o" title="<?=gettext('Enable')?>"></a>
+ <a href="?act=toggle&amp;id=<?=$i?>" class="fa fa-check-square-o" title="<?=gettext('Enable gateway')?>"></a>
<?php } else {
?>
- <a href="?act=toggle&amp;id=<?=$i?>" class="fa fa-ban" title="<?=gettext('Disable')?>"></a>
+ <a href="?act=toggle&amp;id=<?=$i?>" class="fa fa-ban" title="<?=gettext('Disable gateway')?>"></a>
<?php }
?>
- <a href="system_gateways.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext('Delete')?>"></a>
-
-<? endif?>
- </td>
- </tr>
-<? endforeach?>
-</tbody>
-</table>
+ <a href="system_gateways.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext('Delete gateway')?>"></a>
+
+<?php endif; ?>
+ </td>
+ </tr>
+<?php endforeach; ?>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
<nav class="action-buttons">
<a href="system_gateways_edit.php" role="button" class="btn btn-success">
diff --git a/src/usr/local/www/system_gateways_edit.php b/src/usr/local/www/system_gateways_edit.php
index 25441e5..a926190 100644
--- a/src/usr/local/www/system_gateways_edit.php
+++ b/src/usr/local/www/system_gateways_edit.php
@@ -117,6 +117,7 @@ if (isset($id) && $a_gateways[$id]) {
$pconfig['losshigh'] = $a_gateways[$id]['losshigh'];
$pconfig['monitor'] = $a_gateways[$id]['monitor'];
$pconfig['monitor_disable'] = isset($a_gateways[$id]['monitor_disable']);
+ $pconfig['data_payload'] = $a_gateways[$id]['data_payload'];
$pconfig['nonlocalgateway'] = isset($a_gateways[$id]['nonlocalgateway']);
$pconfig['descr'] = $a_gateways[$id]['descr'];
$pconfig['attribute'] = $a_gateways[$id]['attribute'];
@@ -155,7 +156,7 @@ if ($_POST) {
foreach ($group['item'] as $item) {
$items = explode("|", $item);
if ($items[0] == $_POST['name']) {
- $input_errors[] = sprintf(gettext("Gateway '%s' cannot be disabled because it is in use on Gateway Group '%s'"), $_POST['name'], $group['name']);
+ $input_errors[] = sprintf(gettext('Gateway "%1$s" cannot be disabled because it is in use on Gateway Group "%2$s"'), $_POST['name'], $group['name']);
}
}
}
@@ -167,7 +168,7 @@ if ($_POST) {
if ($route['gateway'] == $_POST['name']) {
if (!isset($route['disabled'])) {
// There is a static route that uses this gateway and is enabled (not disabled).
- $input_errors[] = sprintf(gettext("Gateway '%s' cannot be disabled because it is in use on Static Route '%s'"), $_POST['name'], $route['network']);
+ $input_errors[] = sprintf(gettext('Gateway "%1$s" cannot be disabled because it is in use on Static Route "%2$s"'), $_POST['name'], $route['network']);
}
}
}
@@ -256,22 +257,25 @@ if ($_POST) {
if (($_POST['monitor'] != "") && !is_ipaddr($_POST['monitor']) && $_POST['monitor'] != "dynamic") {
$input_errors[] = gettext("A valid monitor IP address must be specified.");
}
+ if (isset($_POST['data_payload']) && is_numeric($_POST['data_payload']) && $_POST['data_payload'] < 0) {
+ $input_errors[] = gettext("A valid data payload must be specified.");
+ }
/* only allow correct IPv4 and IPv6 gateway addresses */
if (($_POST['gateway'] <> "") && is_ipaddr($_POST['gateway']) && $_POST['gateway'] != "dynamic") {
if (is_ipaddrv6($_POST['gateway']) && ($_POST['ipprotocol'] == "inet")) {
- $input_errors[] = gettext("The IPv6 gateway address '{$_POST['gateway']}' can not be used as a IPv4 gateway'.");
+ $input_errors[] = sprintf(gettext("The IPv6 gateway address '%s' can not be used as a IPv4 gateway."), $_POST['gateway']);
}
if (is_ipaddrv4($_POST['gateway']) && ($_POST['ipprotocol'] == "inet6")) {
- $input_errors[] = gettext("The IPv4 gateway address '{$_POST['gateway']}' can not be used as a IPv6 gateway'.");
+ $input_errors[] = sprintf(gettext("The IPv4 gateway address '%s' can not be used as a IPv6 gateway."), $_POST['gateway']);
}
}
/* only allow correct IPv4 and IPv6 monitor addresses */
if (($_POST['monitor'] <> "") && is_ipaddr($_POST['monitor']) && $_POST['monitor'] != "dynamic") {
if (is_ipaddrv6($_POST['monitor']) && ($_POST['ipprotocol'] == "inet")) {
- $input_errors[] = gettext("The IPv6 monitor address '{$_POST['monitor']}' can not be used on a IPv4 gateway'.");
+ $input_errors[] = sprintf(gettext("The IPv6 monitor address '%s' can not be used on a IPv4 gateway."), $_POST['monitor']);
}
if (is_ipaddrv4($_POST['monitor']) && ($_POST['ipprotocol'] == "inet6")) {
- $input_errors[] = gettext("The IPv4 monitor address '{$_POST['monitor']}' can not be used on a IPv6 gateway'.");
+ $input_errors[] = sprintf(gettext("The IPv4 monitor address '%s' can not be used on a IPv6 gateway."), $_POST['monitor']);
}
}
@@ -415,16 +419,16 @@ if ($_POST) {
} else if ($_POST['latencyhigh']) {
if (is_numeric($_POST['latencyhigh']) &&
($_POST['latencyhigh'] > $dpinger_default['loss_interval'])) {
- $input_errors[] = gettext(sprintf(
- "The high latency threshold needs to be less than or equal to the default loss interval (%d)",
- $dpinger_default['loss_interval']));
+ $input_errors[] = sprintf(
+ gettext("The high latency threshold needs to be less than or equal to the default loss interval (%d)"),
+ $dpinger_default['loss_interval']);
}
} else if ($_POST['loss_interval']) {
if (is_numeric($_POST['loss_interval']) &&
($_POST['loss_interval'] < $dpinger_default['latencyhigh'])) {
- $input_errors[] = gettext(sprintf(
- "The loss interval needs to be greater than or equal to the default high latency threshold (%d)",
- $dpinger_default['latencyhigh']));
+ $input_errors[] = sprintf(
+ gettext("The loss interval needs to be greater than or equal to the default high latency threshold (%d)"),
+ $dpinger_default['latencyhigh']);
}
}
@@ -447,16 +451,16 @@ if ($_POST) {
} else if ($_POST['interval']) {
if (is_numeric($_POST['interval']) &&
(($_POST['interval'] * 2) > $dpinger_default['time_period'])) {
- $input_errors[] = gettext(sprintf(
- "The probe interval needs to be half or less than the default time period over which results are averaged (%d)",
- $dpinger_default['time_period']));
+ $input_errors[] = sprintf(
+ gettext("The probe interval needs to be half or less than the default time period over which results are averaged (%d)"),
+ $dpinger_default['time_period']);
}
} else if ($_POST['time_period']) {
if (is_numeric($_POST['time_period']) &&
($_POST['time_period'] < ($dpinger_default['interval'] * 2))) {
- $input_errors[] = gettext(sprintf(
- "The time period over which results are averaged needs to be at least twice the default probe interval (%d)",
- $dpinger_default['interval']));
+ $input_errors[] = sprintf(
+ gettext("The time period over which results are averaged needs to be at least twice the default probe interval (%d)"),
+ $dpinger_default['interval']);
}
}
@@ -479,16 +483,16 @@ if ($_POST) {
} else if ($_POST['interval']) {
if (is_numeric($_POST['interval']) &&
($_POST['interval'] > $dpinger_default['alert_interval'])) {
- $input_errors[] = gettext(sprintf(
- "The probe interval needs to be less than or equal to the default alert interval (%d)",
- $dpinger_default['alert_interval']));
+ $input_errors[] = sprintf(
+ gettext("The probe interval needs to be less than or equal to the default alert interval (%d)"),
+ $dpinger_default['alert_interval']);
}
} else if ($_POST['alert_interval']) {
if (is_numeric($_POST['alert_interval']) &&
($_POST['alert_interval'] < $dpinger_default['interval'])) {
- $input_errors[] = gettext(sprintf(
- "The alert interval needs to be greater than or equal to the default probe interval (%d)",
- $dpinger_default['interval']));
+ $input_errors[] = sprintf(
+ gettext("The alert interval needs to be greater than or equal to the default probe interval (%d)"),
+ $dpinger_default['interval']);
}
}
@@ -533,6 +537,9 @@ if ($_POST) {
if (is_ipaddr($_POST['monitor'])) {
$gateway['monitor'] = $_POST['monitor'];
}
+ if (isset($_POST['data_payload']) && $_POST['data_payload'] > 0) {
+ $gateway['data_payload'] = $_POST['data_payload'];
+ }
/* NOTE: If gateway ip is changed need to cleanup the old static interface route */
if ($_POST['monitor'] != "dynamic" && !empty($a_gateway_item[$realid]) && is_ipaddr($a_gateway_item[$realid]['gateway']) &&
@@ -699,12 +706,20 @@ $section->addInput(new Form_Input(
$pconfig['name']
))->setHelp('Gateway name');
-$section->addInput(new Form_Input(
+$egw = new Form_Input(
'gateway',
'Gateway',
'text',
($pconfig['dynamic'] ? 'dynamic' : $pconfig['gateway'])
-))->setHelp('Gateway IP address');
+);
+
+$egw->setHelp('Gateway IP address');
+
+if ($pconfig['dynamic']) {
+ $egw->setReadonly();
+}
+
+$section->addInput($egw);
$section->addInput(new Form_Checkbox(
'defaultgw',
@@ -754,7 +769,7 @@ $section->addInput(new Form_Input(
// If any of the advanced options are non-default, we will not show the "Advanced" button
// and will display the advanced section
if (!(!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) ||
- !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) ||
+ !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || !empty($pconfig['data_payload']) ||
(isset($pconfig['weight']) && $pconfig['weight'] > 1) ||
(isset($pconfig['interval']) && !($pconfig['interval'] == $dpinger_default['interval'])) ||
(isset($pconfig['loss_interval']) && !($pconfig['loss_interval'] == $dpinger_default['loss_interval'])) ||
@@ -794,6 +809,14 @@ $section->addInput(new Form_Select(
array_combine(range(1, 5), range(1, 5))
))->setHelp('Weight for this gateway when used in a Gateway Group.');
+$section->addInput(new Form_Input(
+ 'data_payload',
+ 'Data Payload',
+ 'number',
+ $pconfig['data_payload'],
+ ['placeholder' => $dpinger_default['data_payload']]
+))->setHelp('Define data payload to send on ICMP packets to gateway monitor IP.');
+
$group = new Form_Group('Latency thresholds');
$group->add(new Form_Input(
'latencylow',
@@ -885,7 +908,7 @@ $group->setHelp('Time interval in milliseconds between checking for an alert con
$section->add($group);
$section->addInput(new Form_StaticText(
- 'Additional information',
+ gettext('Additional information'),
'<span class="help-block">'.
gettext('The time period over which results are averaged must be at least twice ' .
'the probe interval, otherwise the averaging would only "average" over a single probe.') .
diff --git a/src/usr/local/www/system_groupmanager.php b/src/usr/local/www/system_groupmanager.php
index a934ad3..07df162 100644
--- a/src/usr/local/www/system_groupmanager.php
+++ b/src/usr/local/www/system_groupmanager.php
@@ -265,7 +265,7 @@ if ($input_errors) {
print_input_errors($input_errors);
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
@@ -277,17 +277,20 @@ display_top_tabs($tab_array);
if (!($_GET['act'] == "new" || $_GET['act'] == "edit")) {
?>
- <div class="table-responsive">
- <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
- <thead>
- <tr>
- <th><?=gettext("Group name")?></th>
- <th><?=gettext("Description")?></th>
- <th><?=gettext("Member Count")?></th>
- <th><?=gettext("Actions")?></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Groups')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
+ <thead>
+ <tr>
+ <th><?=gettext("Group name")?></th>
+ <th><?=gettext("Description")?></th>
+ <th><?=gettext("Member Count")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
foreach ($a_group as $i => $group):
if ($group["name"] == "all") {
@@ -296,36 +299,38 @@ if (!($_GET['act'] == "new" || $_GET['act'] == "edit")) {
$groupcount = count($group['member']);
}
?>
- <tr>
- <td>
- <?=htmlspecialchars($group['name'])?>
- </td>
- <td>
- <?=htmlspecialchars($group['description'])?>
- </td>
- <td>
- <?=$groupcount?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext("Edit group"); ?>" href="?act=edit&amp;groupid=<?=$i?>"></a>
- <?php if ($group['scope'] != "system"): ?>
- <a class="fa fa-trash" title="<?=gettext("Delete group")?>" href="?act=delgroup&amp;groupid=<?=$i?>&amp;groupname=<?=$group['name']?>"></a>
- <?php endif;?>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?=htmlspecialchars($group['name'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($group['description'])?>
+ </td>
+ <td>
+ <?=$groupcount?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext("Edit group"); ?>" href="?act=edit&amp;groupid=<?=$i?>"></a>
+ <?php if ($group['scope'] != "system"): ?>
+ <a class="fa fa-trash" title="<?=gettext("Delete group")?>" href="?act=delgroup&amp;groupid=<?=$i?>&amp;groupname=<?=$group['name']?>"></a>
+ <?php endif;?>
+ </td>
+ </tr>
<?php
endforeach;
?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
</div>
-
- <nav class="action-buttons">
- <a href="?act=new" class="btn btn-success btn-sm">
- <i class="fa fa-plus icon-embed-btn"></i>
- <?=gettext("Add")?>
- </a>
- </nav>
+</div>
+
+<nav class="action-buttons">
+ <a href="?act=new" class="btn btn-success btn-sm">
+ <i class="fa fa-plus icon-embed-btn"></i>
+ <?=gettext("Add")?>
+ </a>
+</nav>
<?php
include('foot.inc');
exit;
diff --git a/src/usr/local/www/system_groupmanager_addprivs.php b/src/usr/local/www/system_groupmanager_addprivs.php
index 5882727..e1ae561 100644
--- a/src/usr/local/www/system_groupmanager_addprivs.php
+++ b/src/usr/local/www/system_groupmanager_addprivs.php
@@ -150,7 +150,7 @@ if ($_POST) {
/* if ajax is calling, give them an update message */
if (isAjax()) {
- print_info_box_np($savemsg);
+ print_info_box($savemsg, 'success');
}
function build_priv_list() {
@@ -176,7 +176,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg, success);
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
@@ -207,8 +207,46 @@ $section->addInput(new Form_Select(
$a_group['priv'],
build_priv_list(),
true
-))->addClass('multiselect')->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.')->setAttribute('style', 'height:400px;');
+))->addClass('multiselect')
+ ->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.');
+$section->addInput(new Form_Select(
+ 'shadow',
+ 'Shadow',
+ null,
+ build_priv_list(),
+ true
+))->addClass('shadowselect')
+ ->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items');
+
+$section->addInput(new Form_Input(
+ 'filtertxt',
+ 'Filter',
+ 'text',
+ null
+))->setHelp('Show only the choices containing this term');
+
+$btnfilter = new Form_Button(
+ 'btnfilter',
+ 'Filter',
+ null,
+ 'fa-filter'
+);
+
+$btnfilter->addClass('btn btn-info');
+
+$form->addGlobal($btnfilter);
+
+$btnclear = new Form_Button(
+ 'btnclear',
+ 'Clear',
+ null,
+ 'fa-times'
+);
+
+$btnclear->addClass('btn btn-warning');
+
+$form->addGlobal($btnclear);
$form->add($section);
print $form;
@@ -240,12 +278,87 @@ events.push(function() {
echo $jdescs;
}
?>
+ $('.shadowselect').parent().parent('div').addClass('hidden');
+
// Set the number of options to display
$('.multiselect').attr("size","20");
+ $('.shadowselect').attr("size","20");
// When the 'sysprivs" selector is clicked, we display a description
$('.multiselect').click(function() {
- $('#pdesc').html('<span style="color: green;">' + descs[$(this).children('option:selected').index()] + '</span>');
+ $('#pdesc').html('<span class="text-info">' + descs[$(this).children('option:selected').index()] + '</span>');
+
+ // and update the shadow list from the real list
+ $(".multiselect option").each(function() {
+ shadowoption = $('.shadowselect option').filter('[value=' + $(this).val() + ']');
+
+ if ($(this).is(':selected')) {
+ shadowoption.prop("selected", true);
+ } else {
+ shadowoption.prop("selected", false);
+ }
+ });
+ });
+
+ $('#btnfilter').prop('type', 'button');
+
+ $('#btnfilter').click(function() {
+ searchterm = $('#filtertxt').val().toLowerCase();
+ copyselect(true);
+
+ // Then filter
+ $(".multiselect > option").each(function() {
+ if (this.text.toLowerCase().indexOf(searchterm) == -1 ) {
+ $(this).remove();
+ }
+ });
+ });
+
+ $('#btnclear').prop('type', 'button');
+
+ $('#btnclear').click(function() {
+ // Copy all options from shadow to sysprivs
+ copyselect(true)
+
+ $('#filtertxt').val('');
+ });
+
+ $('#filtertxt').keypress(function(e) {
+ if(e.which == 13) {
+ e.preventDefault();
+ $('#btnfilter').trigger('click');
+ }
+ });
+
+ // On submit unhide all options (or else they will not submit)
+ $('form').submit(function() {
+
+ $(".multiselect > option").each(function() {
+ $(this).show();
+ });
+
+ $('.shadowselect').remove();
+ });
+
+ function copyselect(selected) {
+ // Copy all optionsfrom shadow to sysprivs
+ $('.multiselect').html($('.shadowselect').html());
+
+ if (selected) {
+ // Update the shadow list from the real list
+ $(".shadowselect option").each(function() {
+ multioption = $('.multiselect option').filter('[value=' + $(this).val() + ']');
+ if ($(this).is(':selected')) {
+ multioption.prop("selected", true);
+ } else {
+ multioption.prop("selected", false);
+ }
+ });
+ }
+ }
+
+ $('.multiselect').mouseup(function () {
+ $('.multiselect').trigger('click');
});
});
//]]>
diff --git a/src/usr/local/www/system_hasync.php b/src/usr/local/www/system_hasync.php
index f5aca57..f078910 100755
--- a/src/usr/local/www/system_hasync.php
+++ b/src/usr/local/www/system_hasync.php
@@ -95,15 +95,31 @@ if ($_POST) {
foreach ($checkbox_names as $name) {
$a_hasync[$name] = $pconfig[$name] ? $pconfig[$name] : false;
}
- $a_hasync['pfsyncpeerip'] = $pconfig['pfsyncpeerip'];
+ $a_hasync['pfsyncpeerip'] = $pconfig['pfsyncpeerip'];
$a_hasync['pfsyncinterface'] = $pconfig['pfsyncinterface'];
$a_hasync['synchronizetoip'] = $pconfig['synchronizetoip'];
- $a_hasync['username'] = $pconfig['username'];
- $a_hasync['password'] = $pconfig['passwordfld'];
- write_config("Updated High Availability Sync configuration");
- interfaces_sync_setup();
- header("Location: system_hasync.php");
- exit();
+ $a_hasync['username'] = $pconfig['username'];
+
+ if ($pconfig['passwordfld'] == $pconfig['passwordfld_confirm']) {
+ if ($pconfig['passwordfld'] != DMYPWD) {
+ $a_hasync['password'] = $pconfig['passwordfld'];
+ }
+ } else {
+ $input_errors[] = gettext("Password and confirmation must match.");
+ }
+
+ if ($pconfig['pfsyncpeerip'] != "") {
+ if (!is_ipaddrv4($pconfig['pfsyncpeerip'])) {
+ $input_errors[] = gettext("pfsync Synchronize Peer IP must be an IPv4 IP.");
+ }
+ }
+
+ if (!$input_errors) {
+ write_config("Updated High Availability Sync configuration");
+ interfaces_sync_setup();
+ header("Location: system_hasync.php");
+ exit();
+ }
}
foreach ($checkbox_names as $name) {
@@ -129,6 +145,10 @@ foreach ($ifaces as $ifname => $iface) {
include("head.inc");
+if ($input_errors) {
+ print_input_errors($input_errors);
+}
+
$form = new Form;
$section = new Form_Section('State Synchronization Settings (pfsync)');
@@ -184,7 +204,7 @@ $section->addInput(new Form_Input(
))->setHelp('Enter the webConfigurator username of the system entered above for synchronizing your configuration.<br />' .
'Do not use the Synchronize Config to IP and username option on backup cluster members!');
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'passwordfld',
'Remote System Password',
'password',
diff --git a/src/usr/local/www/system_routes.php b/src/usr/local/www/system_routes.php
index 5e5e41e..496e9d4 100644
--- a/src/usr/local/www/system_routes.php
+++ b/src/usr/local/www/system_routes.php
@@ -140,7 +140,7 @@ function delete_static_route($id) {
if ($_GET['act'] == "del") {
if ($a_routes[$_GET['id']]) {
- $changedesc = $changedesc_prefix . gettext("removed route to") . " " . $a_routes[$_GET['id']]['network'];
+ $changedesc = $changedesc_prefix . sprintf(gettext("removed route to %s"), $a_routes[$_GET['id']]['network']);
delete_static_route($_GET['id']);
unset($a_routes[$_GET['id']]);
write_config($changedesc);
@@ -152,12 +152,13 @@ if ($_GET['act'] == "del") {
if (isset($_POST['del_x'])) {
/* delete selected routes */
if (is_array($_POST['route']) && count($_POST['route'])) {
- $changedesc = $changedesc_prefix . gettext("removed route to");
+ $deleted_routes = "";
foreach ($_POST['route'] as $routei) {
- $changedesc .= " " . $a_routes[$routei]['network'];
+ $deleted_routes .= " " . $a_routes[$routei]['network'];
delete_static_route($routei);
unset($a_routes[$routei]);
}
+ $changedesc = $changedesc_prefix . sprintf(gettext("removed route to%s"), $deleted_routes);
write_config($changedesc);
header("Location: system_routes.php");
exit;
@@ -170,15 +171,15 @@ if (isset($_POST['del_x'])) {
// Do not enable a route whose gateway is disabled
if (isset($a_gateways[$a_routes[$_GET['id']]['gateway']]['disabled'])) {
$do_update_config = false;
- $input_errors[] = $changedesc_prefix . gettext("gateway is disabled, cannot enable route to") . " " . $a_routes[$_GET['id']]['network'];
+ $input_errors[] = $changedesc_prefix . sprintf(gettext("gateway is disabled, cannot enable route to %s"), $a_routes[$_GET['id']]['network']);
} else {
unset($a_routes[$_GET['id']]['disabled']);
- $changedesc = $changedesc_prefix . gettext("enabled route to") . " " . $a_routes[$_GET['id']]['network'];
+ $changedesc = $changedesc_prefix . sprintf(gettext("enabled route to %s"), $a_routes[$_GET['id']]['network']);
}
} else {
delete_static_route($_GET['id']);
$a_routes[$_GET['id']]['disabled'] = true;
- $changedesc = $changedesc_prefix . gettext("disabled route to") . " " . $a_routes[$_GET['id']]['network'];
+ $changedesc = $changedesc_prefix . sprintf(gettext("disabled route to %s"), $a_routes[$_GET['id']]['network']);
}
if ($do_update_config) {
@@ -251,10 +252,10 @@ if ($input_errors) {
print_input_errors($input_errors);
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
if (is_subsystem_dirty('staticroutes')) {
- print_info_box_np(gettext("The static route configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The static route configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
@@ -264,18 +265,22 @@ $tab_array[2] = array(gettext("Gateway Groups"), false, "system_gateway_groups.p
display_top_tabs($tab_array);
?>
-<table class="table">
-<thead>
- <tr>
- <th></th>
- <th><?=gettext("Network")?></th>
- <th><?=gettext("Gateway")?></th>
- <th><?=gettext("Interface")?></th>
- <th><?=gettext("Description")?></th>
- <th><?=gettext("Actions")?></th>
- </tr>
-</thead>
-<tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Static Routes')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed">
+ <thead>
+ <tr>
+ <th></th>
+ <th><?=gettext("Network")?></th>
+ <th><?=gettext("Gateway")?></th>
+ <th><?=gettext("Interface")?></th>
+ <th><?=gettext("Description")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
foreach ($a_routes as $i => $route):
if (isset($route['disabled'])) {
@@ -284,39 +289,42 @@ foreach ($a_routes as $i => $route):
$icon = 'fa-check-circle-o';
}
?>
- <tr<?=($icon != 'fa-check-circle-o')? ' class="disabled"' : ''?>>
- <td><i class="fa <?=$icon?>"></i></td>
- <td>
- <?=strtolower($route['network'])?>
- </td>
- <td>
- <?=htmlentities($a_gateways[$route['gateway']]['name']) . " - " . htmlentities($a_gateways[$route['gateway']]['gateway'])?>
- </td>
- <td>
- <?=convert_friendly_interface_to_friendly_descr($a_gateways[$route['gateway']]['friendlyiface'])?>
- </td>
- <td>
- <?=htmlspecialchars($route['descr'])?>
- </td>
- <td>
- <a href="system_routes_edit.php?id=<?=$i?>" class="fa fa-pencil" title="<?=gettext('Edit')?>"></a>
-
- <a href="system_routes_edit.php?dup=<?=$i?>" class="fa fa-clone" title="<?=gettext('Copy')?>"></a>
-
- <?php if (isset($route['disabled'])) {
- ?>
- <a href="?act=toggle&amp;id=<?=$i?>" class="fa fa-check-square-o" title="<?=gettext('Enable')?>"></a>
- <?php } else {
- ?>
- <a href="?act=toggle&amp;id=<?=$i?>" class="fa fa-ban" title="<?=gettext('Disable')?>"></a>
- <?php }
- ?>
- <a href="system_routes.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext('Delete')?>"></a>
-
- </td>
- </tr>
-<? endforeach?>
-</table>
+ <tr<?=($icon != 'fa-check-circle-o')? ' class="disabled"' : ''?>>
+ <td><i class="fa <?=$icon?>"></i></td>
+ <td>
+ <?=strtolower($route['network'])?>
+ </td>
+ <td>
+ <?=htmlentities($a_gateways[$route['gateway']]['name']) . " - " . htmlentities($a_gateways[$route['gateway']]['gateway'])?>
+ </td>
+ <td>
+ <?=convert_friendly_interface_to_friendly_descr($a_gateways[$route['gateway']]['friendlyiface'])?>
+ </td>
+ <td>
+ <?=htmlspecialchars($route['descr'])?>
+ </td>
+ <td>
+ <a href="system_routes_edit.php?id=<?=$i?>" class="fa fa-pencil" title="<?=gettext('Edit route')?>"></a>
+
+ <a href="system_routes_edit.php?dup=<?=$i?>" class="fa fa-clone" title="<?=gettext('Copy route')?>"></a>
+
+ <?php if (isset($route['disabled'])) {
+ ?>
+ <a href="?act=toggle&amp;id=<?=$i?>" class="fa fa-check-square-o" title="<?=gettext('Enable route')?>"></a>
+ <?php } else {
+ ?>
+ <a href="?act=toggle&amp;id=<?=$i?>" class="fa fa-ban" title="<?=gettext('Disable route')?>"></a>
+ <?php }
+ ?>
+ <a href="system_routes.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext('Delete route')?>"></a>
+
+ </td>
+ </tr>
+<?php endforeach; ?>
+ </table>
+ </div>
+ </div>
+</div>
<nav class="action-buttons">
<a href="system_routes_edit.php" role="button" class="btn btn-success btn-sm">
diff --git a/src/usr/local/www/system_routes_edit.php b/src/usr/local/www/system_routes_edit.php
index 0e81be8..d9ac2c6 100644
--- a/src/usr/local/www/system_routes_edit.php
+++ b/src/usr/local/www/system_routes_edit.php
@@ -130,7 +130,7 @@ if ($_POST) {
} else {
// Note that the 3rd parameter "disabled" must be passed as explicitly true or false.
if (!validate_address_family($_POST['network'], $_POST['gateway'], $_POST['disabled'] ? true : false)) {
- $input_errors[] = gettext("The gateway '{$a_gateways[$_POST['gateway']]['gateway']}' is a different Address Family than network '{$_POST['network']}'.");
+ $input_errors[] = sprintf(gettext('The gateway "%1$s" is a different Address Family than network "%2$s".'), $a_gateways[$_POST['gateway']]['gateway'], $_POST['network']);
}
}
}
diff --git a/src/usr/local/www/system_update_settings.php b/src/usr/local/www/system_update_settings.php
index 58495e6..96b7c6d 100644
--- a/src/usr/local/www/system_update_settings.php
+++ b/src/usr/local/www/system_update_settings.php
@@ -65,39 +65,32 @@ require("guiconfig.inc");
require("pkg-utils.inc");
if ($_POST) {
- unset($input_errors);
-
- /* input validation */
- if (($_POST['alturlenable'] == "yes") && (empty($_POST['firmwareurl']))) {
- $input_errors[] = gettext("A Firmware Auto Update Base URL must be specified when \"Use an unofficial server for firmware upgrades\" is enabled.");
- }
-
- if (!$input_errors) {
- // Set the firmware branch, but only if we are not using it already
- if ($_POST['fwbranch']) {
- if (($_POST['fwbranch'] == "development") && is_pkg_installed($g['product_name'] . "-repo")) {
- pkg_switch_repo(true);
- } else if (($_POST['fwbranch'] == "stable") && is_pkg_installed($g['product_name'] . "-repo-devel")) {
- pkg_switch_repo(false);
- }
- }
-
- if ($_POST['disablecheck'] == "yes") {
- $config['system']['firmware']['disablecheck'] = true;
- } else {
- unset($config['system']['firmware']['disablecheck']);
+ // Set the firmware branch, but only if we are not using it already
+ if ($_POST['fwbranch']) {
+ if (($_POST['fwbranch'] == "development") && !is_pkg_installed($g['product_name'] . "-repo-devel")) {
+ pkg_switch_repo(true);
+ pkg_update(true);
+ } else if (($_POST['fwbranch'] == "stable") && !is_pkg_installed($g['product_name'] . "-repo")) {
+ pkg_switch_repo(false);
+ pkg_update(true);
}
+ }
- if ($_POST['synconupgrade'] == "yes") {
- $config['system']['gitsync']['synconupgrade'] = true;
- } else {
- unset($config['system']['gitsync']['synconupgrade']);
- }
- $config['system']['gitsync']['repositoryurl'] = $_POST['repositoryurl'];
- $config['system']['gitsync']['branch'] = $_POST['branch'];
+ if ($_POST['disablecheck'] == "yes") {
+ $config['system']['firmware']['disablecheck'] = true;
+ } else {
+ unset($config['system']['firmware']['disablecheck']);
+ }
- write_config();
+ if ($_POST['synconupgrade'] == "yes") {
+ $config['system']['gitsync']['synconupgrade'] = true;
+ } else {
+ unset($config['system']['gitsync']['synconupgrade']);
}
+ $config['system']['gitsync']['repositoryurl'] = $_POST['repositoryurl'];
+ $config['system']['gitsync']['branch'] = $_POST['branch'];
+
+ write_config();
}
$curcfg = $config['system']['firmware'];
@@ -133,7 +126,7 @@ $section->addInput(new Form_Select(
fwbranch,
'Branch',
(is_pkg_installed($g['product_name'] . "-repo")) ? "stable":"development",
- ["stable" => "Stable", "development" => "Development"]
+ ["stable" => gettext("Stable"), "development" => gettext("Development")]
))->setHelp('Please select the stable, or the development branch from which to update the system firmware. ' . ' <br />' .
'Use of the development version is at your own risk!');
@@ -208,34 +201,5 @@ if (file_exists("/usr/local/bin/git") && $g['platform'] == $g['product_name']) {
} // e-o-if(file_exista()
print($form);
-?>
-
-<script type="text/javascript">
-//<![CDATA[
-events.push(function() {
- // Update firmwareurl from preseturls or from the saved alternate if "Unofficial" is checked
- function update_firmwareurl() {
- if (!$('#alturlenable').prop('checked')) {
- $('#firmwareurl').prop('readonly', true)
- $('#firmwareurl').val($('#preseturls').val());
- } else {
- $('#firmwareurl').prop('readonly', false)
- $('#firmwareurl').val("<?=$config['system']['firmware']['alturl']['firmwareurl']?>");
- }
- }
-
- // Call it when preseturls changes
-
- $('#preseturls, #alturlenable').on('change', function() {
- update_firmwareurl();
- })
-
- // And call it on page load
- update_firmwareurl();
-});
-
-//]]>
-</script>
-<?php
include("foot.inc");
diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php
index 3f3b58a..07ca150 100644
--- a/src/usr/local/www/system_usermanager.php
+++ b/src/usr/local/www/system_usermanager.php
@@ -484,26 +484,30 @@ display_top_tabs($tab_array);
if (!($act == "new" || $act == "edit" || $input_errors)) {
?>
<form method="post">
-<div class="table-responsive">
- <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
- <thead>
- <tr>
- <th>&nbsp;</th>
- <th><?=gettext("Username")?></th>
- <th><?=gettext("Full name")?></th>
- <th><?=gettext("Disabled")?></th>
- <th><?=gettext("Groups")?></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Users')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
+ <thead>
+ <tr>
+ <th>&nbsp;</th>
+ <th><?=gettext("Username")?></th>
+ <th><?=gettext("Full name")?></th>
+ <th><?=gettext("Disabled")?></th>
+ <th><?=gettext("Groups")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php
foreach ($a_user as $i => $userent):
?>
- <tr>
- <td>
- <input type="checkbox" id="frc<?=$i?>" name="delete_check[]" value="<?=$i?>" <?=($userent['scope'] == "system" ? 'disabled' : '')?>/>
- </td>
- <td>
+ <tr>
+ <td>
+ <input type="checkbox" id="frc<?=$i?>" name="delete_check[]" value="<?=$i?>" <?=($userent['scope'] == "system" ? 'disabled' : '')?>/>
+ </td>
+ <td>
<?php
if ($userent['scope'] != "user") {
$usrimg = 'eye-open';
@@ -511,22 +515,24 @@ foreach ($a_user as $i => $userent):
$usrimg = 'user';
}
?>
- <i class="fa fa-<?=$usrimg?>"></i>
- <?=htmlspecialchars($userent['name'])?>
- </td>
- <td><?=htmlspecialchars($userent['descr'])?></td>
- <td><?php if (isset($userent['disabled'])) echo "*"?></td>
- <td><?=implode(",", local_user_get_groups($userent))?></td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext("Edit user"); ?>" href="?act=edit&amp;userid=<?=$i?>"></a>
+ <i class="fa fa-<?=$usrimg?>"></i>
+ <?=htmlspecialchars($userent['name'])?>
+ </td>
+ <td><?=htmlspecialchars($userent['descr'])?></td>
+ <td><?php if (isset($userent['disabled'])) echo "*"?></td>
+ <td><?=implode(",", local_user_get_groups($userent))?></td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext("Edit user"); ?>" href="?act=edit&amp;userid=<?=$i?>"></a>
<?php if ($userent['scope'] != "system"): ?>
- <a class="fa fa-trash" title="<?=gettext("Delete user")?>" href="?act=deluser&amp;userid=<?=$i?>&amp;username=<?=$userent['name']?>"></a>
+ <a class="fa fa-trash" title="<?=gettext("Delete user")?>" href="?act=deluser&amp;userid=<?=$i?>&amp;username=<?=$userent['name']?>"></a>
<?php endif; ?>
- </td>
- </tr>
+ </td>
+ </tr>
<?php endforeach; ?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
<nav class="action-buttons">
<a href="?act=new" class="btn btn-sm btn-success">
@@ -539,15 +545,16 @@ foreach ($a_user as $i => $userent):
<?=gettext("Delete")?>
</button>
</nav>
+</form>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box(gettext("Additional users can be added here. User permissions for accessing " .
"the webConfigurator can be assigned directly or inherited from group memberships. " .
"An icon that appears grey indicates that it is a system defined object. " .
"Some system object properties can be modified but they cannot be deleted.") .
'<br /><br />' .
gettext("Accounts added here are also used for other parts of the system " .
- "such as OpenVPN, IPsec, and Captive Portal."), info)?>
+ "such as OpenVPN, IPsec, and Captive Portal."), 'info', false)?>
</div>
<?php
@@ -917,5 +924,5 @@ events.push(function() {
//]]>
</script>
<?php
-
include('foot.inc');
+?> \ No newline at end of file
diff --git a/src/usr/local/www/system_usermanager_addprivs.php b/src/usr/local/www/system_usermanager_addprivs.php
index 61984bd..3b7703b 100644
--- a/src/usr/local/www/system_usermanager_addprivs.php
+++ b/src/usr/local/www/system_usermanager_addprivs.php
@@ -93,6 +93,7 @@ $spriv_list = $priv_list;
uasort($spriv_list, admusercmp);
if ($_POST) {
+
conf_mount_rw();
unset($input_errors);
@@ -154,7 +155,7 @@ function build_priv_list() {
/* if ajax is calling, give them an update message */
if (isAjax()) {
- print_info_box_np($savemsg);
+ print_info_box($savemsg, 'success');
}
include("head.inc");
@@ -184,7 +185,46 @@ $section->addInput(new Form_Select(
null,
build_priv_list(),
true
-))->addClass('multiselect')->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items')->setAttribute('style', 'height:400px;');
+))->addClass('multiselect')
+ ->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items');
+
+$section->addInput(new Form_Select(
+ 'shadow',
+ 'Shadow',
+ null,
+ build_priv_list(),
+ true
+))->addClass('shadowselect')
+ ->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items');
+
+$section->addInput(new Form_Input(
+ 'filtertxt',
+ 'Filter',
+ 'text',
+ null
+))->setHelp('Show only the choices containing this term');
+
+$btnfilter = new Form_Button(
+ 'btnfilter',
+ 'Filter',
+ null,
+ 'fa-filter'
+);
+
+$btnfilter->addClass('btn btn-info');
+
+$form->addGlobal($btnfilter);
+
+$btnclear = new Form_Button(
+ 'btnclear',
+ 'Clear',
+ null,
+ 'fa-times'
+);
+
+$btnclear->addClass('btn btn-warning');
+
+$form->addGlobal($btnclear);
if (isset($userid)) {
$section->addInput(new Form_Input(
@@ -208,6 +248,7 @@ events.push(function() {
<?php
+
// Build a list of privilege descriptions
if (is_array($spriv_list)) {
$id = 0;
@@ -225,12 +266,88 @@ events.push(function() {
echo $jdescs;
}
?>
+
+ $('.shadowselect').parent().parent('div').addClass('hidden');
+
// Set the number of options to display
$('.multiselect').attr("size","20");
+ $('.shadowselect').attr("size","20");
// When the 'sysprivs" selector is clicked, we display a description
$('.multiselect').click(function() {
- $('#pdesc').html('<span style="color: green;">' + descs[$(this).children('option:selected').index()] + '</span>');
+ $('#pdesc').html('<span class="text-info">' + descs[$(this).children('option:selected').index()] + '</span>');
+
+ // and update the shadow list from the real list
+ $(".multiselect option").each(function() {
+ shadowoption = $('.shadowselect option').filter('[value=' + $(this).val() + ']');
+
+ if ($(this).is(':selected')) {
+ shadowoption.prop("selected", true);
+ } else {
+ shadowoption.prop("selected", false);
+ }
+ });
+ });
+
+ $('#btnfilter').prop('type', 'button');
+
+ $('#btnfilter').click(function() {
+ searchterm = $('#filtertxt').val().toLowerCase();
+ copyselect(true);
+
+ // Then filter
+ $(".multiselect > option").each(function() {
+ if (this.text.toLowerCase().indexOf(searchterm) == -1 ) {
+ $(this).remove();
+ }
+ });
+ });
+
+ $('#btnclear').prop('type', 'button');
+
+ $('#btnclear').click(function() {
+ // Copy all options from shadow to sysprivs
+ copyselect(true)
+
+ $('#filtertxt').val('');
+ });
+
+ $('#filtertxt').keypress(function(e) {
+ if(e.which == 13) {
+ e.preventDefault();
+ $('#btnfilter').trigger('click');
+ }
+ });
+
+ // On submit unhide all options (or else they will not submit)
+ $('form').submit(function() {
+
+ $(".multiselect > option").each(function() {
+ $(this).show();
+ });
+
+ $('.shadowselect').remove();
+ });
+
+ function copyselect(selected) {
+ // Copy all optionsfrom shadow to sysprivs
+ $('.multiselect').html($('.shadowselect').html());
+
+ if (selected) {
+ // Update the shadow list from the real list
+ $(".shadowselect option").each(function() {
+ multioption = $('.multiselect option').filter('[value=' + $(this).val() + ']');
+ if ($(this).is(':selected')) {
+ multioption.prop("selected", true);
+ } else {
+ multioption.prop("selected", false);
+ }
+ });
+ }
+ }
+
+ $('.multiselect').mouseup(function () {
+ $('.multiselect').trigger('click');
});
});
//]]>
diff --git a/src/usr/local/www/system_usermanager_passwordmg.php b/src/usr/local/www/system_usermanager_passwordmg.php
index 1d2ce05..00e6ea1 100644
--- a/src/usr/local/www/system_usermanager_passwordmg.php
+++ b/src/usr/local/www/system_usermanager_passwordmg.php
@@ -117,7 +117,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
if ($islocal == false) {
diff --git a/src/usr/local/www/system_usermanager_settings.php b/src/usr/local/www/system_usermanager_settings.php
index 875837e..0d532d8 100644
--- a/src/usr/local/www/system_usermanager_settings.php
+++ b/src/usr/local/www/system_usermanager_settings.php
@@ -127,7 +127,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg, success);
+ print_info_box($savemsg, 'success');
}
if ($save_and_test) {
diff --git a/src/usr/local/www/system_usermanager_settings_ldapacpicker.php b/src/usr/local/www/system_usermanager_settings_ldapacpicker.php
index 2543e41..26ff512 100644
--- a/src/usr/local/www/system_usermanager_settings_ldapacpicker.php
+++ b/src/usr/local/www/system_usermanager_settings_ldapacpicker.php
@@ -108,7 +108,7 @@ if ($_GET) {
//<![CDATA[
function post_choices() {
- var ous = <?php echo count($ous); ?>;
+ var ous = <?=count($ous);?>;
var i;
opener.document.forms[0].ldapauthcontainers.value="";
for (i = 0; i < ous; i++) {
diff --git a/src/usr/local/www/tree/i-bottom.gif b/src/usr/local/www/tree/i-bottom.gif
index f07fa99..f07fa99 100755..100644
--- a/src/usr/local/www/tree/i-bottom.gif
+++ b/src/usr/local/www/tree/i-bottom.gif
Binary files differ
diff --git a/src/usr/local/www/tree/i-repeater.gif b/src/usr/local/www/tree/i-repeater.gif
index d5ab089..d5ab089 100755..100644
--- a/src/usr/local/www/tree/i-repeater.gif
+++ b/src/usr/local/www/tree/i-repeater.gif
Binary files differ
diff --git a/src/usr/local/www/tree/l.gif b/src/usr/local/www/tree/l.gif
index 1e8c707..1e8c707 100755..100644
--- a/src/usr/local/www/tree/l.gif
+++ b/src/usr/local/www/tree/l.gif
Binary files differ
diff --git a/src/usr/local/www/tree/minus.gif b/src/usr/local/www/tree/minus.gif
index 7a7fd3b..7a7fd3b 100755..100644
--- a/src/usr/local/www/tree/minus.gif
+++ b/src/usr/local/www/tree/minus.gif
Binary files differ
diff --git a/src/usr/local/www/tree/page-file.png b/src/usr/local/www/tree/page-file.png
index d3bb119..d3bb119 100755..100644
--- a/src/usr/local/www/tree/page-file.png
+++ b/src/usr/local/www/tree/page-file.png
Binary files differ
diff --git a/src/usr/local/www/tree/page-file_play.gif b/src/usr/local/www/tree/page-file_play.gif
index 0c8e9ff..0c8e9ff 100755..100644
--- a/src/usr/local/www/tree/page-file_play.gif
+++ b/src/usr/local/www/tree/page-file_play.gif
Binary files differ
diff --git a/src/usr/local/www/tree/page-file_x.gif b/src/usr/local/www/tree/page-file_x.gif
index 504f06e..504f06e 100755..100644
--- a/src/usr/local/www/tree/page-file_x.gif
+++ b/src/usr/local/www/tree/page-file_x.gif
Binary files differ
diff --git a/src/usr/local/www/tree/page-foldericon.png b/src/usr/local/www/tree/page-foldericon.png
index d26f2dc..d26f2dc 100755..100644
--- a/src/usr/local/www/tree/page-foldericon.png
+++ b/src/usr/local/www/tree/page-foldericon.png
Binary files differ
diff --git a/src/usr/local/www/tree/page-openfoldericon.png b/src/usr/local/www/tree/page-openfoldericon.png
index 8d00c39..8d00c39 100755..100644
--- a/src/usr/local/www/tree/page-openfoldericon.png
+++ b/src/usr/local/www/tree/page-openfoldericon.png
Binary files differ
diff --git a/src/usr/local/www/tree/plus.gif b/src/usr/local/www/tree/plus.gif
index 3530f59..3530f59 100755..100644
--- a/src/usr/local/www/tree/plus.gif
+++ b/src/usr/local/www/tree/plus.gif
Binary files differ
diff --git a/src/usr/local/www/tree/t.gif b/src/usr/local/www/tree/t.gif
index a92da2a..a92da2a 100755..100644
--- a/src/usr/local/www/tree/t.gif
+++ b/src/usr/local/www/tree/t.gif
Binary files differ
diff --git a/src/usr/local/www/tree/tree.js b/src/usr/local/www/tree/tree.js
index 8e9651e..8e9651e 100755..100644
--- a/src/usr/local/www/tree/tree.js
+++ b/src/usr/local/www/tree/tree.js
diff --git a/src/usr/local/www/vpn_ipsec.php b/src/usr/local/www/vpn_ipsec.php
index d1a7546..d991896 100644
--- a/src/usr/local/www/vpn_ipsec.php
+++ b/src/usr/local/www/vpn_ipsec.php
@@ -82,7 +82,6 @@ $a_phase1 = &$config['ipsec']['phase1'];
$a_phase2 = &$config['ipsec']['phase2'];
if ($_POST) {
-
if ($_POST['apply']) {
$retval = vpn_ipsec_configure();
/* reload the filter in the background */
@@ -263,15 +262,13 @@ $tab_array[] = array(gettext("Advanced Settings"), false, "vpn_ipsec_settings.ph
display_top_tabs($tab_array);
?>
-<script type="text/javascript" src="/javascript/row_toggle.js"></script>
-
<?php
if ($savemsg) {
print_info_box($savemsg, 'success');
}
if (is_subsystem_dirty('ipsec')) {
- print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The IPsec tunnel configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
?>
@@ -306,13 +303,13 @@ display_top_tabs($tab_array);
?>
<tr id="fr<?=$i?>" onclick="fr_toggle(<?=$i?>)" id="frd<?=$i?>" ondblclick="document.location='vpn_ipsec_phase1.php?p1index=<?=$i?>'" class="<?= $entryStatus ?>">
<td>
- <input type="checkbox" id="frc<?=$i?>" name="p1entry[]" value="<?=$i?>" onclick="fr_bgcolor('<?=$i?>')" />
+ <input type="checkbox" id="frc<?=$i?>" onclick="fr_toggle(<?=$i?>)" name="p1entry[]" value="<?=$i?>" />
<a class="fa fa-anchor" id="Xmove_<?=$i?>" title="<?=gettext("Move checked entries to here")?>"></a>
</td>
<td>
<button value="toggle_<?=$i?>" name="toggle_<?=$i?>" title="<?=gettext("click to toggle enabled/disabled status")?>" class="btn btn-xs btn-default" type="submit"><?= ($entryStatus == 'disabled' ? 'enable' : 'disable') ?></button>
</td>
- <td onclick="fr_toggle(<?=$i?>)" id="frd<?=$i?>">
+ <td id="frd<?=$i?>">
<?php
if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == "ikev1") {
echo "V1";
@@ -357,7 +354,7 @@ display_top_tabs($tab_array);
}
?>
</td>
- <td onclick="fr_toggle(<?=$i?>)" id="frd<?=$i?>">
+ <td id="frd<?=$i?>">
<?=$spans?>
<?php
if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == "ikev1") {
@@ -366,7 +363,7 @@ display_top_tabs($tab_array);
?>
<?=$spane?>
</td>
- <td onclick="fr_toggle(<?=$i?>)" id="frd<?=$i?>">
+ <td id="frd<?=$i?>">
<?=$p1_ealgos[$ph1ent['encryption-algorithm']['name']]['name']?>
<?php
if ($ph1ent['encryption-algorithm']['keylen']) {
@@ -511,7 +508,7 @@ display_top_tabs($tab_array);
<!-- <button class="fa fa-anchor button-icon" type="submit" name="movep2_<?=$j?>" value="movep2_<?=$j?>" title="<?=gettext("Move checked P2s here")?>"></button> -->
<a class="fa fa-pencil" href="vpn_ipsec_phase2.php?p2index=<?=$ph2ent['uniqid']?>" title="<?=gettext("Edit phase2 entry"); ?>"></a>
<a class="fa fa-clone" href="vpn_ipsec_phase2.php?dup=<?=$ph2ent['uniqid']?>" title="<?=gettext("Add a new Phase 2 based on this one"); ?>"></a>
- <a class="fa fa-trash no-confirm" id="Xdelp2_<?=$i?>" title="<?=gettext('Delete phase2 entry'); ?>"></a>
+ <a class="fa fa-trash no-confirm" id="Xdelp2_<?=$ph2index?>" title="<?=gettext('Delete phase2 entry'); ?>"></a>
<button style="display: none;" class="btn btn-xs btn-warning" type="submit" id="delp2_<?=$ph2index?>" name="delp2_<?=$ph2index?>" value="delp2_<?=$ph2index?>" title="<?=gettext('delete phase2 entry'); ?>">delete</button>
</td>
</tr>
@@ -561,11 +558,11 @@ display_top_tabs($tab_array);
</nav>
</form>
-<div id="infoblock">
+<div class="infoblock">
<?=print_info_box('<strong>' . gettext("Note:") . '</strong><br />' .
gettext("You can check your IPsec status at ") . '<a href="status_ipsec.php">' . gettext("Status:IPsec") . '</a>.<br />' .
gettext("IPsec Debug Mode can be enabled at ") . '<a href="vpn_ipsec_settings.php">' .gettext("VPN:IPsec:Advanced Settings") . '</a>.<br />' .
- gettext("IPsec can be set to prefer older SAs at ") . '<a href="vpn_ipsec_settings.php">' . gettext("VPN:IPsec:Advanced Settings") . '</a>', info)?>
+ gettext("IPsec can be set to prefer older SAs at ") . '<a href="vpn_ipsec_settings.php">' . gettext("VPN:IPsec:Advanced Settings") . '</a>', 'info', false)?>
</div>
<script type="text/javascript">
diff --git a/src/usr/local/www/vpn_ipsec_keys.php b/src/usr/local/www/vpn_ipsec_keys.php
index 7fcd642..78dd1d0 100644
--- a/src/usr/local/www/vpn_ipsec_keys.php
+++ b/src/usr/local/www/vpn_ipsec_keys.php
@@ -115,7 +115,7 @@ if ($savemsg) {
}
if (is_subsystem_dirty('ipsec')) {
- print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The IPsec tunnel configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
?>
@@ -128,72 +128,76 @@ if (is_subsystem_dirty('ipsec')) {
display_top_tabs($tab_array);
?>
-<div class="table-responsive">
- <table class="table table-striped table-hover">
- <thead>
- <tr>
- <th><?=gettext("Identifier"); ?></th>
- <th><?=gettext("Type"); ?></th>
- <th><?=gettext("Pre-Shared Key"); ?></th>
- <th></th>
- </tr>
- </thead>
-
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('Pre-Shared Keys')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover">
+ <thead>
+ <tr>
+ <th><?=gettext("Identifier"); ?></th>
+ <th><?=gettext("Type"); ?></th>
+ <th><?=gettext("Pre-Shared Key"); ?></th>
+ <th><?=gettext("Actions"); ?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php $i = 0; foreach ($userkeys as $secretent): ?>
- <tr>
- <td>
- <?php
- if ($secretent['ident'] == 'allusers') {
- echo gettext("ANY USER");
- } else {
- echo htmlspecialchars($secretent['ident']);
- }
- ?>
- </td>
- <td>
- <?php
- if (empty($secretent['type'])) {
- echo 'PSK';
- } else {
- echo htmlspecialchars($secretent['type']);
- }
- ?>
- </td>
- <td>
- <?=htmlspecialchars($secretent['pre-shared-key'])?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit user')?>" href="system_usermanager.php?act=edit&amp;userid=<?=$secretent['id']?>"></a>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?php
+ if ($secretent['ident'] == 'allusers') {
+ echo gettext("ANY USER");
+ } else {
+ echo htmlspecialchars($secretent['ident']);
+ }
+ ?>
+ </td>
+ <td>
+ <?php
+ if (empty($secretent['type'])) {
+ echo 'PSK';
+ } else {
+ echo htmlspecialchars($secretent['type']);
+ }
+ ?>
+ </td>
+ <td>
+ <?=htmlspecialchars($secretent['pre-shared-key'])?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit user')?>" href="system_usermanager.php?act=edit&amp;userid=<?=$secretent['id']?>"></a>
+ </td>
+ </tr>
<?php $i++; endforeach; ?>
<?php $i = 0; foreach ($a_secret as $secretent): ?>
- <tr>
- <td>
- <?=htmlspecialchars($secretent['ident'])?>
- </td>
- <td>
- <?php
- if (empty($secretent['type'])) {
- echo 'PSK';
- } else {
- echo htmlspecialchars($secretent['type']);
- }
- ?>
- </td>
- <td>
- <?=htmlspecialchars($secretent['pre-shared-key'])?>
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit key')?>" href="vpn_ipsec_keys_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete key')?>" href="vpn_ipsec_keys.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?=htmlspecialchars($secretent['ident'])?>
+ </td>
+ <td>
+ <?php
+ if (empty($secretent['type'])) {
+ echo 'PSK';
+ } else {
+ echo htmlspecialchars($secretent['type']);
+ }
+ ?>
+ </td>
+ <td>
+ <?=htmlspecialchars($secretent['pre-shared-key'])?>
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit key')?>" href="vpn_ipsec_keys_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete key')?>" href="vpn_ipsec_keys.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php $i++; endforeach; ?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
<nav class="action-buttons">
diff --git a/src/usr/local/www/vpn_ipsec_keys_edit.php b/src/usr/local/www/vpn_ipsec_keys_edit.php
index 69478da..dbdc033 100644
--- a/src/usr/local/www/vpn_ipsec_keys_edit.php
+++ b/src/usr/local/www/vpn_ipsec_keys_edit.php
@@ -144,7 +144,7 @@ if ($_POST) {
$text = gettext("Added");
}
- write_config("{$text} IPsec Pre-Shared Keys");
+ write_config("{$text} " . gettext("IPsec Pre-Shared Keys"));
mark_subsystem_dirty('ipsec');
header("Location: vpn_ipsec_keys.php");
diff --git a/src/usr/local/www/vpn_ipsec_mobile.php b/src/usr/local/www/vpn_ipsec_mobile.php
index 8543772..21e365a 100644
--- a/src/usr/local/www/vpn_ipsec_mobile.php
+++ b/src/usr/local/www/vpn_ipsec_mobile.php
@@ -434,10 +434,10 @@ include("head.inc");
<?php
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
if (is_subsystem_dirty('ipsec')) {
- print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
+ print_apply_box(gettext("The IPsec tunnel configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
foreach ($a_phase1 as $ph1ent) {
if (isset($ph1ent['mobile'])) {
@@ -445,8 +445,9 @@ foreach ($a_phase1 as $ph1ent) {
}
}
if ($pconfig['enable'] && !$ph1found) {
- print_info_box_np(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".<br />" . gettext("Please click Create to define one."), gettext("create"), gettext("Create Phase1"));
+ print_info_box(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".<br />" . gettext("Please click Create to define one."), "warning", "create", gettext("Create Phase1"));
}
+
if ($input_errors) {
print_input_errors($input_errors);
}
@@ -491,8 +492,8 @@ $section->addInput(new Form_Select(
'Group Authentication',
$pconfig['group_source'],
array(
- 'none' => 'none',
- 'system' => 'system',
+ 'none' => gettext('none'),
+ 'system' => gettext('system'),
)
))->setHelp('Source');
diff --git a/src/usr/local/www/vpn_ipsec_phase1.php b/src/usr/local/www/vpn_ipsec_phase1.php
index 957fe55..5cd751e 100644
--- a/src/usr/local/www/vpn_ipsec_phase1.php
+++ b/src/usr/local/www/vpn_ipsec_phase1.php
@@ -545,7 +545,7 @@ function build_interface_list() {
$vipif = $group[0]['int'];
}
- $interfaces[$name] = "GW Group {$name}";
+ $interfaces[$name] = sprintf(gettext("GW Group %s"), $name);
}
return($interfaces);
@@ -672,7 +672,7 @@ $section->addInput(new Form_Select(
'iketype',
'Key Exchange version',
$pconfig['iketype'],
- array("ikev1" => "V1", "ikev2" => "V2", "auto" => "Auto")
+ array("ikev1" => "V1", "ikev2" => "V2", "auto" => gettext("Auto"))
))->setHelp('Select the Internet Key Exchange protocol version to be used, IKEv1 or IKEv2.');
$section->addInput(new Form_Select(
@@ -720,7 +720,7 @@ $section->addInput(new Form_Select(
'mode',
'Negotiation mode',
$pconfig['mode'],
- array("main" => "Main", "aggressive" => "Aggressive")
+ array("main" => gettext("Main"), "aggressive" => gettext("Aggressive"))
))->setHelp('Aggressive is more flexible, but less secure.');
$group = new Form_Group('My identifier');
@@ -857,7 +857,7 @@ $section->addInput(new Form_Select(
'nat_traversal',
'NAT Traversal',
$pconfig['nat_traversal'],
- array('on' => 'Auto', 'force' => 'Force')
+ array('on' => gettext('Auto'), 'force' => gettext('Force'))
))->setHelp('Set this option to enable the use of NAT-T (i.e. the encapsulation of ESP in UDP packets) if needed, ' .
'which can help with clients that are behind restrictive firewalls.');
@@ -865,7 +865,7 @@ $section->addInput(new Form_Select(
'mobike',
'MOBIKE',
$pconfig['mobike'],
- array('on' => 'Enable', 'off' => 'Disable')
+ array('on' => gettext('Enable'), 'off' => gettext('Disable'))
))->setHelp('Set this option to control the use of MOBIKE');
$section->addInput(new Form_Checkbox(
@@ -1106,6 +1106,7 @@ events.push(function() {
});
//]]>
</script>
+</form>
<?php
include("foot.inc");
diff --git a/src/usr/local/www/vpn_ipsec_phase2.php b/src/usr/local/www/vpn_ipsec_phase2.php
index 336739b..cbcf8c2 100644
--- a/src/usr/local/www/vpn_ipsec_phase2.php
+++ b/src/usr/local/www/vpn_ipsec_phase2.php
@@ -556,7 +556,7 @@ $group->add(new Form_Select(
'localid_type',
null,
$pconfig['localid_type'],
- ['address' => 'Address', 'network' => 'Network'] + $subnetarray
+ ['address' => gettext('Address'), 'network' => gettext('Network')] + $subnetarray
))->setHelp('Type');
$group->add(new Form_IpAddress(
@@ -576,7 +576,7 @@ foreach ($subnetarray as $ifname => $ifdescr) {
}
// Tack none, address & network on the beginning
-$subnetarray = array('none' => gettext('None'), 'address' => 'Address', 'network' => 'Network') + $subnetarray;
+$subnetarray = array('none' => gettext('None'), 'address' => gettext('Address'), 'network' => gettext('Network')) + $subnetarray;
$group->add(new Form_Select(
'natlocalid_type',
@@ -602,7 +602,7 @@ if (!isset($pconfig['mobile'])) {
'remoteid_type',
null,
$pconfig['remoteid_type'],
- array('address' => 'Address', 'network' => 'Network')
+ array('address' => gettext('Address'), 'network' => gettext('Network'))
))->setHelp('Type');
$group->add(new Form_IpAddress(
@@ -659,8 +659,8 @@ foreach ($p2_ealgos as $algo => $algodata) {
$group->add(new Form_Select(
'keylen_' . $algo,
null,
- $keylen == $pconfig["keylen_".$algo],
- ['auto' => 'Auto'] + $list
+ $pconfig["keylen_".$algo],
+ ['auto' => gettext('Auto')] + $list
));
}
@@ -793,8 +793,8 @@ events.push(function() {
var address_is_blank = !/\S/.test($('#natlocalid_address').val());
switch ($("#natlocalid_type option:selected").index()) {
- case 0: /* single */
- disableInput('natlocalid_address', false);
+ case 0: /* none */
+ disableInput('natlocalid_address', true);
if (address_is_blank) {
$('#natlocalid_netbits').val(0);
@@ -802,19 +802,19 @@ events.push(function() {
disableInput('natlocalid_netbits', true);
break;
- case 1: /* network */
+ case 1: /* address */
disableInput('natlocalid_address', false);
if (address_is_blank) {
$('#natlocalid_netbits').val(bits);
}
- disableInput('natlocalid_netbits', false);
- break;
- case 3: /* none */
- disableInput('natlocalid_address', true);
disableInput('natlocalid_netbits', true);
break;
+ case 2: /* network */
+ disableInput('natlocalid_address', false);
+ disableInput('natlocalid_netbits', false);
+ break;
default:
$('#natlocalid_address').val("");
disableInput('natlocalid_address', true);
diff --git a/src/usr/local/www/vpn_ipsec_settings.php b/src/usr/local/www/vpn_ipsec_settings.php
index 2062716..03c44d5 100644
--- a/src/usr/local/www/vpn_ipsec_settings.php
+++ b/src/usr/local/www/vpn_ipsec_settings.php
@@ -94,16 +94,16 @@ if ($_POST) {
foreach ($ipsec_log_cats as $cat => $desc) {
if (!in_array(intval($pconfig[$cat]), array_keys($ipsec_log_sevs), true)) {
- $input_errors[] = "A valid value must be specified for {$desc} debug.";
+ $input_errors[] = sprintf(gettext("A valid value must be specified for %s debug."), $desc);
}
}
if (isset($pconfig['maxmss'])) {
if (!is_numericint($pconfig['maxmss']) && $pconfig['maxmss'] != '') {
- $input_errors[] = "An integer must be specified for Maximum MSS.";
+ $input_errors[] = gettext("An integer must be specified for Maximum MSS.");
}
if ($pconfig['maxmss'] <> '' && $pconfig['maxmss'] < 576 || $pconfig['maxmss'] > 65535) {
- $input_errors[] = "An integer between 576 and 65535 must be specified for Maximum MSS";
+ $input_errors[] = gettext("An integer between 576 and 65535 must be specified for Maximum MSS");
}
}
@@ -210,8 +210,10 @@ if ($_POST) {
$retval = filter_configure();
if (stristr($retval, "error") <> true) {
$savemsg = get_std_save_message(gettext($retval));
+ $class = 'success';
} else {
$savemsg = gettext($retval);
+ $class = 'warning';
}
vpn_ipsec_configure($needsrestart);
@@ -242,9 +244,9 @@ include("head.inc");
function maxmss_checked(obj) {
if (obj.checked) {
- jQuery('#maxmss').attr('disabled', false);
+ $('#maxmss').attr('disabled', false);
} else {
- jQuery('#maxmss').attr('disabled', 'true');
+ $('#maxmss').attr('disabled', 'true');
}
}
@@ -253,7 +255,7 @@ function maxmss_checked(obj) {
<?php
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, $class);
}
if ($input_errors) {
@@ -357,10 +359,10 @@ $section->add($group);
$section->addInput(new Form_Checkbox(
'unityplugin',
- 'Disable Cisco Extensions',
- 'Disable Unity Plugin',
+ 'Enable Cisco Extensions',
+ 'Enable Unity Plugin',
$pconfig['unityplugin']
-))->setHelp('Disable Unity Plugin which provides Cisco Extension support as Split-Include, Split-Exclude, Split-Dns, ...');
+))->setHelp('Enable Unity Plugin which provides Cisco Extension support such as Split-Include, Split-Exclude and Split-Dns.');
$section->addInput(new Form_Checkbox(
'strictcrlpolicy',
diff --git a/src/usr/local/www/vpn_l2tp.php b/src/usr/local/www/vpn_l2tp.php
index 17bb288..073de46 100644
--- a/src/usr/local/www/vpn_l2tp.php
+++ b/src/usr/local/www/vpn_l2tp.php
@@ -115,6 +115,18 @@ if ($_POST) {
$input_errors[] = gettext("A valid RADIUS server address must be specified.");
}
+ if ($_POST['secret'] != $_POST['secret_confirm']) {
+ $input_errors[] = gettext("Secret and confirmation must match");
+ }
+
+ if ($_POST['radiussecret'] != $_POST['radiussecret_confirm']) {
+ $input_errors[] = gettext("Secret and confirmation must match");
+ }
+
+ if (!is_numericint($_POST['n_l2tp_units']) || $_POST['n_l2tp_units'] > 255) {
+ $input_errors[] = gettext("Number of L2TP users must be between 1 and 255");
+ }
+
/* if this is an AJAX caller then handle via JSON */
if (isAjax() && is_array($input_errors)) {
input_errors2Ajax($input_errors);
@@ -123,11 +135,7 @@ if ($_POST) {
if (!$input_errors) {
$_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['l2tp_subnet']);
- $subnet_start = ip2ulong($_POST['remoteip']);
- $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_l2tp_units'] - 1;
-
- if ((ip2ulong($_POST['localip']) >= $subnet_start) &&
- (ip2ulong($_POST['localip']) <= $subnet_end)) {
+ if (is_inrange_v4($_POST['localip'], $_POST['remoteip'], ip_after($_POST['remoteip'], $_POST['n_l2tp_units'] - 1))) {
$input_errors[] = gettext("The specified server address lies in the remote subnet.");
}
if ($_POST['localip'] == get_interface_ip("lan")) {
@@ -150,8 +158,14 @@ if ($_POST) {
$l2tpcfg['interface'] = $_POST['interface'];
$l2tpcfg['n_l2tp_units'] = $_POST['n_l2tp_units'];
$l2tpcfg['radius']['server'] = $_POST['radiusserver'];
- $l2tpcfg['radius']['secret'] = $_POST['radiussecret'];
- $l2tpcfg['secret'] = $_POST['secret'];
+ if ($_POST['radiussecret'] != DMYPWD) {
+ $l2tpcfg['radius']['secret'] = $_POST['radiussecret'];
+ }
+
+ if ($_POST['secret'] != DMYPWD) {
+ $l2tpcfg['secret'] = $_POST['secret'];
+ }
+
$l2tpcfg['paporchap'] = $_POST['paporchap'];
@@ -197,7 +211,7 @@ if ($_POST) {
/* if ajax is calling, give them an update message */
if (isAjax()) {
- print_info_box_np($savemsg);
+ print_info_box($savemsg, 'success');
}
}
}
@@ -211,7 +225,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg);
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
@@ -268,15 +282,14 @@ $section->addInput(new Form_IpAddress(
))->addMask(l2tp_subnet, $pconfig['l2tp_subnet'])
->setHelp('Specify the starting address for the client IP address subnet.');
-$section->addInput(new Form_Input(
+$section->addInput(new Form_Select(
'n_l2tp_units',
'Number of L2TP users',
- 'number',
$pconfig['n_l2tp_units'],
- ['min' => 0, 'max' => 255]
+ array_combine(range(1, 255, 1), range(1, 255, 1))
));
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'secret',
'Secret',
'password',
@@ -333,7 +346,7 @@ $section->addInput(new Form_IpAddress(
$pconfig['radiusserver']
))->setHelp('Enter the IP address of the RADIUS server.');
-$section->addInput(new Form_Input(
+$section->addPassword(new Form_Input(
'radiussecret',
'Secret',
'password',
@@ -350,9 +363,12 @@ $section->addInput(new Form_Checkbox(
$form->add($section);
print($form);
-
-print_info_box(gettext("Don't forget to add a firewall rule to permit traffic from L2TP clients!"), info);
?>
+<div class="infoblock blockopen">
+<?php
+ print_info_box(gettext("Don't forget to add a firewall rule to permit traffic from L2TP clients!"), 'info', false);
+?>
+</div>
<script type="text/javascript">
//<![CDATA[
diff --git a/src/usr/local/www/vpn_l2tp_users.php b/src/usr/local/www/vpn_l2tp_users.php
index 101889a..a5c5a0e 100644
--- a/src/usr/local/www/vpn_l2tp_users.php
+++ b/src/usr/local/www/vpn_l2tp_users.php
@@ -102,7 +102,7 @@ if ($_GET['act'] == "del") {
include("head.inc");
if ($savemsg) {
- print_info_box($savemsg, success);
+ print_info_box($savemsg, 'success');
}
if (isset($config['l2tp']['radius']['enable'])) {
@@ -110,7 +110,7 @@ if (isset($config['l2tp']['radius']['enable'])) {
}
if (is_subsystem_dirty('l2tpusers')) {
- print_info_box_np(gettext("The l2tp user list has been modified") . ".<br />" . gettext("You must apply the changes in order for them to take effect") . ".<br /><b>" . gettext("Warning: this will terminate all current l2tp sessions!") . "</b>");
+ print_apply_box(gettext("The l2tp user list has been modified.") . "<br />" . gettext("You must apply the changes in order for them to take effect") . ".<br /><b>" . gettext("Warning: this will terminate all current l2tp sessions!") . "</b>");
}
@@ -119,35 +119,39 @@ $tab_array[] = array(gettext("Configuration"), false, "vpn_l2tp.php");
$tab_array[] = array(gettext("Users"), true, "vpn_l2tp_users.php");
display_top_tabs($tab_array);
?>
-<div class="table-responsive">
- <table class="table table-striped table-hover">
- <thead>
- <tr>
- <th><?=gettext("Username")?></th>
- <th><?=gettext("IP address")?></th>
- <th><?=gettext("Actions")?></th>
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext('L2TP Users')?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-hover">
+ <thead>
+ <tr>
+ <th><?=gettext("Username")?></th>
+ <th><?=gettext("IP address")?></th>
+ <th><?=gettext("Actions")?></th>
+ </tr>
+ </thead>
+ <tbody>
<?php $i = 0; foreach ($a_secret as $secretent):?>
- <tr>
- <td>
- <?=htmlspecialchars($secretent['name'])?>
- </td>
- <td>
- <?php if ($secretent['ip'] == "") $secretent['ip'] = "Dynamic"?>
- <?=htmlspecialchars($secretent['ip'])?>&nbsp;
- </td>
- <td>
- <a class="fa fa-pencil" title="<?=gettext('Edit user')?>" href="vpn_l2tp_users_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete user')?>" href="vpn_l2tp_users.php?act=del&amp;id=<?=$i?>"></a>
- </td>
- </tr>
+ <tr>
+ <td>
+ <?=htmlspecialchars($secretent['name'])?>
+ </td>
+ <td>
+ <?php if ($secretent['ip'] == "") $secretent['ip'] = "Dynamic"?>
+ <?=htmlspecialchars($secretent['ip'])?>&nbsp;
+ </td>
+ <td>
+ <a class="fa fa-pencil" title="<?=gettext('Edit user')?>" href="vpn_l2tp_users_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete user')?>" href="vpn_l2tp_users.php?act=del&amp;id=<?=$i?>"></a>
+ </td>
+ </tr>
<?php $i++; endforeach?>
- </tbody>
- </table>
+ </tbody>
+ </table>
+ </div>
+ </div>
</div>
-
<nav class="action-buttons">
<a class="btn btn-success btn-sm" href="vpn_l2tp_users_edit.php">
<i class="fa fa-plus icon-embed-btn"></i>
diff --git a/src/usr/local/www/vpn_l2tp_users_edit.php b/src/usr/local/www/vpn_l2tp_users_edit.php
index 4a2078a..a0caea6 100644
--- a/src/usr/local/www/vpn_l2tp_users_edit.php
+++ b/src/usr/local/www/vpn_l2tp_users_edit.php
@@ -121,7 +121,7 @@ if ($_POST) {
$input_errors[] = gettext("The password contains invalid characters.");
}
- if (($_POST['passwordfld']) && ($_POST['passwordfld'] != $_POST['passwordfld2'])) {
+ if (($_POST['passwordfld']) && ($_POST['passwordfld'] != $_POST['passwordfld_confirm'])) {
$input_errors[] = gettext("The passwords do not match.");
}
if (($_POST['ip'] && !is_ipaddr($_POST['ip']))) {
@@ -153,7 +153,7 @@ if ($_POST) {
$secretent['name'] = $_POST['usernamefld'];
$secretent['ip'] = $_POST['ip'];
- if ($_POST['passwordfld']) {
+ if ($_POST['passwordfld'] && ($_POST['passwordfld'] != DMYPWD)) {
$secretent['password'] = $_POST['passwordfld'];
}
@@ -175,60 +175,52 @@ if ($_POST) {
}
include("head.inc");
-?>
-<?php
if ($input_errors) {
print_input_errors($input_errors);
}
-?>
-
-<form class="form-horizontal" action="vpn_l2tp_users_edit.php" method="post" name="iform" id="iform">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h2 class="panel-title"><?=gettext('User'); ?></h2>
- </div>
-
- <div class="panel-body">
- <div class="form-group">
- <label for="usernamefld" class="col-sm-2 control-label"><?=gettext("Username")?></label>
- <div class="col-sm-10">
- <?=$mandfldhtml?><input name="usernamefld" type="text" class="formfld user form-control" id="usernamefld" size="20" value="<?=htmlspecialchars($pconfig['usernamefld'])?>" />
- </div>
- </div>
- <div class="form-group">
- <label for="passwordfld" class="col-sm-2 control-label"><?=gettext("Password")?></label>
- <div class="col-sm-10">
- <?=$mandfldhtml?><input name="passwordfld" type="password" class="formfld pwd form-control" id="passwordfld" size="20" />
- </div>
- </div>
- <div class="form-group">
- <label for="passwordfld2" class="col-sm-2 control-label"><?=gettext('Confirm')?></label>
- <div class="col-sm-10">
- <?=$mandfldhtml?><input name="passwordfld2" type="password" class="formfld pwd form-control" id="passwordfld2" size="20" />
-<?php if (isset($id) && $a_secret[$id]):?>
- <span class="help-block"><?=gettext("If you want to change the users password, enter it here twice.")?></span>
-<?php endif?>
- </div>
- </div>
- <div class="form-group">
- <label for="ip" class="col-sm-2 control-label"><?=gettext("IP address")?></label>
- <div class="col-sm-10">
- <input name="ip" type="text" class="formfld unknown form-control" id="ip" size="20" value="<?=htmlspecialchars($pconfig['ip'])?>" />
- <span class="help-block"><?=gettext("If you want the user to be assigned a specific IP address, enter it here.")?></span>
- </div>
- </div>
- </div>
- </div>
-
- <div class="col-sm-10 col-sm-offset-2">
- <input id="submit" name="Submit" type="submit" class="formbtn btn btn-primary" value="<?=gettext('Save')?>" />
- </div>
-
-<?php if (isset($id) && $a_secret[$id]):?>
- <input name="id" type="hidden" value="<?=htmlspecialchars($id)?>" />
-<?php endif?>
-</form>
-<?php
+$form = new Form();
+
+$section = new Form_Section("User");
+
+$section->addInput(new Form_Input(
+ 'usernamefld',
+ 'Username',
+ 'text',
+ $pconfig['usernamefld']
+));
+
+$pwd = new Form_Input(
+ 'passwordfld',
+ 'Password',
+ 'text',
+ $pconfig['passwordfld']
+);
+
+if (isset($id) && $a_secret[$id]) {
+ $pwd->setHelp('If you want to change the users password, enter it here.');
+}
+
+$section->addPassword($pwd);
+
+$section->addInput(new Form_IpAddress(
+ 'ip',
+ 'IP Address',
+ $pconfig['ip']
+))->setHelp('If you want the user to be assigned a specific IP address, enter it here.');
+
+$form->add($section);
+
+if (isset($id) && $a_secret[$id]) {
+ $form->addGlobal(new Form_Input(
+ 'id',
+ null,
+ 'hidden',
+ $i
+ ));
+}
+
+print($form);
+
include("foot.inc");
diff --git a/src/usr/local/www/vpn_openvpn_client.php b/src/usr/local/www/vpn_openvpn_client.php
index 2fe4fca..43549c4 100644
--- a/src/usr/local/www/vpn_openvpn_client.php
+++ b/src/usr/local/www/vpn_openvpn_client.php
@@ -65,6 +65,8 @@ require("guiconfig.inc");
require_once("openvpn.inc");
require_once("pkg-utils.inc");
+global $openvpn_topologies;
+
$pgtitle = array(gettext("VPN"), gettext("OpenVPN"), gettext("Client"));
$shortcut_section = "openvpn";
@@ -188,6 +190,7 @@ if ($_GET['act'] == "edit") {
$pconfig['use_shaper'] = $a_client[$id]['use_shaper'];
$pconfig['compression'] = $a_client[$id]['compression'];
$pconfig['passtos'] = $a_client[$id]['passtos'];
+ $pconfig['topology'] = $a_client[$id]['topology'];
// just in case the modes switch
$pconfig['autokey_enable'] = "yes";
@@ -253,6 +256,10 @@ if ($_POST) {
$input_errors[] = $result;
}
+ if (!array_key_exists($pconfig['topology'], $openvpn_topologies)) {
+ $input_errors[] = gettext("The field 'Topology' contains an invalid selection");
+ }
+
if ($pconfig['proxy_addr']) {
if ($result = openvpn_validate_host($pconfig['proxy_addr'], 'Proxy host or address')) {
@@ -267,6 +274,10 @@ if ($_POST) {
if (empty($pconfig['proxy_user']) || empty($pconfig['proxy_passwd'])) {
$input_errors[] = gettext("User name and password are required for proxy with authentication.");
}
+
+ if ($pconfig['proxy_passwd'] != $pconfig['proxy_passwd_confirm']) {
+ $input_errors[] = gettext("Password and confirmation must match.");
+ }
}
}
@@ -328,12 +339,20 @@ if ($_POST) {
$input_errors[] = gettext("If no Client Certificate is selected, a username and/or password must be entered.");
}
+ if ($pconfig['auth_pass'] != $pconfig['auth_pass_confirm']) {
+ $input_errors[] = gettext("Password and confirmation must match.");
+ }
+
if (!$input_errors) {
$client = array();
foreach ($simplefields as $stat) {
- update_if_changed($stat, $client[$stat], $_POST[$stat]);
+ if (($stat == 'auth_pass') && ($_POST[$stat] == DMYPWD)) {
+ $client[$stat] = $a_client[$id]['auth_pass'];
+ } else {
+ update_if_changed($stat, $client[$stat], $_POST[$stat]);
+ }
}
if ($vpnid) {
@@ -356,9 +375,12 @@ if ($_POST) {
$client['proxy_port'] = $pconfig['proxy_port'];
$client['proxy_authtype'] = $pconfig['proxy_authtype'];
$client['proxy_user'] = $pconfig['proxy_user'];
- $client['proxy_passwd'] = $pconfig['proxy_passwd'];
+ if ($pconfig['proxy_passwd'] != DMYPWD) {
+ $client['proxy_passwd'] = $pconfig['proxy_passwd'];
+ }
$client['description'] = $pconfig['description'];
$client['mode'] = $pconfig['mode'];
+ $client['topology'] = $pconfig['topology'];
$client['custom_options'] = str_replace("\r\n", "\n", $pconfig['custom_options']);
if ($tls_mode) {
@@ -498,7 +520,7 @@ if ($act=="new" || $act=="edit"):
'proxy_authtype',
'Proxy Auth. - Extra options',
$pconfig['proxy_authtype'],
- array('none' => 'none', 'basic' => 'basic', 'ntlm' => 'ntlm')
+ array('none' => gettext('none'), 'basic' => gettext('basic'), 'ntlm' => gettext('ntlm'))
));
$section->addInput(new Form_Input(
@@ -508,7 +530,7 @@ if ($act=="new" || $act=="edit"):
$pconfig['proxy_user']
));
- $section->addInput(new Form_Input(
+ $section->addPassword(new Form_Input(
'proxy_passwd',
'Password',
'password',
@@ -541,7 +563,7 @@ if ($act=="new" || $act=="edit"):
$pconfig['auth_user']
))->setHelp('Leave empty when no user name is needed');
- $section->addInput(new Form_Input(
+ $section->addPassword(new Form_Input(
'auth_pass',
'Password',
'password',
@@ -659,7 +681,7 @@ if ($act=="new" || $act=="edit"):
'IPv4 Tunnel Network',
'text',
$pconfig['tunnel_network']
- ))->setHelp('This is the IPv4 virtual network used for private communications between this client and the sercer ' .
+ ))->setHelp('This is the IPv4 virtual network used for private communications between this client and the server ' .
'expressed using CIDR (eg. 10.0.8.0/24). The first network address will be assigned to ' .
'the client virtual interface.');
@@ -705,6 +727,13 @@ $section->addInput(new Form_Input(
$openvpn_compression_modes
))->setHelp('Compress tunnel packets using the LZO algorithm. Adaptive compression will dynamically disable compression for a period of time if OpenVPN detects that the data in the packets is not being compressed efficiently.');
+ $section->addInput(new Form_Select(
+ 'topology',
+ 'Topology',
+ $pconfig['topology'],
+ $openvpn_topologies
+ ))->setHelp('Specifies the method used to configure a virtual adapter IP address.');
+
$section->addInput(new Form_Checkbox(
'passtos',
'Type-of-Service',
@@ -785,7 +814,7 @@ else:
<th><?=gettext("Protocol")?></th>
<th><?=gettext("Server")?></th>
<th><?=gettext("Description")?></th>
- <th><!-- Buttons --></th>
+ <th><?=gettext("Actions")?></th>
</tr>
</thead>
@@ -866,6 +895,7 @@ events.push(function() {
function dev_mode_change() {
hideCheckbox('no_tun_ipv6', ($('#dev_mode').val() == 'tap'));
+ hideInput('topology', ($('#dev_mode').val() == 'tap'));
}
// Process "Automatically generate a shared key" checkbox
diff --git a/src/usr/local/www/vpn_openvpn_csc.php b/src/usr/local/www/vpn_openvpn_csc.php
index 0dddf20..71c1862 100644
--- a/src/usr/local/www/vpn_openvpn_csc.php
+++ b/src/usr/local/www/vpn_openvpn_csc.php
@@ -335,7 +335,7 @@ if ($act == "new" || $act == "edit"):
if (is_array($config['openvpn']['openvpn-server'])) {
foreach ($config['openvpn']['openvpn-server'] as $serversettings) {
if (in_array($serversettings['mode'], $openvpn_tls_server_modes)) {
- $serveroptionlist[$serversettings['vpnid']] = "OpenVPN Server {$serversettings['vpnid']}: {$serversettings['description']}";
+ $serveroptionlist[$serversettings['vpnid']] = sprintf(gettext("OpenVPN Server %d: %s"), $serversettings['vpnid'], $serversettings['description']);
}
}
}
@@ -665,7 +665,7 @@ else : // Not an 'add' or an 'edit'. Just the table of Override CSCs
<th><?=gettext("Disabled")?></th>
<th><?=gettext("Common Name")?></th>
<th><?=gettext("Description")?></th>
- <th> <!-- Buttons --></th>
+ <th><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody>
diff --git a/src/usr/local/www/vpn_openvpn_server.php b/src/usr/local/www/vpn_openvpn_server.php
index a2d5d46..26fbe2a 100644
--- a/src/usr/local/www/vpn_openvpn_server.php
+++ b/src/usr/local/www/vpn_openvpn_server.php
@@ -126,7 +126,7 @@ if ($_GET['act'] == "del") {
}
unset($a_server[$id]);
write_config();
- $savemsg = gettext("Server successfully deleted")."<br />";
+ $savemsg = gettext("Server successfully deleted");
}
if ($_GET['act'] == "new") {
@@ -409,7 +409,7 @@ if ($_POST) {
}
}
- if ($pconfig['maxclients'] && !is_numeric($pconfig['maxclients'])) {
+ if ($pconfig['maxclients'] && !is_numericint($pconfig['maxclients'])) {
$input_errors[] = gettext("The field 'Concurrent connections' must be numeric.");
}
@@ -447,7 +447,7 @@ if ($_POST) {
if (($pconfig['serverbridge_dhcp_end'] && !is_ipaddrv4($pconfig['serverbridge_dhcp_end']))) {
$input_errors[] = gettext("Server Bridge DHCP End must be an IPv4 address.");
}
- if (ip2ulong($pconfig['serverbridge_dhcp_start']) > ip2ulong($pconfig['serverbridge_dhcp_end'])) {
+ if (ip_greater_than($pconfig['serverbridge_dhcp_start'], $pconfig['serverbridge_dhcp_end'])) {
$input_errors[] = gettext("The Server Bridge DHCP range is invalid (start higher than end).");
}
}
@@ -603,7 +603,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box_np($savemsg, 'success');
+ print_info_box($savemsg, 'success');
}
$tab_array = array();
@@ -762,7 +762,7 @@ if ($act=="new" || $act=="edit"):
}
}
} else {
- $certhelp = sprintf('%s%s%s$s', '<span id="certtype">', gettext('No Certificates defined. You may create one here: '), '<a href="system_camanager.php">System &gt; Cert Manager</a>', '</span>');
+ $certhelp = sprintf('%s%s%s$s', '<span id="certtype">', gettext('No Certificates defined. You may create one here: '), '<a href="system_camanager.php">' . gettext("System &gt; Cert Manager") . '</a>', '</span>');
}
$cl = openvpn_build_cert_list(false, true);
@@ -824,14 +824,14 @@ if ($act=="new" || $act=="edit"):
'cert_depth',
'Certificate Depth',
$pconfig['cert_depth'],
- $openvpn_cert_depths
+ ["" => gettext("Do Not Check")] + $openvpn_cert_depths
))->setHelp('When a certificate-based client logs in, do not accept certificates below this depth. ' .
'Useful for denying certificates made with intermediate CAs generated from the same CA as the server.');
$section->addInput(new Form_Checkbox(
'strictusercn',
'Strict User-CN Matching',
- null,
+ 'Enforce match',
$pconfig['strictusercn']
))->setHelp('When authenticating users, enforce a match between the common name of the client certificate and the username given at login.');
@@ -982,6 +982,7 @@ if ($act=="new" || $act=="edit"):
$form->add($section);
$section = new Form_Section('Client Settings');
+ $section->addClass('advanced');
$section->addInput(new Form_Checkbox(
'dynamic_ip',
@@ -1083,10 +1084,6 @@ if ($act=="new" || $act=="edit"):
$pconfig['ntp_server2']
));
- $form->add($section);
-
- $section = new Form_Section('NetBIOS Options');
-
$section->addInput(new Form_Checkbox(
'netbios_enable',
'NetBIOS enable',
@@ -1150,7 +1147,6 @@ if ($act=="new" || $act=="edit"):
$form->add($section);
$section = new Form_Section('Advanced Configuration');
- $section->addClass('advanced');
$section->addInput(new Form_Textarea(
'custom_options',
@@ -1200,7 +1196,7 @@ else:
<th><?=gettext("Protocol / Port")?></th>
<th><?=gettext("Tunnel Network")?></th>
<th><?=gettext("Description")?></th>
- <th><!-- Buttons --></th>
+ <th><?=gettext("Actions")?></th>
</tr>
</thead>
@@ -1270,7 +1266,7 @@ events.push(function() {
hideInput('certref', false);
hideInput('dh_length', false);
hideInput('cert_depth', false);
- hideInput('strictusercn', true);
+ hideCheckbox('strictusercn', true);
hideCheckbox('autokey_enable', true);
hideInput('shared_key', false);
hideInput('topology', false);
@@ -1280,7 +1276,7 @@ events.push(function() {
hideInput('certref', false);
hideInput('dh_length', false);
hideInput('cert_depth', false);
- hideInput('strictusercn', false);
+ hideCheckbox('strictusercn', false);
hideCheckbox('autokey_enable', true);
hideInput('shared_key', true);
hideInput('topology', false);
@@ -1295,7 +1291,7 @@ events.push(function() {
hideCheckbox('tlsauth_enable', true);
hideInput('dh_length', true);
hideInput('cert_depth', true);
- hideInput('strictusercn', true);
+ hideCheckbox('strictusercn', true);
hideCheckbox('autokey_enable', true);
hideInput('shared_key', false);
hideInput('topology', true);
@@ -1338,6 +1334,7 @@ events.push(function() {
break;
case "server_tls":
hideMultiClass('authmode', true);
+ hideClass('advanced', false);
hideCheckbox('autokey_enable', true);
default:
hideInput('custom_options', false);
@@ -1439,8 +1436,8 @@ events.push(function() {
hideInput('netbios_scope', hide);
hideCheckbox('wins_server_enable', hide);
wins_server_change();
- hideCheckbox('client_mgmt_port_enable', hide);
- client_mgmt_port_change();
+// hideCheckbox('client_mgmt_port_enable', hide);
+// client_mgmt_port_change();
}
function tuntap_change() {
diff --git a/src/usr/local/www/widgets/include/captiveportal.inc b/src/usr/local/www/widgets/include/captiveportal.inc
index 3714209..8a2ea3e 100644
--- a/src/usr/local/www/widgets/include/captiveportal.inc
+++ b/src/usr/local/www/widgets/include/captiveportal.inc
@@ -1,4 +1,4 @@
<?php
-$captive_portal_status_title = "Captive Portal Status";
+$captive_portal_status_title = gettext("Captive Portal Status");
$captive_portal_status_title_link = "status_captiveportal.php";
?>
diff --git a/src/usr/local/www/widgets/include/carp_status.inc b/src/usr/local/www/widgets/include/carp_status.inc
index 63a49fe..29a05ac 100644
--- a/src/usr/local/www/widgets/include/carp_status.inc
+++ b/src/usr/local/www/widgets/include/carp_status.inc
@@ -1,7 +1,7 @@
<?php
//set variable for custom title
-$carp_status_title = "CARP Status";
+$carp_status_title = gettext("CARP Status");
$carp_status_title_link = "status_carp.php";
?>
diff --git a/src/usr/local/www/widgets/include/dyn_dns_status.inc b/src/usr/local/www/widgets/include/dyn_dns_status.inc
index b2588db..314bb13 100644
--- a/src/usr/local/www/widgets/include/dyn_dns_status.inc
+++ b/src/usr/local/www/widgets/include/dyn_dns_status.inc
@@ -1,7 +1,7 @@
<?php
//set variable for custom title
-$dyn_dns_status_title = "Dynamic DNS Status";
+$dyn_dns_status_title = gettext("Dynamic DNS Status");
$dyn_dns_status_title_link = "services_dyndns.php";
?>
diff --git a/src/usr/local/www/widgets/include/gateways.inc b/src/usr/local/www/widgets/include/gateways.inc
index 4666689..971c842 100644
--- a/src/usr/local/www/widgets/include/gateways.inc
+++ b/src/usr/local/www/widgets/include/gateways.inc
@@ -1,5 +1,5 @@
<?php
//set variable for custom title
-$gateways_title = "Gateways";
+$gateways_title = gettext("Gateways");
$gateways_title_link = "status_gateways.php";
?>
diff --git a/src/usr/local/www/widgets/include/gmirror_status.inc b/src/usr/local/www/widgets/include/gmirror_status.inc
index 6547d4d..c9b2224 100644
--- a/src/usr/local/www/widgets/include/gmirror_status.inc
+++ b/src/usr/local/www/widgets/include/gmirror_status.inc
@@ -1,4 +1,4 @@
<?php
-$gmirror_status_title = "GEOM Mirror Status";
+$gmirror_status_title = gettext("GEOM Mirror Status");
$gmirror_status_title_link = "diag_gmirror.php";
?> \ No newline at end of file
diff --git a/src/usr/local/www/widgets/include/installed_packages.inc b/src/usr/local/www/widgets/include/installed_packages.inc
index a978191..aa75e85 100644
--- a/src/usr/local/www/widgets/include/installed_packages.inc
+++ b/src/usr/local/www/widgets/include/installed_packages.inc
@@ -1,7 +1,7 @@
<?php
//set variable for custom title
-$installed_packages_title = "Installed Packages";
+$installed_packages_title = gettext("Installed Packages");
$installed_packages_title_link = "pkg_mgr_installed.php";
?> \ No newline at end of file
diff --git a/src/usr/local/www/widgets/include/interface_statistics.inc b/src/usr/local/www/widgets/include/interface_statistics.inc
index c789418..bda7aba 100644
--- a/src/usr/local/www/widgets/include/interface_statistics.inc
+++ b/src/usr/local/www/widgets/include/interface_statistics.inc
@@ -1,5 +1,5 @@
<?php
//set variable for custom title
-$interface_statistics_title = "Interface Statistics";
+$interface_statistics_title = gettext("Interface Statistics");
$interface_statistics_title_link = "status_interfaces.php";
?> \ No newline at end of file
diff --git a/src/usr/local/www/widgets/include/interfaces.inc b/src/usr/local/www/widgets/include/interfaces.inc
index 6c19a6b..d619d23 100644
--- a/src/usr/local/www/widgets/include/interfaces.inc
+++ b/src/usr/local/www/widgets/include/interfaces.inc
@@ -1,6 +1,6 @@
<?php
//set variable for custom title
-$interfaces_title = "Interfaces";
+$interfaces_title = gettext("Interfaces");
$interfaces_title_link = "status_interfaces.php";
?> \ No newline at end of file
diff --git a/src/usr/local/www/widgets/include/ipsec.inc b/src/usr/local/www/widgets/include/ipsec.inc
index 59fe454..0c8ba80 100644
--- a/src/usr/local/www/widgets/include/ipsec.inc
+++ b/src/usr/local/www/widgets/include/ipsec.inc
@@ -1,4 +1,4 @@
<?php
-$ipsec_title = "IPsec";
+$ipsec_title = gettext("IPsec");
$ipsec_title_link = "status_ipsec.php";
?>
diff --git a/src/usr/local/www/widgets/include/load_balancer.inc b/src/usr/local/www/widgets/include/load_balancer.inc
index 367ea46..5f89933 100644
--- a/src/usr/local/www/widgets/include/load_balancer.inc
+++ b/src/usr/local/www/widgets/include/load_balancer.inc
@@ -1,4 +1,4 @@
<?php
-$load_balancer_status_title = "Load Balancer Status";
+$load_balancer_status_title = gettext("Load Balancer Status");
$load_balancer_status_title_link = "status_lb_pool.php";
?>
diff --git a/src/usr/local/www/widgets/include/log.inc b/src/usr/local/www/widgets/include/log.inc
index d2bafb0..fa48047 100644
--- a/src/usr/local/www/widgets/include/log.inc
+++ b/src/usr/local/www/widgets/include/log.inc
@@ -1,6 +1,6 @@
<?php
//set variable for custom title
-$log_title = "Firewall Logs";
+$log_title = gettext("Firewall Logs");
$log_title_link = "status_logs_filter.php";
?> \ No newline at end of file
diff --git a/src/usr/local/www/widgets/include/ntp_status.inc b/src/usr/local/www/widgets/include/ntp_status.inc
index 1115095..cb5be1a 100644
--- a/src/usr/local/www/widgets/include/ntp_status.inc
+++ b/src/usr/local/www/widgets/include/ntp_status.inc
@@ -1,5 +1,5 @@
<?php
//set variable for custom title
-$ntp_status_title = "NTP Status";
+$ntp_status_title = gettext("NTP Status");
$ntp_status_title_link = "status_ntpd.php";
?>
diff --git a/src/usr/local/www/widgets/include/openvpn.inc b/src/usr/local/www/widgets/include/openvpn.inc
index 075d0e5..8eb11c1 100644
--- a/src/usr/local/www/widgets/include/openvpn.inc
+++ b/src/usr/local/www/widgets/include/openvpn.inc
@@ -1,4 +1,4 @@
<?php
-$openvpn_title = "OpenVPN";
+$openvpn_title = gettext("OpenVPN");
$openvpn_title_link = "status_openvpn.php";
?> \ No newline at end of file
diff --git a/src/usr/local/www/widgets/include/services_status.inc b/src/usr/local/www/widgets/include/services_status.inc
index 685aee4..6691d42 100644
--- a/src/usr/local/www/widgets/include/services_status.inc
+++ b/src/usr/local/www/widgets/include/services_status.inc
@@ -1,7 +1,7 @@
<?php
//set variable for custom title
-$services_status_title = "Services Status";
+$services_status_title = gettext("Services Status");
$services_status_title_link = "status_services.php";
?> \ No newline at end of file
diff --git a/src/usr/local/www/widgets/include/smart_status.inc b/src/usr/local/www/widgets/include/smart_status.inc
index bbfa274..cfcb9a9 100644
--- a/src/usr/local/www/widgets/include/smart_status.inc
+++ b/src/usr/local/www/widgets/include/smart_status.inc
@@ -1,5 +1,5 @@
<?php
//set variable for custom title
-$smart_status_title = "SMART Status";
+$smart_status_title = gettext("SMART Status");
$smart_status_title_link = "diag_smart.php";
?>
diff --git a/src/usr/local/www/widgets/include/thermal_sensors.inc b/src/usr/local/www/widgets/include/thermal_sensors.inc
index e6ddb58..6ec2141 100644
--- a/src/usr/local/www/widgets/include/thermal_sensors.inc
+++ b/src/usr/local/www/widgets/include/thermal_sensors.inc
@@ -11,7 +11,7 @@
*/
//set variable for custom title
-$thermal_sensors_widget_title = "Thermal Sensors";
+$thermal_sensors_widget_title = gettext("Thermal Sensors");
//$thermal_sensors_widget_link = "thermal_sensors.php";
diff --git a/src/usr/local/www/widgets/include/traffic_graph.inc b/src/usr/local/www/widgets/include/traffic_graph.inc
index 3901db6..76da208 100644
--- a/src/usr/local/www/widgets/include/traffic_graph.inc
+++ b/src/usr/local/www/widgets/include/traffic_graph.inc
@@ -1,4 +1,4 @@
<?php
-$traffic_graphs_title = "Traffic Graphs";
+$traffic_graphs_title = gettext("Traffic Graphs");
$traffic_graphs_title_link = "status_graph.php";
?>
diff --git a/src/usr/local/www/widgets/include/wake_on_lan.inc b/src/usr/local/www/widgets/include/wake_on_lan.inc
index af3229c..accab90 100644
--- a/src/usr/local/www/widgets/include/wake_on_lan.inc
+++ b/src/usr/local/www/widgets/include/wake_on_lan.inc
@@ -1,7 +1,7 @@
<?php
//set variable for custom title
-$wake_on_lan_title = "Wake On Lan";
+$wake_on_lan_title = gettext("Wake On Lan");
$wake_on_lan_title_link = "services_wol.php";
?> \ No newline at end of file
diff --git a/src/usr/local/www/widgets/javascript/cpu_graphs.js b/src/usr/local/www/widgets/javascript/cpu_graphs.js
index 1fc690a..2e00e67 100644
--- a/src/usr/local/www/widgets/javascript/cpu_graphs.js
+++ b/src/usr/local/www/widgets/javascript/cpu_graphs.js
@@ -36,7 +36,7 @@ var GL_DYNAMIC = 1;
function GraphInitialize(element_id, width, height, bar_width) {
// Find the page element which will contain the graph
var owner;
- if((owner = jQuery('#' + element_id)) == null) {
+ if((owner = $('#' + element_id)) == null) {
alert("GraphLink Error: Element ID '" + element_id + "' not found.");
return false;
}
@@ -72,10 +72,10 @@ function GraphInitialize(element_id, width, height, bar_width) {
graph_html += '</div>';
owner.html(graph_html);
- graph['element_id'] = jQuery('#GraphLinkData' + graph['id']);
+ graph['element_id'] = $('#GraphLinkData' + graph['id']);
for(i = 0; i < bar_count; i++) {
- graph['spans'][i] = jQuery('#GraphLinkBar' + graph['id'] + '_' + i);
+ graph['spans'][i] = $('#GraphLinkBar' + graph['id'] + '_' + i);
graph['spans'][i].css('width',bar_width + 'px');
graph['spans'][i].css('margin-top',height + 'px');
}
@@ -241,5 +241,5 @@ function GraphDraw(graph) {
for(var i = 0; i < count; i++)
graph['spans'][i].css("marginTop", getMargin(i));
-// jQuery('#' + graph['spans'][count - 1]).fadeIn(500);
+// $('#' + graph['spans'][count - 1]).fadeIn(500);
}
diff --git a/src/usr/local/www/widgets/javascript/thermal_sensors.js b/src/usr/local/www/widgets/javascript/thermal_sensors.js
index 4733f67..cc575e7 100644
--- a/src/usr/local/www/widgets/javascript/thermal_sensors.js
+++ b/src/usr/local/www/widgets/javascript/thermal_sensors.js
@@ -65,7 +65,7 @@ function showThermalSensorsData() {
//IE fix to disable cache when using http:// , just append timespan
+ new Date().getTime();
- jQuery.ajax(url, {
+ $.ajax(url, {
type: 'get',
success: function(data) {
var thermalSensorsData = data || "";
@@ -112,9 +112,9 @@ function loadThermalSensorsContainer (thermalSensorsContent) {
if (thermalSensorsContent && thermalSensorsContent != "") {
//load generated graph (or raw data) into thermalSensorsContainer (thermalSensorsContainer DIV defined in "thermal_sensors.widget.php")
- jQuery('#thermalSensorsContainer').html(thermalSensorsContent);
+ $('#thermalSensorsContainer').html(thermalSensorsContent);
} else {
- jQuery('#thermalSensorsContainer').html("No Thermal Sensors data available.");
+ $('#thermalSensorsContainer').html("No Thermal Sensors data available.");
}
}
diff --git a/src/usr/local/www/widgets/javascript/traffic_graph.js b/src/usr/local/www/widgets/javascript/traffic_graph.js
index 383a549..51f55ed 100644
--- a/src/usr/local/www/widgets/javascript/traffic_graph.js
+++ b/src/usr/local/www/widgets/javascript/traffic_graph.js
@@ -1,13 +1,13 @@
function trafficshowDiv(incDiv,ifDescription,refreshIntervalSec,swapButtons) {
// put the graph object HTML in the element and make it appear
selectedDiv = incDiv + "graphdiv";
- jQuery('#' + selectedDiv).html(
+ $('#' + selectedDiv).html(
'<object data="graph.php?ifnum=' + incDiv + '&amp;ifname=' + ifDescription + '&amp;timeint=' + refreshIntervalSec + '&amp;initdelay=0" height="100%" width="100%">' +
'<param name="id" value="graph" />' +
'<param name="type" value="image/svg+xml" />' +
'<param name="pluginspage" value="http://www.adobe.com/svg/viewer/install/auto" />' +
'</object>');
- jQuery('#' + selectedDiv).effect('blind',{mode:'show'},1000);
+ $('#' + selectedDiv).effect('blind',{mode:'show'},1000);
d = document;
if (swapButtons) {
selectIntLink = selectedDiv + "-min";
@@ -24,8 +24,8 @@ function trafficshowDiv(incDiv,ifDescription,refreshIntervalSec,swapButtons) {
function trafficminimizeDiv(incDiv,swapButtons) {
// remove the graph object HTML from the element (so it does not keep using CPU) and fade
selectedDiv = incDiv + "graphdiv";
- jQuery('#' + selectedDiv).html('');
- jQuery('#' + selectedDiv).effect('blind',{mode:'hide'},1000);
+ $('#' + selectedDiv).html('');
+ $('#' + selectedDiv).effect('blind',{mode:'hide'},1000);
d = document;
if (swapButtons) {
selectIntLink = selectedDiv + "-open";
diff --git a/src/usr/local/www/widgets/widgets/captive_portal_status.widget.php b/src/usr/local/www/widgets/widgets/captive_portal_status.widget.php
index c325b54..c91d1c0 100644
--- a/src/usr/local/www/widgets/widgets/captive_portal_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/captive_portal_status.widget.php
@@ -130,8 +130,8 @@ if ($_GET['order']) {
<table class="table table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
<tr>
- <th><a href="?order=ip&amp;showact=<?=$showact;?>">IP address</a></th>
- <th><a href="?order=mac&amp;showact=<?=$showact;?>">MAC address</a></th>
+ <th><a href="?order=ip&amp;showact=<?=$showact;?>"><?=gettext("IP address");?></a></th>
+ <th><a href="?order=mac&amp;showact=<?=$showact;?>"><?=gettext("MAC address");?></a></th>
<th><a href="?order=user&amp;showact=<?=$showact;?>"><?=gettext("Username");?></a></th>
<?php if ($showact == 1): ?>
<th><a href="?order=start&amp;showact=<?=$showact;?>"><?=gettext("Session start");?></a></th>
@@ -151,7 +151,7 @@ if ($_GET['order']) {
<?php endif; ?>
<td>
<a href="?order=<?=htmlspecialchars($_GET['order']);?>&amp;showact=<?=$showact;?>&amp;act=del&amp;zone=<?=$cpent[10];?>&amp;id=<?=$cpent[5];?>" class="btn btn-xs btn-danger">
- delete
+ <?=gettext("delete");?>
</a>
</td>
</tr>
diff --git a/src/usr/local/www/widgets/widgets/carp_status.widget.php b/src/usr/local/www/widgets/widgets/carp_status.widget.php
index 8884e2b..2349ede 100644
--- a/src/usr/local/www/widgets/widgets/carp_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/carp_status.widget.php
@@ -114,7 +114,7 @@ $carp_enabled = get_carp_status();
}
} else {
?>
- <tr><td>No CARP Interfaces Defined. Click <a href="status_carp.php">here</a> to configure CARP.</td></tr>
+ <tr><td><?=gettext('No CARP Interfaces Defined.')?> <?=sprintf(gettext('Click %1$shere%2$s to configure CARP.'), '<a href="status_carp.php">', '</a>')?></td></tr>
<?php
}
?>
diff --git a/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php b/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
index e6454cb..c8de7df 100644
--- a/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
@@ -65,24 +65,48 @@ if (!is_array($config['dyndnses']['dyndns'])) {
$config['dyndnses']['dyndns'] = array();
}
-$a_dyndns = &$config['dyndnses']['dyndns'];
+$a_dyndns = $config['dyndnses']['dyndns'];
+
+if (!is_array($config['dnsupdates']['dnsupdate'])) {
+ $config['dnsupdates']['dnsupdate'] = array();
+}
+
+$a_rfc2136 = $config['dnsupdates']['dnsupdate'];
+
+$all_dyndns = array_merge($a_dyndns, $a_rfc2136);
if ($_REQUEST['getdyndnsstatus']) {
$first_entry = true;
- foreach ($a_dyndns as $dyndns) {
+ foreach ($all_dyndns as $dyndns) {
if ($first_entry) {
$first_entry = false;
} else {
// Put a vertical bar delimiter between the echoed HTML for each entry processed.
echo "|";
}
+ $cache_sep = ":";
+ if ($dyndns['type'] == "namecheap") {
+ $hostname = $dyndns['host'] . "." . $dyndns['domainname'];
+ } elseif (empty($dyndns['type'])) {
+ /* RFC2136, add some dummy values */
+ $dyndns['type'] = '_rfc2136_';
+ $dyndns['id'] = '_' . $dyndns['server'];
+ $hostname = $dyndns['host'];
+ $cache_sep = "|";
+ } else {
+ $hostname = $dyndns['host'];
+ }
- $filename = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache";
+ $filename = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($hostname) . "{$dyndns['id']}.cache";
if (file_exists($filename)) {
- $ipaddr = dyndnsCheckIP($dyndns['interface']);
- $cached_ip_s = explode(':', file_get_contents($filename));
+ if (($dyndns['type'] == '_rfc2136_') && (!isset($dyndns['usepublicip']))) {
+ $ipaddr = get_interface_ip(get_failover_interface($dyndns['interface']));
+ } else {
+ $ipaddr = dyndnsCheckIP($dyndns['interface']);
+ }
+ $cached_ip_s = explode($cache_sep, file_get_contents($filename));
$cached_ip = $cached_ip_s[0];
- if ($ipaddr <> $cached_ip) {
+ if (trim($ipaddr) != trim($cached_ip)) {
print('<span class="text-danger">');
} else {
print('<span class="text-success">');
@@ -108,7 +132,18 @@ if ($_REQUEST['getdyndnsstatus']) {
</tr>
</thead>
<tbody>
- <?php $dyndnsid = 0; foreach ($a_dyndns as $dyndns): ?>
+ <?php $dyndnsid = 0; foreach ($all_dyndns as $dyndns):
+
+ if ($dyndns['type'] == "namecheap") {
+ $hostname = $dyndns['host'] . "." . $dyndns['domainname'];
+ } elseif (empty($dyndns['type'])) {
+ /* RFC2136, add some dummy values */
+ $dyndns['type'] = '_rfc2136_';
+ $dyndns['id'] = '_' . $dyndns['server'];
+ $hostname = $dyndns['host'];
+ } else {
+ $hostname = $dyndns['host'];
+ } ?>
<tr ondblclick="document.location='services_dyndns_edit.php?id=<?=$dyndnsid;?>'"<?=!isset($dyndns['enable'])?' class="disabled"':''?>>
<td>
<?php $iflist = get_configured_interface_with_descr();
@@ -137,11 +172,14 @@ if ($_REQUEST['getdyndnsstatus']) {
break;
}
}
+ if ($dyndns['type'] == '_rfc2136_') : ?>
+ RFC 2136
+ <? endif;
?>
</td>
<td>
<?php
- print(htmlspecialchars($dyndns['host']));
+ print(htmlspecialchars($hostname));
?>
</td>
<td>
@@ -158,7 +196,7 @@ if ($_REQUEST['getdyndnsstatus']) {
scroll(0,0);
var url = "/widgets/widgets/dyn_dns_status.widget.php";
var pars = 'getdyndnsstatus=yes';
- jQuery.ajax(
+ $.ajax(
url,
{
type: 'get',
@@ -173,7 +211,7 @@ if ($_REQUEST['getdyndnsstatus']) {
var responseStrings = transport.responseText.split("|");
for (var count=0; count<responseStrings.length; count++) {
var divlabel = '#dyndnsstatus' + count;
- jQuery(divlabel).prop('innerHTML',responseStrings[count]);
+ $(divlabel).prop('innerHTML',responseStrings[count]);
}
}
// Do the first status check 2 seconds after the dashboard opens
diff --git a/src/usr/local/www/widgets/widgets/gateways.widget.php b/src/usr/local/www/widgets/widgets/gateways.widget.php
index b11162b..ccb47ea 100644
--- a/src/usr/local/www/widgets/widgets/gateways.widget.php
+++ b/src/usr/local/www/widgets/widgets/gateways.widget.php
@@ -64,35 +64,127 @@ require_once("pfsense-utils.inc");
require_once("functions.inc");
require_once("/usr/local/www/widgets/include/gateways.inc");
-$a_gateways = return_gateways_array();
-$gateways_status = array();
-$gateways_status = return_gateways_status(true);
+// Compose the table contents and pass it back to the ajax caller
+if ($_REQUEST && $_REQUEST['ajax']) {
+ print(compose_table_body_contents());
+ exit;
+}
-if (isset($config["widgets"]["gateways_widget"]["display_type"])) {
- $display_type = $config["widgets"]["gateways_widget"]["display_type"];
-} else {
- $display_type = "gw_ip";
+if ($_POST) {
+ if (!is_array($config["widgets"]["gateways_widget"])) {
+ $config["widgets"]["gateways_widget"] = array();
+ }
+ if (isset($_POST["display_type"])) {
+ $config["widgets"]["gateways_widget"]["display_type"] = $_POST["display_type"];
+ }
+ write_config(gettext("Updated gateways widget settings via dashboard."));
+ header("Location: /");
+ exit(0);
}
+?>
-// Compose the table contents and pass it back to the ajax caller
-if ($_REQUEST && $_REQUEST['ajax']) {
- global $a_gateways, $gateways_status;
+<table class="table table-striped table-hover">
+ <thead>
+ <tr>
+ <th><?=gettext("Name")?></th>
+ <th>RTT</th>
+ <th>RTTsd</th>
+ <th><?=gettext("Loss")?></th>
+ <th><?=gettext("Status")?></th>
+ </tr>
+ </thead>
+ <tbody id="gwtblbody">
+<?php
+ print(compose_table_body_contents());
+?>
+ </tbody>
+</table>
+
+<!-- close the body we're wrapped in and add a configuration-panel -->
+</div>
+
+<div id="widget-<?=$widgetname?>_panel-footer" class="panel-footer collapse">
+<input type="hidden" id="gateways-config" name="gateways-config" value="" />
+
+<div id="gateways-settings" class="widgetconfigdiv" >
+ <form action="/widgets/widgets/gateways.widget.php" method="post" name="gateways_widget_iform" id="gateways_widget_iform">
+ Display:
+ <?php
+ $display_type_gw_ip = "checked";
+ $display_type_monitor_ip = "";
+ $display_type_both_ip = "";
+ if (isset($config["widgets"]["gateways_widget"]["display_type"])) {
+ $selected_radio = $config["widgets"]["gateways_widget"]["display_type"];
+ if ($selected_radio == "gw_ip") {
+ $display_type_gw_ip = "checked";
+ $display_type_monitor_ip = "";
+ $display_type_both_ip = "";
+ } else if ($selected_radio == "monitor_ip") {
+ $display_type_gw_ip = "";
+ $display_type_monitor_ip = "checked";
+ $display_type_both_ip = "";
+ } else if ($selected_radio == "both_ip") {
+ $display_type_gw_ip = "";
+ $display_type_monitor_ip = "";
+ $display_type_both_ip = "checked";
+ }
+ }
+ ?>
+ <input name="display_type" class="radio" type="radio" id="display_type_gw_ip" value="gw_ip" <?=$display_type_gw_ip;?> onchange="updateGatewayDisplays();" /> <span><?=gettext('Gateway IP')?></span>
+ <input name="display_type" class="radio" type="radio" id="display_type_monitor_ip" value="monitor_ip" <?=$display_type_monitor_ip;?> onchange="updateGatewayDisplays();" /> <span><?=gettext('Monitor IP')?></span>
+ <input name="display_type" class="radio" type="radio" id="display_type_both_ip" value="both_ip" <?=$display_type_both_ip;?> onchange="updateGatewayDisplays();" /> <span><?=gettext('Both')?></span>
+ <br /><br />
+ <input id="submit_settings" name="submit_settings" type="submit" onclick="return updatePref();" class="formbtn" value="<?=gettext('Save Settings')?>" />
+ </form>
+</div>
+
+<script type="text/javascript">
+//<![CDATA[
+
+ function get_gw_stats() {
+ var ajaxRequest;
+
+ ajaxRequest = $.ajax({
+ url: "/widgets/widgets/gateways.widget.php",
+ type: "post",
+ data: { ajax: "ajax"}
+ });
+
+ // Deal with the results of the above ajax call
+ ajaxRequest.done(function (response, textStatus, jqXHR) {
+ $('#gwtblbody').html(response);
+ // and do it again
+ setTimeout(get_gw_stats, 5000);
+ });
+ }
+
+ events.push(function(){
+ get_gw_stats();
+ });
+//]]>
+</script>
+
+<?php
+function compose_table_body_contents() {
+ global $config;
+
+ $rtnstr = '';
- print("<thead>\n");
- print( "<tr>\n");
- print( "<th>" . gettext("Name") . "</th>\n");
- print( "<th>RTT</th>\n");
- print( "<th>" . gettext("Loss") . "</th>\n");
- print( "<th>" . gettext("Status") . "</th>\n");
- print( "</tr>\n");
- print("</thead>\n");
- print("<tbody>\n");
+ $a_gateways = return_gateways_array();
+ $gateways_status = array();
+ $gateways_status = return_gateways_status(true);
+
+ if (isset($config["widgets"]["gateways_widget"]["display_type"])) {
+ $display_type = $config["widgets"]["gateways_widget"]["display_type"];
+ } else {
+ $display_type = "gw_ip";
+ }
foreach ($a_gateways as $gname => $gateway) {
- print("<tr>\n");
- print( "<td>\n");
- print(htmlspecialchars($gateway['name']) . "<br />");
- print('<div id="gateway' . $counter . '" style="display:inline"><b>');
+ $rtnstr .= "<tr>\n";
+ $rtnstr .= "<td>\n";
+ $rtnstr .= htmlspecialchars($gateway['name']) . "<br />";
+ $rtnstr .= '<div id="gateway' . $counter . '" style="display:inline"><b>';
$monitor_address = "";
$monitor_address_disp = "";
@@ -128,34 +220,34 @@ if ($_REQUEST && $_REQUEST['ajax']) {
$monitor_address_disp = "";
}
- print($if_gw . $monitor_address_disp);
+ $rtnstr .= $if_gw . $monitor_address_disp;
unset ($if_gw);
unset ($monitor_address);
unset ($monitor_address_disp);
$counter++;
- print( "</b>");
- print( "</div>\n");
- print( "</td>\n");
+ $rtnstr .= "</b>";
+ $rtnstr .= "</div>\n";
+ $rtnstr .= "</td>\n";
if ($gateways_status[$gname]) {
if (stristr($gateways_status[$gname]['status'], "force_down")) {
- $online = "Offline (forced)";
+ $online = gettext("Offline (forced)");
$bgcolor = "danger"; // lightcoral
} elseif (stristr($gateways_status[$gname]['status'], "down")) {
- $online = "Offline";
+ $online = gettext("Offline");
$bgcolor = "danger"; // lightcoral
} elseif (stristr($gateways_status[$gname]['status'], "loss")) {
- $online = "Packetloss";
+ $online = gettext("Packetloss");
$bgcolor = "warning"; // khaki
} elseif (stristr($gateways_status[$gname]['status'], "delay")) {
- $online = "Latency";
+ $online = gettext("Latency");
$bgcolor = "warning"; // khaki
} elseif ($gateways_status[$gname]['status'] == "none") {
- $online = "Online";
+ $online = gettext("Online");
$bgcolor = "success"; // lightgreen
} elseif ($gateways_status[$gname]['status'] == "") {
- $online = "Pending";
+ $online = gettext("Pending");
$bgcolor = "info"; // lightgray
}
} else {
@@ -163,94 +255,12 @@ if ($_REQUEST && $_REQUEST['ajax']) {
$bgcolor = "info"; // lightblue
}
- print( "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['delay']) : gettext("Pending")) . "</td>\n");
- print( "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['loss']) : gettext("Pending")) . "</td>\n");
- print('<td class="bg-' . $bgcolor . '">' . $online . "</td>\n");
- print("</tr>\n");
- }
-
- print("</tbody>\n");
-
- exit;
-}
-
-if ($_POST) {
- if (!is_array($config["widgets"]["gateways_widget"])) {
- $config["widgets"]["gateways_widget"] = array();
- }
- if (isset($_POST["display_type"])) {
- $config["widgets"]["gateways_widget"]["display_type"] = $_POST["display_type"];
+ $rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['delay']) : gettext("Pending")) . "</td>\n";
+ $rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['stddev']) : gettext("Pending")) . "</td>\n";
+ $rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['loss']) : gettext("Pending")) . "</td>\n";
+ $rtnstr .= '<td class="bg-' . $bgcolor . '">' . $online . "</td>\n";
+ $rtnstr .= "</tr>\n";
}
- write_config("Updated gateways widget settings via dashboard.");
- header("Location: /");
- exit(0);
+ return($rtnstr);
}
?>
-
-<table id="gwtbl" class="table table-striped table-hover">
- <tr><td><?=gettext("Retrieving gateways data")?>&nbsp;<i class="fa fa-cog fa-spin"></i></td></tr>
-</table>
-
-<!-- close the body we're wrapped in and add a configuration-panel -->
-</div>
-
-<script type="text/javascript">
-//<![CDATA[
-
- function get_gw_stats() {
- var ajaxRequest;
-
- ajaxRequest = $.ajax({
- url: "/widgets/widgets/gateways.widget.php",
- type: "post",
- data: { ajax: "ajax"}
- });
-
- // Deal with the results of the above ajax call
- ajaxRequest.done(function (response, textStatus, jqXHR) {
- $('#gwtbl').html(response);
- // and do it again
- setTimeout(get_gw_stats, 5000);
- });
- }
-
- events.push(function(){
- get_gw_stats();
- });
-//]]>
-</script>
-
-<div id="widget-<?=$widgetname?>_panel-footer" class="panel-footer collapse">
-<input type="hidden" id="gateways-config" name="gateways-config" value="" />
-
-<div id="gateways-settings" class="widgetconfigdiv" >
- <form action="/widgets/widgets/gateways.widget.php" method="post" name="gateways_widget_iform" id="gateways_widget_iform">
- Display:
- <?php
- $display_type_gw_ip = "checked";
- $display_type_monitor_ip = "";
- $display_type_both_ip = "";
- if (isset($config["widgets"]["gateways_widget"]["display_type"])) {
- $selected_radio = $config["widgets"]["gateways_widget"]["display_type"];
- if ($selected_radio == "gw_ip") {
- $display_type_gw_ip = "checked";
- $display_type_monitor_ip = "";
- $display_type_both_ip = "";
- } else if ($selected_radio == "monitor_ip") {
- $display_type_gw_ip = "";
- $display_type_monitor_ip = "checked";
- $display_type_both_ip = "";
- } else if ($selected_radio == "both_ip") {
- $display_type_gw_ip = "";
- $display_type_monitor_ip = "";
- $display_type_both_ip = "checked";
- }
- }
- ?>
- <input name="display_type" class="radio" type="radio" id="display_type_gw_ip" value="gw_ip" <?php echo $display_type_gw_ip; ?> onchange="updateGatewayDisplays();" /> <span>Gateway IP</span>
- <input name="display_type" class="radio" type="radio" id="display_type_monitor_ip" value="monitor_ip" <?php echo $display_type_monitor_ip; ?> onchange="updateGatewayDisplays();" /> <span>Monitor IP</span>
- <input name="display_type" class="radio" type="radio" id="display_type_both_ip" value="both_ip" <?php echo $display_type_both_ip; ?> onchange="updateGatewayDisplays();" /> <span>Both</span>
- <br /><br />
- <input id="submit_settings" name="submit_settings" type="submit" onclick="return updatePref();" class="formbtn" value="Save Settings" />
- </form>
-</div>
diff --git a/src/usr/local/www/widgets/widgets/installed_packages.widget.php b/src/usr/local/www/widgets/widgets/installed_packages.widget.php
index 255212a..dca7c0d 100644
--- a/src/usr/local/www/widgets/widgets/installed_packages.widget.php
+++ b/src/usr/local/www/widgets/widgets/installed_packages.widget.php
@@ -74,8 +74,8 @@ if ($_REQUEST && $_REQUEST['ajax']) {
if (empty($installed_packages)) {
print("<div class=\"alert alert-warning\" role=\"alert\">\n");
- print(" <strong>No packages installed.</strong>\n");
- print(" You can install packages <a href=\"pkg_mgr.php\" class=\"alert-link\">here</a>.\n");
+ print(" <strong>". gettext("No packages installed.") . "</strong>\n");
+ print(" " . gettext('You can install packages <a href="pkg_mgr.php" class="alert-link">here</a>.') . "\n");
print("</div>\n");
exit;
}
@@ -103,17 +103,17 @@ if ($_REQUEST && $_REQUEST['ajax']) {
if (isset($pkg['broken'])) {
$txtcolor = "text-danger";
$missing = true;
- $status = 'Package is configured, but not installed!';
+ $status = gettext('Package is configured, but not installed!');
} else if (isset($pkg['installed_version']) && isset($pkg['version'])) {
$version_compare = pkg_version_compare(
$pkg['installed_version'], $pkg['version']);
if ($version_compare == '>') {
// we're running a newer version of the package
- $status = 'Newer than available ('. $pkg['version'] .')';
+ $status = sprintf(gettext('Newer than available (%s)'), $pkg['version']);
$statusicon = 'exclamation';
} else if ($version_compare == '<') {
// we're running an older version of the package
- $status = 'Upgrade available to '.$pkg['version'];
+ $status = sprintf(gettext('Upgrade available to %s'), $pkg['version']);
$statusicon = 'plus-circle';
$txtcolor = "text-warning";
$upgradeavail = true;
@@ -121,15 +121,15 @@ if ($_REQUEST && $_REQUEST['ajax']) {
'&amp;to=' . $pkg['version'];
} else if ($version_compare == '=') {
// we're running the current version
- $status = 'ok';
+ $status = gettext('ok');
$statusicon = 'check';
} else {
- $status = 'Error comparing version';
+ $status = gettext('Error comparing version');
$statusicon = 'exclamation';
}
} else {
// unknown available package version
- $status = 'Unknown';
+ $status = gettext('Unknown');
$statusicon = 'question';
}
@@ -180,7 +180,7 @@ if ($_REQUEST && $_REQUEST['ajax']) {
</div>
<p class="text-center">
- <?=gettext("Packages may be added/managed here: ")?> <a href="pkg_mgr_installed.php">System -&gt; Packages</a>
+ <?=gettext("Packages may be added/managed here: ")?> <a href="pkg_mgr_installed.php"><?=gettext("System")?> -&gt; <?=gettext("Packages")?></a>
</p>
<script type="text/javascript">
diff --git a/src/usr/local/www/widgets/widgets/interface_statistics.widget.php b/src/usr/local/www/widgets/widgets/interface_statistics.widget.php
index 5b0fe02..8de8595 100644
--- a/src/usr/local/www/widgets/widgets/interface_statistics.widget.php
+++ b/src/usr/local/www/widgets/widgets/interface_statistics.widget.php
@@ -70,13 +70,13 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
if ($_REQUEST && $_REQUEST['ajax']) {
$rows = array(
- 'inpkts' => 'Packets In',
- 'outpkts' => 'Packets Out',
- 'inbytes' => 'Bytes In',
- 'outbytes' => 'Bytes Out',
- 'inerrs' => 'Errors In',
- 'outerrs' => 'Errors Out',
- 'collisions' => 'Collisions',
+ 'inpkts' => gettext('Packets In'),
+ 'outpkts' => gettext('Packets Out'),
+ 'inbytes' => gettext('Bytes In'),
+ 'outbytes' => gettext('Bytes Out'),
+ 'inerrs' => gettext('Errors In'),
+ 'outerrs' => gettext('Errors Out'),
+ 'collisions' => gettext('Collisions'),
);
$ifdescrs = get_configured_interface_with_descr();
diff --git a/src/usr/local/www/widgets/widgets/interfaces.widget.php b/src/usr/local/www/widgets/widgets/interfaces.widget.php
index 4cc1de0..e200507 100644
--- a/src/usr/local/www/widgets/widgets/interfaces.widget.php
+++ b/src/usr/local/www/widgets/widgets/interfaces.widget.php
@@ -118,7 +118,12 @@ foreach ($ifdescrs as $ifdescr => $ifname):
<?php if (empty($ifinfo['ipaddr']) && empty($ifinfo['ipaddrv6'])): ?>
n/a
<?php else: ?>
- <?=htmlspecialchars($ifinfo['ipaddr'])?><br />
+ <?=htmlspecialchars($ifinfo['ipaddr'])?>
+<?php
+ if (($ifinfo['ipaddr'] != "") && ($ifinfo['ipaddrv6'] != "")) {
+ print('<br />');
+ }
+?>
<?=htmlspecialchars($ifinfo['ipaddrv6'])?>
<?php endif; ?>
</td>
diff --git a/src/usr/local/www/widgets/widgets/ipsec.widget.php b/src/usr/local/www/widgets/widgets/ipsec.widget.php
index 1b91001..aa64ff4 100644
--- a/src/usr/local/www/widgets/widgets/ipsec.widget.php
+++ b/src/usr/local/www/widgets/widgets/ipsec.widget.php
@@ -202,21 +202,23 @@ if ($_REQUEST && $_REQUEST['ajax']) {
if (isset($config['ipsec']['phase1'])) {
$tab_array = array();
- $tab_array[] = array("Overview", true, "ipsec-Overview");
- $tab_array[] = array("Tunnels", false, "ipsec-tunnel");
- $tab_array[] = array("Mobile", false, "ipsec-mobile");
+ $tab_array[] = array(gettext("Overview"), true, "ipsec-Overview");
+ $tab_array[] = array(gettext("Tunnels"), false, "ipsec-tunnel");
+ $tab_array[] = array(gettext("Mobile"), false, "ipsec-mobile");
display_widget_tabs($tab_array);
}
+$mobile = ipsec_dump_mobile();
+
if (isset($config['ipsec']['phase2'])): ?>
<div id="ipsec-Overview" style="display:block;" class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
- <th>Active Tunnels</th>
- <th>Inactive Tunnels</th>
- <th>Mobile Users</th>
+ <th><?=gettext("Active Tunnels")?></th>
+ <th><?=gettext("Inactive Tunnels")?></th>
+ <th><?=gettext("Mobile Users")?></th>
</tr>
</thead>
<tbody>
@@ -228,10 +230,10 @@ if (isset($config['ipsec']['phase2'])): ?>
<table class="table table-striped table-hover">
<thead>
<tr>
- <th>Source</th>
- <th>Destination</th>
- <th>Description</th>
- <th>Status</th>
+ <th><?=gettext("Source")?></th>
+ <th><?=gettext("Destination")?></th>
+ <th><?=gettext("Description")?></th>
+ <th><?=gettext("Status")?></th>
</tr>
</thead>
<tbody>
@@ -245,9 +247,9 @@ if (isset($config['ipsec']['phase2'])): ?>
<table class="table table-striped table-hover">
<thead>
<tr>
- <th>User</th>
- <th>IP</th>
- <th>Status</th>
+ <th><?=gettext("User")?></th>
+ <th><?=gettext("IP")?></th>
+ <th><?=gettext("Status")?></th>
</tr>
</thead>
<tbody>
@@ -258,8 +260,8 @@ if (isset($config['ipsec']['phase2'])): ?>
<?php endif;?>
<?php else: ?>
<div>
- <h5 style="padding-left:10px;">There are no configured IPsec Tunnels</h5>
- <p style="padding-left:10px;">You can configure your IPsec <a href="vpn_ipsec.php">here</a>.</p>
+ <h5 style="padding-left:10px;"><?=gettext("There are no configured IPsec Tunnels")?></h5>
+ <p style="padding-left:10px;"><?=gettext('You can configure your IPsec <a href="vpn_ipsec.php">here</a>.')?></p>
</div>
<?php endif;
diff --git a/src/usr/local/www/widgets/widgets/load_balancer_status.widget.php b/src/usr/local/www/widgets/widgets/load_balancer_status.widget.php
index 91983b9..adb0603 100644
--- a/src/usr/local/www/widgets/widgets/load_balancer_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/load_balancer_status.widget.php
@@ -90,9 +90,9 @@ if (!$nentries) {
<table class="table">
<thead>
<tr>
- <th>Server</th>
- <th>Pool</th>
- <th>Description</th>
+ <th><?=gettext('Server')?></th>
+ <th><?=gettext('Pool')?></th>
+ <th><?=gettext('Description')?></th>
</tr>
</thead>
<tbody>
@@ -102,15 +102,15 @@ if (!$nentries) {
switch (trim($rdr_a[$vsent['name']]['status'])) {
case 'active':
$bgcolor = "success";
- $rdr_a[$vsent['name']]['status'] = "Active";
+ $rdr_a[$vsent['name']]['status'] = gettext("Active");
break;
case 'down':
$bgcolor = "danger";
- $rdr_a[$vsent['name']]['status'] = "Down";
+ $rdr_a[$vsent['name']]['status'] = gettext("Down");
break;
default:
$bgcolor = "info";
- $rdr_a[$vsent['name']]['status'] = 'Unknown - relayd not running?';
+ $rdr_a[$vsent['name']]['status'] = gettext('Unknown - relayd not running?');
}
?>
<td>
diff --git a/src/usr/local/www/widgets/widgets/log.widget.php b/src/usr/local/www/widgets/widgets/log.widget.php
index 62e5104..3940431 100644
--- a/src/usr/local/www/widgets/widgets/log.widget.php
+++ b/src/usr/local/www/widgets/widgets/log.widget.php
@@ -63,8 +63,12 @@ require_once("functions.inc");
/* In an effort to reduce duplicate code, many shared functions have been moved here. */
require_once("filter_log.inc");
-if (is_numeric($_POST['filterlogentries'])) {
- $config['widgets']['filterlogentries'] = $_POST['filterlogentries'];
+if ($_POST) {
+ if (is_numeric($_POST['filterlogentries'])) {
+ $config['widgets']['filterlogentries'] = $_POST['filterlogentries'];
+ } else {
+ unset($config['widgets']['filterlogentries']);
+ }
$acts = array();
if ($_POST['actpass']) {
@@ -90,7 +94,13 @@ if (is_numeric($_POST['filterlogentries'])) {
unset($config['widgets']['filterlogentriesinterfaces']);
}
- write_config("Saved Filter Log Entries via Dashboard");
+ if (is_numeric($_POST['filterlogentriesinterval'])) {
+ $config['widgets']['filterlogentriesinterval'] = $_POST['filterlogentriesinterval'];
+ } else {
+ unset($config['widgets']['filterlogentriesinterval']);
+ }
+
+ write_config(gettext("Saved Filter Log Entries via Dashboard"));
Header("Location: /");
exit(0);
}
@@ -106,20 +116,11 @@ $filterfieldsarray = array(
"interface" => $nentriesinterfaces
);
-$filter_logfile = "{$g['varlog_path']}/filter.log";
+$nentriesinterval = isset($config['widgets']['filterlogentriesinterval']) ? $config['widgets']['filterlogentriesinterval'] : 60;
-/* AJAX related routines */
-if (isset($_POST['lastsawtime'])) {
- $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 20);
+$filter_logfile = "{$g['varlog_path']}/filter.log";
- foreach ($filterlog as $idx => $row) {
- if (strtotime($log_row['time']) <= $_POST['lastsawtime']) {
- unset($filterlog[$idx]);
- }
- }
-} else {
- $filterlog = conv_log_filter($filter_logfile, $nentries, 50, $filterfieldsarray);
-}
+$filterlog = conv_log_filter($filter_logfile, $nentries, 50, $filterfieldsarray);
?>
<script type="text/javascript">
//<![CDATA[
@@ -168,7 +169,7 @@ if (isset($_POST['lastsawtime'])) {
<tr>
<td><a href="#" onclick="javascript:getURL('status_logs_filter.php?getrulenum=<?php echo "{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"
role="button" data-toggle="popover" data-trigger="hover"
- data-title="Rule that triggered this action"
+ data-title="<?=gettext("Rule that triggered this action")?>"
data-content="<?=htmlspecialchars($rule)?>"> <i
class="fa fa-<?=$iconfn?>"></i>
</a></td>
@@ -178,12 +179,24 @@ if (isset($_POST['lastsawtime'])) {
title="<?=gettext("Reverse Resolve with DNS");?>"><?=$srcIP?></a>
</td>
<td><a href="diag_dns.php?host=<?=$filterent['dstip']?>"
- title="<?=gettext("Reverse Resolve with DNS");?>"><?=$dstIP?></a>:<?=htmlspecialchars($filterent['dstport'])?>
+ title="<?=gettext("Reverse Resolve with DNS");?>"><?=$dstIP?></a><?php
+ if ($filterent['dstport']) {
+ print ':' . htmlspecialchars($filterent['dstport']);
+ }
+ ?>
</td>
</tr>
<?php
endforeach;
?>
+<?php
+ if (count($filterlog) == 0) {
+ print '<tr class="text-nowrap"><td colspan=5 class="text-center">';
+ print gettext('No logs to display');
+ print '</td></tr>';
+ }
+?>
+
</tbody>
</table>
@@ -214,7 +227,7 @@ function logWidgetUpdateFromServer(){
}
events.push(function(){
- setInterval('logWidgetUpdateFromServer()', 60*1000);
+ setInterval('logWidgetUpdateFromServer()', <?=$nentriesinterval?>*1000);
});
//]]>
</script>
@@ -223,46 +236,65 @@ events.push(function(){
</div>
<div id="widget-<?=$widgetname?>_panel-footer" class="panel-footer collapse">
+<?php
+$pconfig['nentries'] = isset($config['widgets']['filterlogentries']) ? $config['widgets']['filterlogentries'] : '';
+$pconfig['nentriesinterval'] = isset($config['widgets']['filterlogentriesinterval']) ? $config['widgets']['filterlogentriesinterval'] : '';
+?>
<form action="/widgets/widgets/log.widget.php" method="post"
class="form-horizontal">
<div class="form-group">
- <label for="filterlogentries" class="col-sm-4 control-label">Number
- of entries</label>
+ <label for="filterlogentries" class="col-sm-4 control-label"><?=gettext('Number of entries')?></label>
<div class="col-sm-6">
- <input type="number" name="filterlogentries" id="filterlogentries" value="<?=$nentries?>"
+ <input type="number" name="filterlogentries" id="filterlogentries" value="<?=$pconfig['nentries']?>" placeholder="5"
min="1" max="20" class="form-control" />
</div>
</div>
<div class="form-group">
- <label class="col-sm-4 control-label">Filter actions</label>
+ <label class="col-sm-4 control-label"><?=gettext('Filter actions')?></label>
<div class="col-sm-6 checkbox">
<?php $include_acts = explode(" ", strtolower($nentriesacts)); ?>
<label><input name="actpass" type="checkbox" value="Pass"
- <?=(in_array('pass', $include_acts) ? 'checked':'')?> />Pass</label>
- <label><input name="actblock" type="checkbox" value="Block"
- <?=(in_array('block', $include_acts) ? 'checked':'')?> />Block</label>
- <label><input name="actreject" type="checkbox" value="Reject"
- <?=(in_array('reject', $include_acts) ? 'checked':'')?> />Reject</label>
+ <?=(in_array('pass', $include_acts) ? 'checked':'')?> />
+ <?=gettext('Pass')?>
+ </label>
+ <label><input name="actblock" type="checkbox" value="Block"
+ <?=(in_array('block', $include_acts) ? 'checked':'')?> />
+ <?=gettext('Block')?>
+ </label>
+ <label><input name="actreject" type="checkbox" value="Reject"
+ <?=(in_array('reject', $include_acts) ? 'checked':'')?> />
+ <?=gettext('Reject')?>
+ </label>
</div>
</div>
<div class="form-group">
- <label for="filterlogentriesinterfaces"
- class="col-sm-4 control-label">Filter interface</label>
+ <label for="filterlogentriesinterfaces" class="col-sm-4 control-label">
+ <?=gettext('Filter interface')?>
+ </label>
<div class="col-sm-6 checkbox">
<select name="filterlogentriesinterfaces" id="filterlogentriesinterfaces" class="form-control">
<?php foreach (array("All" => "ALL") + get_configured_interface_with_descr() as $iface => $ifacename):?>
<option value="<?=$iface?>"
<?=($nentriesinterfaces==$iface?'selected':'')?>><?=htmlspecialchars($ifacename)?></option>
<?php endforeach;?>
- </select>
+ </select>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label for="filterlogentriesinterval" class="col-sm-4 control-label"><?=gettext('Update interval')?></label>
+ <div class="col-sm-4">
+ <input type="number" name="filterlogentriesinterval" id="filterlogentriesinterval" value="<?=$pconfig['nentriesinterval']?>" placeholder="60"
+ min="1" class="form-control" />
</div>
+ <?=gettext('Seconds');?>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-6">
- <button type="submit" class="btn btn-default">Save</button>
+ <button type="submit" class="btn btn-default"><?=gettext('Save')?></button>
</div>
</div>
</form>
diff --git a/src/usr/local/www/widgets/widgets/ntp_status.widget.php b/src/usr/local/www/widgets/widgets/ntp_status.widget.php
index a98d84a..98af1a1 100644
--- a/src/usr/local/www/widgets/widgets/ntp_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/ntp_status.widget.php
@@ -83,22 +83,23 @@ if ($_REQUEST['updateme']) {
exec("/usr/local/sbin/ntpq -pn $inet_version | /usr/bin/tail +3", $ntpq_output);
$ntpq_counter = 0;
+ $stratum_text = gettext("stratum");
foreach ($ntpq_output as $line) {
if (substr($line, 0, 1) == "*") {
//Active NTP Peer
$line = substr($line, 1);
$peerinfo = preg_split("/[\s\t]+/", $line);
if ($peerinfo[2] == "1") {
- $syncsource = $peerinfo[0] . " (stratum " . $peerinfo[2] . ", " . $peerinfo[1] . ")";
+ $syncsource = $peerinfo[0] . " (" . $stratum_text . " " . $peerinfo[2] . ", " . $peerinfo[1] . ")";
} else {
- $syncsource = $peerinfo[0] . " (stratum " . $peerinfo[2] . ")";
+ $syncsource = $peerinfo[0] . " (" . $stratum_text . " " . $peerinfo[2] . ")";
}
$ntpq_counter++;
} elseif (substr($line, 0, 1) == "o") {
//Local PPS Peer
$line = substr($line, 1);
$peerinfo = preg_split("/[\s\t]+/", $line);
- $syncsource = $peerinfo[1] . " (stratum " . $peerinfo[2] . ", PPS)";
+ $syncsource = $peerinfo[1] . " (" . $stratum_text . " " . $peerinfo[2] . ", PPS)";
$ntpq_counter++;
}
}
@@ -171,7 +172,7 @@ if ($_REQUEST['updateme']) {
<table id="ntp_status_widget" class="table table-striped table-hover">
<tr>
- <th>Server Time</th>
+ <th><?=gettext('Server Time')?></th>
<td id="ClockTime"> <!-- ntpStatusClock -->
<script type="text/javascript">
//<![CDATA[
@@ -183,20 +184,20 @@ if ($_REQUEST['updateme']) {
</td>
</tr>
<tr>
- <th>Sync Source</th>
+ <th><?=gettext('Sync Source')?></th>
<td>
<?php if ($ntpq_counter == 0): ?>
- <i>No active peers available</i>
+ <i><?=gettext('No active peers available')?></i>
<?php else: ?>
- <?php echo $syncsource; ?>
+ <?=$syncsource;?>
<?php endif; ?>
</td>
</tr>
<?php if (($gps_ok) && ($gps_lat) && ($gps_lon)): ?>
<tr>
- <th>Clock location</th>
+ <th><?=gettext('Clock location')?></th>
<td>
- <a target="_gmaps" href="http://maps.google.com/?q=<?php echo $gps_lat; ?>,<?php echo $gps_lon; ?>">
+ <a target="_gmaps" href="http://maps.google.com/?q=<?=$gps_lat;?>,<?=$gps_lon;?>">
<?php
echo sprintf("%.5f", $gps_lat) . " " . $gps_la . ", " . sprintf("%.5f", $gps_lon) . " " . $gps_lo; ?>
</a>
@@ -205,12 +206,12 @@ if ($_REQUEST['updateme']) {
</tr>
<?php if (isset($gps_sat) || isset($gps_satview)): ?>
<tr>
- <th>Satellites</th>
+ <th><?=gettext('Satellites')?></th>
<td>
<?php
- if (isset($gps_satview)) {echo 'in view ' . intval($gps_satview);}
+ if (isset($gps_satview)) {echo gettext('in view') . ' ' . intval($gps_satview);}
if (isset($gps_sat) && isset($gps_satview)) {echo ', ';}
- if (isset($gps_sat)) {echo 'in use ' . $gps_sat;}
+ if (isset($gps_sat)) {echo gettext('in use') . ' ' . $gps_sat;}
?>
</td>
</tr>
@@ -488,7 +489,7 @@ clockUpdate();
<tbody>
<tr>
<td>
- Updating...
+ <?=gettext('Updating...')?>
</td>
</tr>
</tbody>
@@ -500,7 +501,7 @@ clockUpdate();
scroll(0,0);
var url = "/widgets/widgets/ntp_status.widget.php";
var pars = 'updateme=yes';
- jQuery.ajax(
+ $.ajax(
url,
{
type: 'get',
@@ -514,7 +515,7 @@ clockUpdate();
function ntpstatuscallback(transport) {
// The server returns formatted html code
var responseStringNtp = transport.responseText
- jQuery('#ntpstatus').prop('innerHTML',responseStringNtp);
+ $('#ntpstatus').prop('innerHTML',responseStringNtp);
}
// Do the first status check 1 second after the dashboard opens
setTimeout('ntp_getstatus()', 1000);
diff --git a/src/usr/local/www/widgets/widgets/openvpn.widget.php b/src/usr/local/www/widgets/widgets/openvpn.widget.php
index 2d34401..f23e95c 100644
--- a/src/usr/local/www/widgets/widgets/openvpn.widget.php
+++ b/src/usr/local/www/widgets/widgets/openvpn.widget.php
@@ -83,7 +83,7 @@ $clients = openvpn_get_active_clients();
//<![CDATA[
function killClient(mport, remipp) {
- jQuery.ajax(
+ $.ajax(
"widgets/widgets/openvpn.widget.php" +
"?action=kill&port=" + mport + "&remipp=" + remipp,
{ type: "get", complete: killComplete }
@@ -97,8 +97,8 @@ $clients = openvpn_get_active_clients();
return;
}
- jQuery('tr[name="r:' + values[1] + ":" + values[2] + '"]').each(
- function(index,row) { jQuery(row).fadeOut(1000); }
+ $('tr[name="r:' + values[1] + ":" + values[2] + '"]').each(
+ function(index,row) { $(row).fadeOut(1000); }
);
}
//]]>
@@ -112,8 +112,8 @@ $clients = openvpn_get_active_clients();
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
<tr>
- <th>Name/Time</th>
- <th>Real/Virtual IP</th>
+ <th><?=gettext('Name/Time')?></th>
+ <th><?=gettext('Real/Virtual IP')?></th>
<th></th>
</tr>
</thead>
@@ -133,7 +133,7 @@ $clients = openvpn_get_active_clients();
<td>
<i class="fa fa-times-circle" onclick="killClient('<?=$server['mgmt']; ?>', '<?=$conn['remote_host']; ?>');" style="cursor:pointer;"
name="<?php echo "i:{$server['mgmt']}:{$conn['remote_host']}"; ?>"
- title='Kill client connection from <?php echo $conn['remote_host']; ?>'>
+ title=<?=sprintf(gettext('Kill client connection from %s'), $conn['remote_host']);?>'>
</i>
</td>
</tr>
@@ -160,8 +160,8 @@ $clients = openvpn_get_active_clients();
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
<tr>
- <th>Name/Time</th>
- <th>Remote/Virtual IP</th>
+ <th><?=gettext('Name/Time')?></th>
+ <th><?=gettext('Remote/Virtual IP')?></th>
<th></th>
</tr>
</thead>
@@ -210,8 +210,8 @@ $clients = openvpn_get_active_clients();
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
<thead>
<tr>
- <th>Name/Time</th>
- <th>Remote/Virtual IP</th>
+ <th><?=gettext('Name/Time')?></th>
+ <th><?=gettext('Remote/Virtual IP')?></th>
<th></th>
</tr>
</thead>
@@ -256,11 +256,11 @@ $clients = openvpn_get_active_clients();
}
if ($DisplayNote) {
- echo "<br /><b>NOTE:</b> You need to bind each OpenVPN client to enable its management daemon: use 'Local port' setting in the OpenVPN client screen";
+ echo "<br /><b>". gettext("NOTE") . ":</b> ". gettext("You need to bind each OpenVPN client to enable its management daemon: use 'Local port' setting in the OpenVPN client screen");
}
if ((empty($clients)) && (empty($servers)) && (empty($sk_servers))) {
- echo "No OpenVPN instances defined";
+ echo gettext("No OpenVPN instances defined");
}
?>
</div>
diff --git a/src/usr/local/www/widgets/widgets/picture.widget.php b/src/usr/local/www/widgets/widgets/picture.widget.php
index 7d31199..f40e3df 100644
--- a/src/usr/local/www/widgets/widgets/picture.widget.php
+++ b/src/usr/local/www/widgets/widgets/picture.widget.php
@@ -78,7 +78,7 @@ if ($_POST) {
</div><div id="widget-<?=$widgetname?>_panel-footer" class="panel-footer collapse">
<form action="/widgets/widgets/picture.widget.php" method="post" enctype="multipart/form-data" class="form-inline">
- <label for="pictfile">New picture: </label>
+ <label for="pictfile"><?=gettext('New picture:')?> </label>
<input id="pictfile" name="pictfile" type="file" class="form-control" />
- <button type="submit" class="btn btn-default">Upload</button>
+ <button type="submit" class="btn btn-default"><?=gettext('Upload')?></button>
</form>
diff --git a/src/usr/local/www/widgets/widgets/rss.widget.php b/src/usr/local/www/widgets/widgets/rss.widget.php
index 358717e..411d0e2 100644
--- a/src/usr/local/www/widgets/widgets/rss.widget.php
+++ b/src/usr/local/www/widgets/widgets/rss.widget.php
@@ -64,7 +64,7 @@ if ($_POST['rssfeed']) {
$config['widgets']['rssmaxitems'] = str_replace("\n", ",", htmlspecialchars($_POST['rssmaxitems'], ENT_QUOTES | ENT_HTML401));
$config['widgets']['rsswidgetheight'] = htmlspecialchars($_POST['rsswidgetheight'], ENT_QUOTES | ENT_HTML401);
$config['widgets']['rsswidgettextlength'] = htmlspecialchars($_POST['rsswidgettextlength'], ENT_QUOTES | ENT_HTML401);
- write_config("Saved RSS Widget feed via Dashboard");
+ write_config(gettext("Saved RSS Widget feed via Dashboard"));
header("Location: /");
}
@@ -158,28 +158,28 @@ if ($config['widgets']['rssfeed']) {
<form action="/widgets/widgets/rss.widget.php" method="post" class="form-horizontal">
<div class="form-group">
- <label for="rssfeed" class="col-sm-3 control-label">Feeds</label>
+ <label for="rssfeed" class="col-sm-3 control-label"><?=gettext('Feeds')?></label>
<div class="col-sm-6">
<textarea id="rssfeed" name="rssfeed" class="form-control"><?=$textarea_txt;?></textarea>
</div>
</div>
<div class="form-group">
- <label for="rssmaxitems" class="col-sm-3 control-label"># Stories</label>
+ <label for="rssmaxitems" class="col-sm-3 control-label"><?=gettext('# Stories')?></label>
<div class="col-sm-6">
<input type="number" id="rssmaxitems" name="rssmaxitems" value="<?=$max_items?>" min="1" max="100" class="form-control" />
</div>
</div>
<div class="form-group">
- <label for="rsswidgetheight" class="col-sm-3 control-label">Widget height</label>
+ <label for="rsswidgetheight" class="col-sm-3 control-label"><?=gettext('Widget height')?></label>
<div class="col-sm-6">
<input type="number" id="rsswidgetheight" name="rsswidgetheight" value="<?=$rsswidgetheight?>" min="100" max="2500" step="100" class="form-control" />
</div>
</div>
<div class="form-group">
- <label for="rsswidgettextlength" class="col-sm-3 control-label">Content limit</label>
+ <label for="rsswidgettextlength" class="col-sm-3 control-label"><?=gettext('Content limit')?></label>
<div class="col-sm-6">
<input type="number" id="rsswidgettextlength" name="rsswidgettextlength" value="<?=$rsswidgettextlength?>" min="100" max="5000" step="10" class="form-control" />
</div>
@@ -187,7 +187,7 @@ if ($config['widgets']['rssfeed']) {
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6">
- <button type="submit" class="btn btn-default">Save</button>
+ <button type="submit" class="btn btn-default"><?=gettext('Save')?></button>
</div>
</div>
</form>
diff --git a/src/usr/local/www/widgets/widgets/services_status.widget.php b/src/usr/local/www/widgets/widgets/services_status.widget.php
index 8899886..a050a3e 100644
--- a/src/usr/local/www/widgets/widgets/services_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/services_status.widget.php
@@ -78,7 +78,7 @@ if ($_POST) {
$config['widgets']['servicestatusfilter'] = "";
}
- write_config("Saved Service Status Filter via Dashboard");
+ write_config(gettext("Saved Service Status Filter via Dashboard"));
header("Location: /index.php");
}
@@ -87,9 +87,9 @@ if ($_POST) {
<thead>
<tr>
<th></th>
- <th>Service</th>
- <th>Description</th>
- <th>Action</th>
+ <th><?=gettext('Service')?></th>
+ <th><?=gettext('Description')?></th>
+ <th><?=gettext('Action')?></th>
</tr>
</thead>
<tbody>
@@ -116,7 +116,7 @@ if (count($services) > 0) {
<?php
}
} else {
- echo "<tr><td colspan=\"3\" align=\"center\">" . gettext("No services found") . " . </td></tr>\n";
+ echo "<tr><td colspan=\"3\" class=\"text-center\">" . gettext("No services found") . ". </td></tr>\n";
}
?>
</tbody>
@@ -127,20 +127,26 @@ if (count($services) > 0) {
<form action="/widgets/widgets/services_status.widget.php" method="post" class="form-horizontal">
<div class="form-group">
- <label for="inputPassword3" class="col-sm-3 control-label">Hidden services</label>
+ <label for="inputPassword3" class="col-sm-3 control-label"><?=gettext('Hidden services')?></label>
<div class="col-sm-6">
<select multiple id="servicestatusfilter" name="servicestatusfilter[]" class="form-control">
- <?php foreach ($services as $service): ?>
+ <?php
+ foreach ($services as $service):
+ if (!empty(trim($service['name'])) || is_numeric($service['name'])) {
+ ?>
<option <?=(in_array($service['name'], $skipservices)?'selected':'')?>><?=$service['name']?></option>
- <?php endforeach; ?>
+ <?php
+ }
+ endforeach;
+ ?>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6">
- <button type="submit" class="btn btn-primary">Save</button>
- <button id="clearall" type="button" class="btn btn-default">Clear</button>
+ <button type="submit" class="btn btn-primary"><?=gettext('Save')?></button>
+ <button id="clearall" type="button" class="btn btn-default"><?=gettext('Clear')?></button>
</div>
</div>
</form>
diff --git a/src/usr/local/www/widgets/widgets/smart_status.widget.php b/src/usr/local/www/widgets/widgets/smart_status.widget.php
index 56e3d2d..dce74a1 100644
--- a/src/usr/local/www/widgets/widgets/smart_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/smart_status.widget.php
@@ -90,7 +90,7 @@ if (count($devs) > 0) {
$icon = "fa-check";
break;
case "":
- $dev_state = "Unknown";
+ $dev_state = gettext("Unknown");
$color = "text-info";
$icon = "fa-times-circle";
break;
diff --git a/src/usr/local/www/widgets/widgets/system_information.widget.php b/src/usr/local/www/widgets/widgets/system_information.widget.php
index c5da475..d624e42 100644
--- a/src/usr/local/www/widgets/widgets/system_information.widget.php
+++ b/src/usr/local/www/widgets/widgets/system_information.widget.php
@@ -119,13 +119,13 @@ $filesystems = get_mounted_filesystems();
<strong><?=$g['product_version']?></strong>
(<?php echo php_uname("m"); ?>)
<br />
- built on <?php readfile("/etc/version.buildtime"); ?>
+ <?=gettext('built on')?> <?php readfile("/etc/version.buildtime"); ?>
<?php if (!$g['hideuname']): ?>
<br />
<span title="<?php echo php_uname("a"); ?>"><?php echo php_uname("s") . " " . php_uname("r"); ?></span>
<?php endif; ?>
- <br/><br/>
<?php if (!isset($config['system']['firmware']['disablecheck'])): ?>
+ <br /><br />
<div id='updatestatus'><?php echo gettext("Obtaining update status "); ?><i class="fa fa-cog fa-spin"></i></div>
<?php endif; ?>
</td>
@@ -142,7 +142,7 @@ $filesystems = get_mounted_filesystems();
</tr>
<?php endif; ?>
<?php if ($g['platform'] == "nanobsd"): ?>
- <?
+ <?php
global $SLICE, $OLDSLICE, $TOFLASH, $COMPLETE_PATH, $COMPLETE_BOOT_PATH;
global $GLABEL_SLICE, $UFS_ID, $OLD_UFS_ID, $BOOTFLASH;
global $BOOT_DEVICE, $REAL_BOOT_DEVICE, $BOOT_DRIVE, $ACTIVE_SLICE;
@@ -152,9 +152,9 @@ $filesystems = get_mounted_filesystems();
<tr>
<th><?=gettext("NanoBSD Boot Slice");?></th>
<td>
- <?=htmlspecialchars(nanobsd_friendly_slice_name($BOOT_DEVICE));?> / <?=htmlspecialchars($BOOTFLASH);?><?php echo $rw; ?>
+ <?=htmlspecialchars(nanobsd_friendly_slice_name($BOOT_DEVICE));?> / <?=htmlspecialchars($BOOTFLASH);?><?=$rw;?>
<?php if ($BOOTFLASH != $ACTIVE_SLICE): ?>
- <br /><br />Next Boot:<br />
+ <br /><br /><?=gettext('Next Boot')?>:<br />
<?=htmlspecialchars(nanobsd_friendly_slice_name($GLABEL_SLICE));?> / <?=htmlspecialchars($ACTIVE_SLICE);?>
<?php endif; ?>
</td>
@@ -168,7 +168,7 @@ $filesystems = get_mounted_filesystems();
$cpucount = get_cpu_count();
if ($cpucount > 1): ?>
<div id="cpucount">
- <?= htmlspecialchars($cpucount) ?> CPUs: <?= htmlspecialchars(get_cpu_count(true)); ?>
+ <?= htmlspecialchars($cpucount) ?> <?=gettext('CPUs')?>: <?= htmlspecialchars(get_cpu_count(true)); ?>
</div>
<?php endif; ?>
</td>
@@ -190,7 +190,7 @@ $filesystems = get_mounted_filesystems();
<tr>
<th><?=gettext("DNS server(s)");?></th>
<td>
- <ul>
+ <ul style="margin-bottom:0px">
<?php
$dns_servers = get_dns_servers();
foreach($dns_servers as $dns) {
@@ -247,7 +247,7 @@ $filesystems = get_mounted_filesystems();
<tr>
<th><?=gettext("Load average");?></th>
<td>
- <div id="load_average" title="Last 1, 5 and 15 minutes"><?= get_load_average(); ?></div>
+ <div id="load_average" title="<?=gettext('Last 1, 5 and 15 minutes')?>"><?= get_load_average(); ?></div>
</td>
</tr>
<tr>
@@ -257,7 +257,7 @@ $filesystems = get_mounted_filesystems();
<div id="cpuPB" class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
</div>
</div>
- <span id="cpumeter">(Updating in 10 seconds)</span>
+ <span id="cpumeter"><?=gettext('(Updating in 10 seconds)')?></span>
</td>
</tr>
<tr>
@@ -292,7 +292,7 @@ $filesystems = get_mounted_filesystems();
<?php foreach ($filesystems as $fs): ?>
<tr>
<th><?=$fs['mountpoint']?></th>
- <td><?=$fs['type'] . ("md" == substr(basename($fs['device']), 0, 2) ? " in RAM" : "")?></td>
+ <td><?=$fs['type'] . ("md" == substr(basename($fs['device']), 0, 2) ? " " . gettext("in RAM") : "")?></td>
<td><?=$fs['total_size']?></td>
<td>
<span><?=$fs['percent_used']?>%</span>
@@ -326,7 +326,7 @@ function systemStatusGetUpdateStatus() {
function updateMeters() {
url = '/getstats.php';
- jQuery.ajax(url, {
+ $.ajax(url, {
type: 'get',
success: function(data) {
response = data || "";
@@ -352,7 +352,7 @@ var Seconds = 11;
var update_interval = (Math.abs(Math.ceil(Seconds))-1)*1000 + 990;
function setProgress(barName, percent) {
- jQuery('#' + barName).css('width', percent + '%').attr('aria-valuenow', percent);
+ $('#' + barName).css('width', percent + '%').attr('aria-valuenow', percent);
}
function setTimer() {
@@ -361,7 +361,7 @@ function setTimer() {
function stats(x) {
var values = x.split("|");
- if (jQuery.each(values,function(key,value){
+ if ($.each(values,function(key,value){
if (value == 'undefined' || value == null)
return true;
else
@@ -385,35 +385,35 @@ function stats(x) {
}
function updateMemory(x) {
- if (jQuery('#memusagemeter')) {
- jQuery("#memusagemeter").html(x);
+ if ($('#memusagemeter')) {
+ $("#memusagemeter").html(x);
}
- if (jQuery('#memUsagePB')) {
+ if ($('#memUsagePB')) {
setProgress('memUsagePB', parseInt(x));
}
}
function updateMbuf(x) {
- if (jQuery('#mbuf')) {
- jQuery("#mbuf").html(x);
+ if ($('#mbuf')) {
+ $("#mbuf").html(x);
}
}
function updateMbufMeter(x) {
- if (jQuery('#mbufusagemeter')) {
- jQuery("#mbufusagemeter").html(x + '%');
+ if ($('#mbufusagemeter')) {
+ $("#mbufusagemeter").html(x + '%');
}
- if (jQuery('#mbufPB')) {
+ if ($('#mbufPB')) {
setProgress('mbufPB', parseInt(x));
}
}
function updateCPU(x) {
- if (jQuery('#cpumeter')) {
- jQuery("#cpumeter").html(x + '%');
+ if ($('#cpumeter')) {
+ $("#cpumeter").html(x + '%');
}
- if (jQuery('#cpuPB')) {
+ if ($('#cpuPB')) {
setProgress('cpuPB', parseInt(x));
}
@@ -424,37 +424,37 @@ function updateCPU(x) {
}
function updateTemp(x) {
- if (jQuery("#tempmeter")) {
- jQuery("#tempmeter").html(x + '\u00B0' + 'C');
+ if ($("#tempmeter")) {
+ $("#tempmeter").html(x + '\u00B0' + 'C');
}
- if (jQuery('#tempPB')) {
- jQuery("#tempPB").progressbar( { value: parseInt(x) } );
+ if ($('#tempPB')) {
+ $("#tempPB").progressbar( { value: parseInt(x) } );
}
}
function updateDateTime(x) {
- if (jQuery('#datetime')) {
- jQuery("#datetime").html(x);
+ if ($('#datetime')) {
+ $("#datetime").html(x);
}
}
function updateUptime(x) {
- if (jQuery('#uptime')) {
- jQuery("#uptime").html(x);
+ if ($('#uptime')) {
+ $("#uptime").html(x);
}
}
function updateState(x) {
- if (jQuery('#pfstate')) {
- jQuery("#pfstate").html('(' + x + ')');
+ if ($('#pfstate')) {
+ $("#pfstate").html('(' + x + ')');
}
}
function updateStateMeter(x) {
- if (jQuery('#pfstateusagemeter')) {
- jQuery("#pfstateusagemeter").html(x + '%');
+ if ($('#pfstateusagemeter')) {
+ $("#pfstateusagemeter").html(x + '%');
}
- if (jQuery('#statePB')) {
+ if ($('#statePB')) {
setProgress('statePB', parseInt(x));
}
}
@@ -464,10 +464,10 @@ function updateGatewayStats(x) {
gateways_split = x.split(",");
for (var y=0; y<gateways_split.length; y++) {
gateways_field_split = gateways_split[y].split("^");
- if (jQuery('#gateway' + (y + 1))) {
- jQuery('#gateway' + (y + 1)).html(gateways_field_split[0]);
+ if ($('#gateway' + (y + 1))) {
+ $('#gateway' + (y + 1)).html(gateways_field_split[0]);
if (gateways_field_split[1]) {
- jQuery('#gateway' + (y + 1)).css('background-color',gateways_field_split[1]);
+ $('#gateway' + (y + 1)).css('background-color',gateways_field_split[1]);
}
}
}
@@ -475,14 +475,14 @@ function updateGatewayStats(x) {
}
function updateCpuFreq(x) {
- if (jQuery('#cpufreq')) {
- jQuery("#cpufreq").html(x);
+ if ($('#cpufreq')) {
+ $("#cpufreq").html(x);
}
}
function updateLoadAverage(x) {
- if (jQuery('#load_average')) {
- jQuery("#load_average").html(x);
+ if ($('#load_average')) {
+ $("#load_average").html(x);
}
}
@@ -491,8 +491,8 @@ function updateInterfaceStats(x) {
statistics_split = x.split(",");
var counter = 1;
for (var y=0; y<statistics_split.length-1; y++) {
- if (jQuery('#stat' + counter)) {
- jQuery('#stat' + counter).html(statistics_split[y]);
+ if ($('#stat' + counter)) {
+ $('#stat' + counter).html(statistics_split[y]);
counter++;
}
}
@@ -511,25 +511,25 @@ function updateInterfaces(x) {
}
switch(details[1]) {
case "up":
- jQuery('#' + details[0] + '-up').css("display","inline");
- jQuery('#' + details[0] + '-down').css("display","none");
- jQuery('#' + details[0] + '-block').css("display","none");
- jQuery('#' + details[0] + '-ip').html(ipv4_details);
- jQuery('#' + details[0] + '-ipv6').html(details[3]);
- jQuery('#' + details[0] + '-media').html(details[4]);
+ $('#' + details[0] + '-up').css("display","inline");
+ $('#' + details[0] + '-down').css("display","none");
+ $('#' + details[0] + '-block').css("display","none");
+ $('#' + details[0] + '-ip').html(ipv4_details);
+ $('#' + details[0] + '-ipv6').html(details[3]);
+ $('#' + details[0] + '-media').html(details[4]);
break;
case "down":
- jQuery('#' + details[0] + '-down').css("display","inline");
- jQuery('#' + details[0] + '-up').css("display","none");
- jQuery('#' + details[0] + '-block').css("display","none");
- jQuery('#' + details[0] + '-ip').html(ipv4_details);
- jQuery('#' + details[0] + '-ipv6').html(details[3]);
- jQuery('#' + details[0] + '-media').html(details[4]);
+ $('#' + details[0] + '-down').css("display","inline");
+ $('#' + details[0] + '-up').css("display","none");
+ $('#' + details[0] + '-block').css("display","none");
+ $('#' + details[0] + '-ip').html(ipv4_details);
+ $('#' + details[0] + '-ipv6').html(details[3]);
+ $('#' + details[0] + '-media').html(details[4]);
break;
case "block":
- jQuery('#' + details[0] + '-block').css("display","inline");
- jQuery('#' + details[0] + '-down').css("display","none");
- jQuery('#' + details[0] + '-up').css("display","none");
+ $('#' + details[0] + '-block').css("display","inline");
+ $('#' + details[0] + '-down').css("display","none");
+ $('#' + details[0] + '-up').css("display","none");
break;
}
});
@@ -537,7 +537,7 @@ function updateInterfaces(x) {
}
function widgetActive(x) {
- var widget = jQuery('#' + x + '-container');
+ var widget = $('#' + x + '-container');
if ((widget != null) && (widget.css('display') != null) && (widget.css('display') != "none")) {
return true;
} else {
diff --git a/src/usr/local/www/widgets/widgets/thermal_sensors.widget.php b/src/usr/local/www/widgets/widgets/thermal_sensors.widget.php
index dabf983..f99e605 100644
--- a/src/usr/local/www/widgets/widgets/thermal_sensors.widget.php
+++ b/src/usr/local/www/widgets/widgets/thermal_sensors.widget.php
@@ -89,7 +89,7 @@ if ($_POST) {
saveGraphDisplaySettings($config, $_POST, "thermal_sensors_widget_pulsate_critical");
//write settings to config file
- write_config("Saved thermal_sensors_widget settings via Dashboard.");
+ write_config(gettext("Saved thermal_sensors_widget settings via Dashboard."));
header("Location: ../../index.php");
}
@@ -185,7 +185,7 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) {
</script>
<div style="padding: 5px">
<div id="thermalSensorsContainer" class="listr">
- (Updating...)<br /><br />
+ <?=gettext('(Updating...)')?><br /><br />
</div>
</div>
</div>
@@ -196,15 +196,15 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) {
<table>
<tr>
<td class="text-left" colspan="2">
- <strong>Thresholds in &deg;C (1 to 100):</strong>
+ <strong><?=gettext('Thresholds in')?> &deg;C <?=gettext('(1 to 100):')?></strong>
</td>
<td class="text-right" colspan="1">
- <strong>Display settings:</strong>
+ <strong><?=gettext('Display settings:')?></strong>
</td>
</tr>
<tr>
<td class="text-right">
- Zone Warning:
+ <?=gettext('Zone Warning:')?>
</td>
<td>
<input type="text" maxlength="3" size="3" class="formfld unknown"
@@ -213,7 +213,7 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) {
value="<?= $thermal_sensors_widget_zoneWarningTempThreshold; ?>" />
</td>
<td class="text-right">
- <label for="thermal_sensors_widget_show_raw_output">Show raw output (no graph): </label>
+ <label for="thermal_sensors_widget_show_raw_output"><?=gettext('Show raw output (no graph):')?> </label>
<input type="checkbox"
id="thermal_sensors_widget_show_raw_output"
name="thermal_sensors_widget_show_raw_output"
@@ -222,7 +222,7 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) {
</tr>
<tr>
<td class="text-right">
- Zone Critical:
+ <?=gettext('Zone Critical:')?>
</td>
<td>
<input type="text" maxlength="3" size="3" class="formfld unknown"
@@ -231,7 +231,7 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) {
value="<?= $thermal_sensors_widget_zoneCriticalTempThreshold; ?>" />
</td>
<td class="text-right">
- <label for="thermal_sensors_widget_show_full_sensor_name">Show full sensor name: </label>
+ <label for="thermal_sensors_widget_show_full_sensor_name"><?=gettext('Show full sensor name:')?> </label>
<input type="checkbox"
id="thermal_sensors_widget_show_full_sensor_name"
name="thermal_sensors_widget_show_full_sensor_name"
@@ -240,7 +240,7 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) {
</tr>
<tr>
<td class="text-right">
- Core Warning:
+ <?=gettext('Core Warning:')?>
</td>
<td>
<input type="text" maxlength="3" size="3" class="formfld unknown"
@@ -254,7 +254,7 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) {
</tr>
<tr>
<td class="text-right">
- Core Critical:
+ <?=gettext('Core Critical:')?>
</td>
<td>
<input type="text" maxlength="3" size="3" class="formfld unknown"
@@ -273,8 +273,8 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) {
</tr>
<tr>
<td class="text-left" colspan="3">
- <span>* You can configure a proper Thermal Sensor / Module under <br />
- &nbsp;&nbsp;&nbsp;<a href="system_advanced_misc.php">System &gt; Advanced &gt; Miscellaneous : Thermal Sensors section</a>.</span>
+ <span><?=gettext('* You can configure a proper Thermal Sensor / Module under')?> <br />
+ &nbsp;&nbsp;&nbsp;<a href="system_advanced_misc.php"><?=gettext('System')?> &gt; <?=gettext('Advanced')?> &gt; <?=gettext('Miscellaneous')?> : <?=gettext('Thermal Sensors')?> <?=gettext('section')?></a>.</span>
</td>
</tr>
</table>
diff --git a/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php b/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php
index 4d421ea..39cb3f3 100644
--- a/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php
+++ b/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php
@@ -86,7 +86,7 @@ if (ipsec_enabled()) {
}
if ($_POST) {
- if (isset($_POST["refreshinterval"]) && is_numeric($_POST["refreshinterval"])) {
+ if (isset($_POST["refreshinterval"]) && is_numericint($_POST["refreshinterval"])) {
$a_config["refreshinterval"] = $_POST["refreshinterval"];
}
@@ -102,7 +102,7 @@ if ($_POST) {
}
}
- write_config("Updated traffic graph settings via dashboard.");
+ write_config(gettext("Updated traffic graph settings via dashboard."));
header("Location: /");
exit(0);
}
@@ -117,7 +117,7 @@ if ($first_time) {
$shown[$keys[0]] = true;
}
-if (isset($a_config["refreshinterval"])) {
+if (isset($a_config["refreshinterval"]) && is_numericint($a_config["refreshinterval"])) {
$refreshinterval = $a_config["refreshinterval"];
} else {
$refreshinterval = 10;
@@ -162,32 +162,32 @@ foreach ($ifdescrs as $ifname => $ifdescr):
<form action="/widgets/widgets/traffic_graphs.widget.php" method="post" class="form-horizontal">
<div class="form-group">
- <label for="scale_type_up" class="col-sm-3 control-label">Show graphs</label>
+ <label for="scale_type_up" class="col-sm-3 control-label"><?=gettext('Show graphs')?></label>
<div class="col-sm-6 checkbox">
<?php foreach ($ifdescrs as $ifname => $ifdescr): ?>
<label>
<input type="checkbox" name="shown[<?= $ifname?>]" value="<?=$ifname?>" <?= ($shown[$ifname]) ? "checked":""?> />
- <?=$ifname?>
+ <?=$ifdescr?>
</label>
<?php endforeach; ?>
</div>
</div>
<div class="form-group">
- <label for="scale_type_up" class="col-sm-3 control-label">Default Autoscale</label>
+ <label for="scale_type_up" class="col-sm-3 control-label"><?=gettext('Default Autoscale')?></label>
<div class="col-sm-6 checkbox">
<label>
- <input name="scale_type" type="radio" id="scale_type_up" value="up" <?=($config["widgets"]["trafficgraphs"]["scale_type"]=="follow" ? '' : 'checked')?> />
- up
+ <input name="scale_type" type="radio" id="scale_type_up" value="up" <?=($config["widgets"]["trafficgraphs"]["scale_type"]=="up" ? '' : 'checked')?> />
+ <?=gettext('Up')?>
</label>
<label>
- <input name="scale_type" type="radio" id="scale_type_follow" value="up" <?=($config["widgets"]["trafficgraphs"]["scale_type"]=="follow" ? 'checked' : '')?> />
- follow
+ <input name="scale_type" type="radio" id="scale_type_follow" value="follow" <?=($config["widgets"]["trafficgraphs"]["scale_type"]=="follow" ? 'checked' : '')?> />
+ <?=gettext('Follow')?>
</label>
</div>
</div>
<div class="form-group">
- <label for="refreshinterval" class="col-sm-3 control-label">Refresh Interval</label>
+ <label for="refreshinterval" class="col-sm-3 control-label"><?=gettext('Refresh Interval')?></label>
<div class="col-sm-6">
<input type="number" id="refreshinterval" name="refreshinterval" value="<?=$refreshinterval?>" min="1" max="30" class="form-control" />
</div>
@@ -195,7 +195,7 @@ foreach ($ifdescrs as $ifname => $ifdescr):
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6">
- <button type="submit" class="btn btn-default">Save</button>
+ <button type="submit" class="btn btn-default"><?=gettext('Save')?></button>
</div>
</div>
</form>
diff --git a/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php b/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
index 90f2895..56d1250 100644
--- a/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
+++ b/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
@@ -107,5 +107,5 @@ if (count($wolcomputers) > 0) {
?>
</tbody>
</table>
-<p class="text-center"><a href="status_dhcp_leases.php" class="navlink">DHCP Leases Status</a></p>
+<p class="text-center"><a href="status_dhcp_leases.php" class="navlink"><?=gettext('DHCP Leases Status')?></a></p>
</div>
diff --git a/src/usr/local/www/wizard.php b/src/usr/local/www/wizard.php
index e88b034..b3eb88a 100644
--- a/src/usr/local/www/wizard.php
+++ b/src/usr/local/www/wizard.php
@@ -89,25 +89,25 @@ if ($_POST['xml']) {
if (empty($xml)) {
$xml = "not_defined";
- print_info_box_np(sprintf(gettext("ERROR: Could not open %s."), $xml));
+ print_info_box(sprintf(gettext("ERROR: Could not open %s."), $xml));
die;
} else {
$wizard_xml_prefix = "{$g['www_path']}/wizards";
$wizard_full_path = "{$wizard_xml_prefix}/{$xml}";
if (substr_compare(realpath($wizard_full_path), $wizard_xml_prefix, 0, strlen($wizard_xml_prefix))) {
- print_info_box_np(gettext("ERROR: Invalid path specified."));
+ print_info_box(gettext("ERROR: Invalid path specified."));
die;
}
if (file_exists($wizard_full_path)) {
$pkg = parse_xml_config_pkg($wizard_full_path, "pfsensewizard");
} else {
- print_info_box_np(sprintf(gettext("ERROR: Could not open %s."), $xml));
+ print_info_box(sprintf(gettext("ERROR: Could not open %s."), $xml));
die;
}
}
if (!is_array($pkg)) {
- print_info_box_np(sprintf(gettext("ERROR: Could not parse %s/wizards/%s file."), $g['www_path'], $xml));
+ print_info_box(sprintf(gettext("ERROR: Could not parse %s/wizards/%s file."), $g['www_path'], $xml));
die;
}
@@ -214,8 +214,9 @@ do {
}
} while ($oldstepid != $stepid);
-$pgtitle = array($title);
-$notitle = true;
+$pgtitle = array(gettext("Wizard"), gettext($pkg['step'][0]['title'])); //First step is main title of the wizard in the breadcrumb
+$pgtitle[] = ($stepid > 0 ? gettext($pkg['step'][$stepid]['title']):'&nbsp;'); //Following steps are sub-level breadcrumbs.
+$shortcut_section = "Wizard";
include("head.inc");
if ($pkg['step'][$stepid]['fields']['field'] != "") { ?>
@@ -331,7 +332,7 @@ if ($pkg['step'][$stepid]['fields']['field'] != "") { ?>
foreach ($showfields as $showfield) {
$showfield = strtolower($showfield);
//print "\t\t" . 'document.iform.' . $showfield . ".display =\"none\";\n";
- print "\t\t jQuery('#". $showfield . "').hide();";
+ print "\t\t $('#". $showfield . "').hide();";
}
}
print "\t" . '} else {' . "\n";
@@ -340,7 +341,7 @@ if ($pkg['step'][$stepid]['fields']['field'] != "") { ?>
foreach ($showfields as $showfield) {
$showfield = strtolower($showfield);
#print "\t\t" . 'document.iform.' . $showfield . ".display =\"\";\n";
- print "\t\t jQuery('#". $showfield . "').show();";
+ print "\t\t $('#". $showfield . "').show();";
}
}
print "\t" . '}' . "\n";
@@ -379,7 +380,7 @@ function fixup_string($string) {
}
}
- $http_host = $_SERVER['SERVER_NAME'];
+ $http_host = $_SERVER['HTTP_HOST'];
$urlhost = $http_host;
// If finishing the setup wizard, check if accessing on a LAN or WAN address that changed
if ($title == "Reload in progress") {
@@ -448,7 +449,7 @@ $completion = ($stepid == 0) ? 0:($stepid * 100) / ($totalsteps -1);
?>
<!-- Present the pfSense logo -->
-<div class="text-center"><p><a href="<?=$ip?>"><img border="0" src="logo-black.png" alt="logo-black" align="middle" height="45" width="180" /></a></p></div><br /><br/>
+<div class="text-center"><p><a href="<?=$ip?>"><img src="logo-black.png" alt="logo-black" style="border:0px; vertical-align:middle" height="45" width="180" /></a></p></div><br /><br/>
<!-- Draw a progress bar to show step progress -->
<div class="progress">
@@ -536,7 +537,7 @@ if ($pkg['step'][$stepid]['fields']['field'] != "") {
'text',
$value
))->setHelp($field['description'])
- ->setOnchange(($field['validate']) ? "FieldValidate(this.value, " . $field['validate'] . ", " . $field['message'] . ")":"");
+ ->setOnchange(($field['validate']) ? "FieldValidate(this.value, \"" . $field['validate'] . "\", \"" . $field['message'] . "\")":"");
break;
case "text":
@@ -557,7 +558,7 @@ if ($pkg['step'][$stepid]['fields']['field'] != "") {
$onchange = "";
if ($field['validate']) {
- $onchange="FieldValidate(this.value, " . $field['validate'] . ", " . $field['message'] . ")";
+ $onchange="FieldValidate(this.value, \"" . $field['validate'] . "\", \"" . $field['message'] . "\")";
}
$section->addInput(new Form_Input(
@@ -647,7 +648,7 @@ if ($pkg['step'][$stepid]['fields']['field'] != "") {
'password',
$value
))->setHelp($field['description'])
- ->setOnchange(($field['validate']) ? "FieldValidate(this.value, " . $field['validate'] . ", " . $field['message'] .")":"");
+ ->setOnchange(($field['validate']) ? "FieldValidate(this.value, \"" . $field['validate'] . "\", \"" . $field['message'] ."\")":"");
break;
case "certca_selection":
@@ -804,7 +805,7 @@ if ($pkg['step'][$stepid]['fields']['field'] != "") {
$value
))->setHelp($field['description'])
->setAttribute('rows', $field['rows'])
- ->setOnchange(($field['validate']) ? "FieldValidate(this.value, " . $field['validate'] . ", " . $field['message'] . ")":"");
+ ->setOnchange(($field['validate']) ? "FieldValidate(this.value, \"" . $field['validate'] . "\", \"" . $field['message'] . "\")":"");
break;
case "submit":
@@ -929,7 +930,7 @@ print($form);
$counter = 0;
foreach ($inputaliases as $alias) {
?>
- $('#' + '<?php echo $alias; ?>').autocomplete({
+ $('#' + '<?=$alias;?>').autocomplete({
source: customarray
});
<?php
diff --git a/src/usr/local/www/wizards/openvpn_wizard.xml b/src/usr/local/www/wizards/openvpn_wizard.xml
index 3cd07a1..8eee453 100644
--- a/src/usr/local/www/wizards/openvpn_wizard.xml
+++ b/src/usr/local/www/wizards/openvpn_wizard.xml
@@ -32,9 +32,9 @@
<totalsteps>12</totalsteps>
<step>
<id>1</id>
- <title>OpenVPN Wizard: Authentication Type Selection</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <title>OpenVPN Remote Access Server Setup</title>
+ <description>This wizard will guide you through an OpenVPN Remote Access Server Setup .&lt;br/&gt;&lt;br/&gt; The wizard may be stopped at any time by clicking the logo image at the top of the screen.</description>
+ <disableheader>true</disableheader>
<fields>
<field>
<type>listtopic</type>
@@ -71,9 +71,9 @@
</step>
<step>
<id>2</id>
- <title>OpenVPN Wizard: LDAP Server Selection</title>
+ <title>LDAP Server Selection</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<type>listtopic</type>
@@ -107,9 +107,9 @@
</step>
<step>
<id>3</id>
- <title>OpenVPN Wizard: Add LDAP Server</title>
+ <title>Add LDAP Server</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<type>listtopic</type>
@@ -234,9 +234,9 @@
</step>
<step>
<id>4</id>
- <title>OpenVPN Wizard: RADIUS Server Selection</title>
+ <title>RADIUS Server Selection</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<type>listtopic</type>
@@ -270,9 +270,9 @@
</step>
<step>
<id>5</id>
- <title>OpenVPN Wizard: Add RADIUS Server</title>
+ <title>Add RADIUS Server</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<type>listtopic</type>
@@ -319,9 +319,9 @@
</step>
<step>
<id>6</id>
- <title>OpenVPN Wizard: Certificate Authority Selection</title>
+ <title>Certificate Authority Selection</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<name>Choose a Certificate Authority (CA)</name>
@@ -348,9 +348,9 @@
</step>
<step>
<id>7</id>
- <title>OpenVPN Wizard: Add Certificate Authority</title>
+ <title>Add Certificate Authority</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<name>Create a New Certificate Authority (CA) Certificate</name>
@@ -450,9 +450,9 @@
</step>
<step>
<id>8</id>
- <title>OpenVPN Wizard: Server Certificate Selection</title>
+ <title>Server Certificate Selection</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<name>Choose a Server Certificate</name>
@@ -479,9 +479,9 @@
</step>
<step>
<id>9</id>
- <title>OpenVPN Wizard: Add a Server Certificate</title>
+ <title>Add a Server Certificate</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<name>Create a New Server Certificate</name>
@@ -581,9 +581,9 @@
</step>
<step>
<id>10</id>
- <title>OpenVPN Wizard: Server Setup</title>
+ <title>Server Setup</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<type>listtopic</type>
@@ -936,9 +936,9 @@
</step>
<step>
<id>11</id>
- <title>OpenVPN Wizard: Firewall Rule Configuration</title>
+ <title>Firewall Rule Configuration</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<type>listtopic</type>
@@ -978,9 +978,9 @@
</step>
<step>
<id>12</id>
- <title>OpenVPN Wizard: Finished!</title>
+ <title>Finished!</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
+ <disableheader>true</disableheader>
<fields>
<field>
<type>listtopic</type>
@@ -1002,4 +1002,4 @@
<stepsubmitphpaction>step12_submitphpaction();</stepsubmitphpaction>
<includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
</step>
-</pfsensewizard> \ No newline at end of file
+</pfsensewizard>
diff --git a/src/usr/local/www/wizards/setup_wizard.xml b/src/usr/local/www/wizards/setup_wizard.xml
index 199859e..4914c89 100644
--- a/src/usr/local/www/wizards/setup_wizard.xml
+++ b/src/usr/local/www/wizards/setup_wizard.xml
@@ -55,7 +55,7 @@
<totalsteps>10</totalsteps>
<step>
<id>1</id>
- <title>pfSense Setup Wizard</title>
+ <title>pfSense Setup</title>
<disableheader>true</disableheader>
<description>This wizard will guide you through the initial configuration of pfSense.&lt;br/&gt;&lt;br/&gt; The wizard may be stopped at any time by clicking the logo image at the top of the screen.</description>
<fields>
@@ -621,7 +621,7 @@
<stepsubmitphpaction>
<![CDATA[
if(empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) {
- print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
+ print_info_box("Invalid LAN IP Address. Please press back in your browser window and correct.");
die;
}
@@ -709,7 +709,7 @@
local_user_set($admin_user);
write_config();
} else {
- print_info_box_np("Passwords do not match! Please press back in your browser window and correct.");
+ print_info_box("Passwords do not match! Please press back in your browser window and correct.");
die;
}
}
diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml
index 992fbab..96cb828 100755..100644
--- a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml
+++ b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml
@@ -55,10 +55,10 @@
<totalsteps>9</totalsteps>
<step>
<id>1</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>pfSense Traffic Shaper</title>
<disableheader>true</disableheader>
- <description>This wizard will guide you through setting up the pfSense traffic shaper.
- Please be aware that Custom Bandwidths should not exceed 30% of the interface/link bandwidth. Keep this in mind during the wizard.
+ <description>This wizard will guide you through setting up the pfSense traffic shaper.&lt;br/&gt;&lt;br/&gt; The wizard may be stopped at any time by clicking the logo image at the top of the screen.
+ &lt;br/&gt;&lt;br/&gt; Please be aware that Custom Bandwidths should not exceed 30% of the interface/link bandwidth. Keep this in mind during the wizard.
</description>
<fields>
<field>
@@ -84,7 +84,7 @@
</step>
<step>
<id>2</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Shaper configuration</title>
<description>Shaper configuration</description>
<javascriptafterformdisplay/>
<stepbeforeformdisplay>step2_stepbeforeformdisplay();</stepbeforeformdisplay>
@@ -99,7 +99,7 @@
</step>
<step>
<id>3</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Voice over IP</title>
<description>Voice over IP</description>
<fields>
<field>
@@ -163,7 +163,7 @@
</step>
<step>
<id>4</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Penalty Box</title>
<description>Penalty Box</description>
<disableallfieldsbydefault>true</disableallfieldsbydefault>
<fields>
@@ -238,7 +238,7 @@
</step>
<step>
<id>5</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Peer to Peer networking</title>
<description>Peer to Peer networking</description>
<disableallfieldsbydefault>true</disableallfieldsbydefault>
<fields>
@@ -442,7 +442,7 @@
</step>
<step>
<id>6</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Network Games</title>
<disableallfieldsbydefault>true</disableallfieldsbydefault>
<description>Network Games</description>
<fields>
@@ -760,7 +760,7 @@
</step>
<step>
<id>7</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Raise or lower other Applications</title>
<disableallfieldsbydefault>true</disableallfieldsbydefault>
<description>Raise or lower other Applications</description>
<fields>
@@ -1634,7 +1634,7 @@
</step>
<step>
<id>8</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Reload profile</title>
<field>
<name>Reload profile notice</name>
<type>listtopic</type>
diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
index 91b9b19..3d155fc 100644
--- a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -109,6 +109,7 @@ function step2_stepbeforeformdisplay() {
global $config, $pkg;
global $stepid, $savemsg;
+ $list_all_ifs = false;
$wans = 0;
$lans = 0;
$iflist = array();
@@ -122,6 +123,10 @@ function step2_stepbeforeformdisplay() {
$lans++;
$iflist[$if] = $ifdesc;
}
+ if ($wans == 0) {
+ $list_all_ifs = true;
+ $wans = $lans;
+ }
$numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']);
if ($numberofconnections > $wans) {
$savemsg=gettext("You have less interfaces than number of connections!");
@@ -160,8 +165,10 @@ function step2_stepbeforeformdisplay() {
$field['options']['option'] = array();
foreach ($iflist as $ifname => $ifdescr) {
// Skip wan interfaces here
- if (interface_has_gateway($ifname) || interface_has_gatewayv6($ifname))
+ if (interface_has_gateway($ifname) ||
+ interface_has_gatewayv6($ifname)) {
continue;
+ }
$opts = array();
$opts['displayname'] = $ifdescr;
$opts['name'] = $ifname;
@@ -211,8 +218,11 @@ function step2_stepbeforeformdisplay() {
$field['options']['option'] = array();
foreach ($iflist as $ifname => $ifdescr) {
// Skip lan interfaces here
- if (!interface_has_gateway($ifname) && !interface_has_gatewayv6($ifname))
+ if (!$list_all_ifs &&
+ !interface_has_gateway($ifname) &&
+ !interface_has_gatewayv6($ifname)) {
continue;
+ }
$opts = array();
$opts['displayname'] = $ifdescr;
$opts['name'] = $ifname;
diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
index dfbaf6b..f49138c 100755..100644
--- a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
+++ b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
@@ -55,10 +55,10 @@
<totalsteps>9</totalsteps>
<step>
<id>1</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>pfSense Traffic Shaper</title>
<disableheader>true</disableheader>
- <description>This wizard will guide you through setting up the pfSense traffic shaper.
- Please be aware that Custom Bandwidths should not exceed 30% of the interface/link bandwidth. Keep this in mind during the wizard.
+ <description>This wizard will guide you through setting up the pfSense traffic shaper. &lt;br/&gt;&lt;br/&gt; The wizard may be stopped at any time by clicking the logo image at the top of the screen.
+ &lt;br/&gt;&lt;br/&gt; Please be aware that Custom Bandwidths should not exceed 30% of the interface/link bandwidth. Keep this in mind during the wizard.
</description>
<fields>
<field>
@@ -92,7 +92,7 @@
</step>
<step>
<id>2</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Shaper configuration</title>
<description>Shaper configuration</description>
<javascriptafterformdisplay/>
<stepbeforeformdisplay>step2_stepbeforeformdisplay();</stepbeforeformdisplay>
@@ -107,7 +107,7 @@
</step>
<step>
<id>3</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Voice over IP</title>
<description>Voice over IP</description>
<fields>
<field>
@@ -171,7 +171,7 @@
</step>
<step>
<id>4</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Penalty Box</title>
<description>Penalty Box</description>
<disableallfieldsbydefault>true</disableallfieldsbydefault>
<fields>
@@ -245,7 +245,7 @@
</step>
<step>
<id>5</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Peer to Peer networking</title>
<description>Peer to Peer networking</description>
<disableallfieldsbydefault>true</disableallfieldsbydefault>
<fields>
@@ -448,7 +448,7 @@
</step>
<step>
<id>6</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Network Games</title>
<disableallfieldsbydefault>true</disableallfieldsbydefault>
<description>Network Games</description>
<fields>
@@ -766,7 +766,7 @@
</step>
<step>
<id>7</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Raise or lower other Applications</title>
<disableallfieldsbydefault>true</disableallfieldsbydefault>
<description>Raise or lower other Applications</description>
<fields>
@@ -1640,7 +1640,7 @@
</step>
<step>
<id>8</id>
- <title>pfSense Traffic Shaper Wizard</title>
+ <title>Reload Profile</title>
<field>
<name>Reload profile notice</name>
<type>listtopic</type>
diff --git a/src/usr/local/www/xmlrpc.php b/src/usr/local/www/xmlrpc.php
index b70f592..559a168 100755
--- a/src/usr/local/www/xmlrpc.php
+++ b/src/usr/local/www/xmlrpc.php
@@ -344,8 +344,8 @@ function restore_config_section_xmlrpc($raw_params) {
}
/*****************************/
-$merge_config_section_doc = gettext("XMLRPC wrapper for merging package sections. This method must be called with two parameters: a string containing the local system\'s password and an array to merge into the system\'s config. This function returns true upon completion.");
-$merge_config_section_sig = array(
+$merge_installedpackages_section_doc = gettext("XMLRPC wrapper for merging package sections. This method must be called with two parameters: a string containing the local system\'s password and an array to merge into the system\'s config. This function returns true upon completion.");
+$merge_installedpackages_section_sig = array(
array(
$XML_RPC_Boolean,
$XML_RPC_String,
@@ -552,7 +552,8 @@ $server = new XML_RPC_Server(
'signature' => $filter_configure_sig,
'docstring' => $filter_configure_doc),
'pfsense.interfaces_carp_configure' => array('function' => 'interfaces_carp_configure_xmlrpc',
- 'docstring' => $carp_configure_sig),
+ 'signature' => $carp_configure_sig,
+ 'docstring' => $carp_configure_doc),
'pfsense.backup_config_section' => array('function' => 'backup_config_section_xmlrpc',
'signature' => $backup_config_section_sig,
'docstring' => $backup_config_section_doc),
@@ -563,11 +564,11 @@ $server = new XML_RPC_Server(
'signature' => $merge_config_section_sig,
'docstring' => $merge_config_section_doc),
'pfsense.merge_installedpackages_section_xmlrpc' => array('function' => 'merge_installedpackages_section_xmlrpc',
- 'signature' => $merge_config_section_sig,
- 'docstring' => $merge_config_section_doc),
+ 'signature' => $merge_installedpackages_section_sig,
+ 'docstring' => $merge_installedpackages_section_doc),
'pfsense.host_firmware_version' => array('function' => 'pfsense_firmware_version_xmlrpc',
'signature' => $pfsense_firmware_version_sig,
- 'docstring' => $host_firmware_version_doc),
+ 'docstring' => $pfsense_firmware_version_doc),
'pfsense.reboot' => array('function' => 'reboot_xmlrpc',
'signature' => $reboot_sig,
'docstring' => $reboot_doc),
OpenPOWER on IntegriCloud