Globally replace luci.dispatcher.build_url(...) with url(...) invocations
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Oct 2015 17:07:36 +0000 (19:07 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Oct 2015 17:07:36 +0000 (19:07 +0200)
Also concat multiple string arguments into one while we're at it.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
33 files changed:
applications/luci-app-ahcp/luasrc/view/ahcp_status.htm
applications/luci-app-asterisk/luasrc/view/asterisk/dialplans.htm
applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm
applications/luci-app-commands/luasrc/view/commands.htm
applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm
applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm
applications/luci-app-ddns/luasrc/view/ddns/system_status.htm
applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm
applications/luci-app-freifunk-widgets/luasrc/view/freifunk/widgets/search/main.htm
applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm
applications/luci-app-minidlna/luasrc/view/minidlna_status.htm
applications/luci-app-multiwan/luasrc/view/multiwan_status.htm
applications/luci-app-ocserv/luasrc/view/ocserv_status.htm
applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm
applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm
applications/luci-app-privoxy/luasrc/view/privoxy/detail_startstop.htm
applications/luci-app-radicale/luasrc/view/radicale/btn_startstop.htm
applications/luci-app-upnp/luasrc/view/upnp_status.htm
modules/luci-base/luasrc/view/cbi/apply_xhr.htm
modules/luci-base/luasrc/view/cbi/browser.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm
modules/luci-mod-admin-full/luasrc/view/admin_system/backupfiles.htm
modules/luci-mod-admin-full/luasrc/view/admin_system/clock_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_system/ipkg.htm
modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm

index 88796cb..9468289 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "ahcpd", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/network/ahcpd/status')%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('ahcpd_status_table');
index 6de7ba1..9f644ba 100644 (file)
@@ -56,7 +56,7 @@
 %>
 
 
-<form method="post" action="<%=luci.dispatcher.build_url("admin", "asterisk", "dialplans")%>" enctype="multipart/form-data">
+<form method="post" action="<%=url('admin/asterisk/dialplans')%>" enctype="multipart/form-data">
        <div>
                <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
                <input type="hidden" name="cbi.submit" value="1" />
@@ -68,9 +68,9 @@
        <div class="cbi-map-descr">
                Here you can manage your dial plans which are used to route outgoing calls from your local extensions.<br /><br />
                Related tasks:<br />
-               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans/zones')%>" class="cbi-title-ref">Manage dialzones</a> |
-               <a href="<%=luci.dispatcher.build_url('admin/asterisk/voicemail/mailboxes')%>" class="cbi-title-ref">Manage voicemail boxes</a> |
-               <a href="<%=luci.dispatcher.build_url('admin/asterisk/meetme/rooms')%>" class="cbi-title-ref">Manage meetme rooms</a>
+               <a href="<%=url('admin/asterisk/dialplans/zones')%>" class="cbi-title-ref">Manage dialzones</a> |
+               <a href="<%=url('admin/asterisk/voicemail/mailboxes')%>" class="cbi-title-ref">Manage voicemail boxes</a> |
+               <a href="<%=url('admin/asterisk/meetme/rooms')%>" class="cbi-title-ref">Manage meetme rooms</a>
        </div>
        <!-- tblsection -->
        <fieldset class="cbi-section" id="cbi-asterisk-sip">
@@ -85,7 +85,7 @@
                                                <big>Dialplan <em><%=plan.name%></em></big>
                                        </th>
                                        <td>
-                                               <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans')%>?delplan=<%=plan.name%>">
+                                               <a href="<%=url('admin/asterisk/dialplans')%>?delplan=<%=plan.name%>">
                                                        <img style="border:none" alt="Remove this dialplan" title="Remove this dialplan" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
                                                </p>
                                        </td>
                                        <td style="width:5%" class="cbi-value-field">
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans/out', zone.name)%>">
+                                               <a href="<%=url('admin/asterisk/dialplans/out', zone.name)%>">
                                                        <img style="border:none" alt="Edit dialzone" title="Edit dialzone" src="/luci-static/resources/cbi/edit.gif" />
                                                </a>
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans')%>?delzone.<%=plan.name%>=<%=zone.name%>">
+                                               <a href="<%=url('admin/asterisk/dialplans')%>?delzone.<%=plan.name%>=<%=zone.name%>">
                                                        <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
                                                </p>
                                        </td>
                                        <td style="width:5%" class="cbi-value-field">
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/voicemail/mailboxes')%>">
+                                               <a href="<%=url('admin/asterisk/voicemail/mailboxes')%>">
                                                        <img style="border:none" alt="Manage mailboxes ..." title="Manage mailboxes ..." src="/luci-static/resources/cbi/edit.gif" />
                                                </a>
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans')%>?delvbox.<%=plan.name%>=<%=ext%>">
+                                               <a href="<%=url('admin/asterisk/dialplans')%>?delvbox.<%=plan.name%>=<%=ext%>">
                                                        <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
                                                </p>
                                        </td>
                                        <td style="width:5%" class="cbi-value-field">
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/meetme/rooms')%>">
+                                               <a href="<%=url('admin/asterisk/meetme/rooms')%>">
                                                        <img style="border:none" alt="Manage conferences ..." title="Manage conferences ..." src="/luci-static/resources/cbi/edit.gif" />
                                                </a>
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans')%>?delmeetme.<%=plan.name%>=<%=ext%>">
+                                               <a href="<%=url('admin/asterisk/dialplans')%>?delmeetme.<%=plan.name%>=<%=ext%>">
                                                        <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
index c867bc1..ffdbbcf 100644 (file)
@@ -47,7 +47,7 @@
 %>
 
 
-<form method="post" action="<%=luci.dispatcher.build_url("admin", "asterisk", "dialplans", "zones")%>" enctype="multipart/form-data">
+<form method="post" action="<%=url('admin/asterisk/dialplans/zones')%>" enctype="multipart/form-data">
        <div>
                <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
                <input type="hidden" name="cbi.submit" value="1" />
@@ -57,7 +57,7 @@
 <div class="cbi-map" id="cbi-asterisk">
        <h2 name="content">Dial Zone Management</h2>
        <div class="cbi-map-descr">
-               <a href="<%=luci.dispatcher.build_url("admin/asterisk/dialplans")%>" class="cbi-title-ref">Back to dialplan overview</a><br /><br />
+               <a href="<%=url("admin/asterisk/dialplans")%>" class="cbi-title-ref">Back to dialplan overview</a><br /><br />
                Here you can manage your dial zones. The zones are used to route outgoing calls to the destination.
                Each zone groups multiple trunks and number matches to represent a logical destination. Zones can
                also be used to enforce certain dial restrictions on selected extensions.
                                                <%=rule.description or rule.name%>
                                        </td>
                                        <td style="text-align:left" class="cbi-value-field">
-                                               <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans', 'out', rule.name)%>">
+                                               <a href="<%=url('admin/asterisk/dialplans/out', rule.name)%>">
                                                        <img style="border:none" alt="Edit entry" title="Edit entry" src="/luci-static/resources/cbi/edit.gif" />
                                                </a>
-                                               <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans', 'zones')%>?delzone=<%=rule.name%>">
+                                               <a href="<%=url('admin/asterisk/dialplans/zones')%>?delzone=<%=rule.name%>">
                                                        <img style="border:none" alt="Delete entry" title="Delete entry" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
index e548757..73b9e6a 100644 (file)
@@ -58,7 +58,7 @@
                        legend.parentNode.style.display = 'block';
                        legend.style.display = 'inline';
 
-                       stxhr.get('<%=luci.dispatcher.build_url("admin", "system", "commands", "run")%>/' + id + (args ? '/' + args : ''), null,
+                       stxhr.get('<%=url('admin/system/commands/run')%>/' + id + (args ? '/' + args : ''), null,
                                function(x, st)
                                {
                                        if (st)
@@ -93,7 +93,7 @@
                if (field)
                        args = encodeURIComponent(field.value);
 
-               location.href = '<%=luci.dispatcher.build_url("admin", "system", "commands", "download")%>/' + id + (args ? '/' + args : '');
+               location.href = '<%=url('admin/system/commands/download')%>/' + id + (args ? '/' + args : '');
        }
 
        function command_link(id)
index 494b743..4dcb7bb 100644 (file)
@@ -6,7 +6,7 @@
                var txt = document.getElementById("cbid.ddns." + section + "._logview.txt");    // TextArea
                if ( !txt ) { return; } // security check
 
-               XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "logview")%>/' + section, null,
+               XHR.get('<%=url('admin/services/ddns/logview')%>/' + section, null,
                        function(x) {
                                if (x.responseText == "_nodata_")
                                        txt.value = "<%:File not found or empty%>";
index ea8e4a1..5464812 100644 (file)
 
                // do start/stop
                var btnXHR = new XHR();
-               btnXHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "startstop")%>/' + section + '/' + cbx.checked, null,
+               btnXHR.get('<%=url('admin/services/ddns/startstop')%>/' + section + '/' + cbx.checked, null,
                        function(x, data) {
                                if (x.responseText == "_uncommitted_") {
                                        // we need a trick to display Ampersand "&" in stead of "&#38;" or "&amp;"
        }
 
        // force to immediate show status on page load (not waiting for XHR.poll)
-       XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null,
+       XHR.get('<%=url('admin/services/ddns/status')%>', null,
                function(x, data) {
                        if (data) { _data2elements(data); }
                }
        // define only ONE XHR.poll in a page because if one is running it blocks the other one
        // optimum is to define on Map or Section Level from here you can reach all elements
        // we need update every 15 seconds only
-       XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null,
+       XHR.poll(15, '<%=url('admin/services/ddns/status')%>', null,
                function(x, data) {
                        if (data) { _data2elements(data); }
                }
index 4ca0abb..06dca48 100644 (file)
        }
 
        // force to immediate show status (not waiting for XHR.poll)
-       XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null,
+       XHR.get('<%=url('admin/services/ddns/status')%>', null,
                function(x, data) {
                        if (data) { _data2elements(x, data); }
                }
        );
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/ddns/status')%>', null,
                function(x, data) {
                        if (data) { _data2elements(x, data); }
                }
 //]]></script>
 
 <fieldset class="cbi-section" id="ddns_status_section">
-       <legend><a href="<%=luci.dispatcher.build_url([[admin]], [[services]], [[ddns]])%>"><%:Dynamic DNS%></a></legend>
+       <legend><a href="<%=url([[admin]], [[services]], [[ddns]])%>"><%:Dynamic DNS%></a></legend>
 
        <table class="cbi-section-table" id="ddns_status_table">
                <tr class="cbi-section-table-titles">
index ef3342e..fe205d0 100644 (file)
@@ -34,7 +34,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
                        legend.parentNode.style.display = 'block';
                        legend.style.display = 'inline';
 
-                       stxhr.get('<%=luci.dispatcher.build_url("freifunk", "status")%>/diag_' + tool + protocol + '/' + addr, null,
+                       stxhr.get('<%=url('freifunk/status')%>/diag_' + tool + protocol + '/' + addr, null,
                                function(x)
                                {
                                        if (x.responseText)
index e319f15..f2e2fb9 100644 (file)
@@ -33,7 +33,7 @@ end
 <div id="<%=name%>" style="width:<%=width%>;float:left">
        <h2><%=title%></h2>
        <div id="form_<%=name%>">
-               <form name="searchform" id="search_<%=name%>" action="<%=luci.dispatcher.build_url('freifunk', 'search_redirect')%>">
+               <form name="searchform" id="search_<%=name%>" action="<%=url('freifunk/search_redirect')%>">
                        <input type="text" name="searchterms" style="margin-bottom:15px; width: 90%"><br />
                        <%
                        local checked = " checked"
index 234f909..d861ef9 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "telephony", "status")%>', null,
+XHR.poll(5, '<%=url('admin/telephony/status')%>', null,
        function(x, st)
        {
                var tb = document.getElementById('telephony_status_table');
index 098a72a..866eded 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin/services/minidlna_status")%>', null,
+       XHR.poll(5, '<%=url("admin/services/minidlna_status")%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('minidlna_status');
index 8c4127b..03bfad1 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "multiwan", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/network/multiwan/status')%>', null,
                function(x, st)
                {
                        var tx = document.getElementById('multiwan_status_text');
index fabc1bc..138b039 100644 (file)
@@ -1,7 +1,7 @@
 <script type="text/javascript">//<![CDATA[
 
        function ocserv_disconnect(idx) {
-               XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ocserv", "disconnect")%>/' + idx, null,
+               XHR.get('<%=url('admin/services/ocserv/disconnect')%>/' + idx, null,
                        function(x)
                        {
                                var tb = document.getElementById('ocserv_status_table');
@@ -11,7 +11,7 @@
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ocserv", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/ocserv/status')%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('ocserv_status_table');
index ac5c893..f22cb68 100644 (file)
@@ -6,14 +6,14 @@
 
 <fieldset class="cbi-section">
        <legend>
-               <a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn")%>"><%:Overview%></a> &raquo;
+               <a href="<%=url('admin/services/openvpn')%>"><%:Overview%></a> &raquo;
                <%=luci.i18n.translatef("Instance \"%s\"", self.instance)%>
        </legend>
 
        <% if self.mode == "basic" then %>
-               <a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "advanced", self.instance, "Service")%>"><%:Switch to advanced configuration »%></a>
+               <a href="<%=url('admin/services/openvpn/advanced', self.instance, "Service")%>"><%:Switch to advanced configuration »%></a>
        <% else %>
-               <a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "basic", self.instance)%>"><%:« Switch to basic configuration%></a>
+               <a href="<%=url('admin/services/openvpn/basic', self.instance)%>"><%:« Switch to basic configuration%></a>
                <hr style="margin:0.5em 0" />
                <%:Configuration category%>:
                <% for i, c in ipairs(self.categories) do %>
index 3e19070..ab0019b 100644 (file)
@@ -6,7 +6,7 @@
                var txt = document.getElementById("cbid.privoxy.privoxy._logview.txt"); // TextArea
                if ( !txt ) { return; } // security check
                var lvXHR = new XHR();
-               lvXHR.get('<%=luci.dispatcher.build_url("admin", "services", "privoxy", "logview")%>', null,
+               lvXHR.get('<%=url('admin/services/privoxy/logview')%>', null,
                        function(x) {
                                if (x.responseText == "_nodata_")
                                        txt.value = "<%:File not found or empty%>";
index b9de886..8c97dae 100644 (file)
        function onclick_startstop(id) {
                // do start/stop
                var btnXHR = new XHR();
-               btnXHR.get('<%=luci.dispatcher.build_url("admin", "services", "privoxy", "startstop")%>', null,
+               btnXHR.get('<%=url('admin/services/privoxy/startstop')%>', null,
                        function(x) { _data2elements(x); }
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "privoxy", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/privoxy/status')%>', null,
                function(x, data) { _data2elements(x); }
        );
 
index 79d1c36..b346275 100644 (file)
        function onclick_startstop(id) {
                // do start/stop
                var btnXHR = new XHR();
-               btnXHR.get('<%=luci.dispatcher.build_url("admin", "services", "radicale", "startstop")%>', null,
+               btnXHR.get('<%=url('admin/services/radicale/startstop')%>', null,
                        function(x) { _data2elements(x); }
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "radicale", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/radicale/status')%>', null,
                function(x, data) { _data2elements(x); }
        );
 
index d50ed0c..ce735cf 100644 (file)
@@ -1,6 +1,6 @@
 <script type="text/javascript">//<![CDATA[
        function upnp_delete_fwd(idx) {
-               XHR.get('<%=luci.dispatcher.build_url("admin", "services", "upnp", "delete")%>/' + idx, null,
+               XHR.get('<%=url('admin/services/upnp/delete')%>/' + idx, null,
                        function(x)
                        {
                                var tb = document.getElementById('upnp_status_table');
@@ -10,7 +10,7 @@
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "upnp", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/upnp/status')%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('upnp_status_table');
index 6f63ba8..daa57c1 100644 (file)
@@ -4,10 +4,10 @@
        <script type="text/javascript">//<![CDATA[
                var apply_xhr = new XHR();
 
-               apply_xhr.post('<%=luci.dispatcher.build_url("servicectl", "restart", table.concat(configs, ","))%>', { token: '<%=token%>' },
+               apply_xhr.post('<%=url('servicectl/restart', table.concat(configs, ","))%>', { token: '<%=token%>' },
                        function() {
                                var checkfinish = function() {
-                                       apply_xhr.get('<%=luci.dispatcher.build_url("servicectl", "status")%>', null,
+                                       apply_xhr.get('<%=url('servicectl/status')%>', null,
                                                function(x) {
                                                        if( x.responseText == 'finish' )
                                                        {
index e4a4077..a181201 100644 (file)
@@ -2,6 +2,6 @@
 <%+cbi/valueheader%>
        <input class="cbi-input-text" type="text"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> />
        <script type="text/javascript">
-cbi_browser_init('<%=cbid%>', '<%=resource%>', '<%=luci.dispatcher.build_url("admin", "filebrowser")%>'<%=self.default_path and ", '"..self.default_path.."'"%>);
+cbi_browser_init('<%=cbid%>', '<%=resource%>', '<%=url('admin/filebrowser')%>'<%=self.default_path and ", '"..self.default_path.."'"%>);
        </script>
 <%+cbi/valuefooter%>
index 8a6c90f..e06a88d 100644 (file)
@@ -34,7 +34,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
                        legend.parentNode.style.display = 'block';
                        legend.style.display = 'inline';
 
-                       stxhr.get('<%=luci.dispatcher.build_url("admin", "network")%>/diag_' + tool + protocol + '/' + addr, null,
+                       stxhr.get('<%=url('admin/network')%>/diag_' + tool + protocol + '/' + addr, null,
                                function(x)
                                {
                                        if (x.responseText)
index 1de3498..4cdf2df 100644 (file)
@@ -49,7 +49,7 @@
                        s.innerHTML = '<%:Waiting for changes to be applied...%>';
                }
 
-               XHR.get('<%=luci.dispatcher.build_url("admin", "network")%>/iface_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null,
+               XHR.get('<%=url('admin/network')%>/iface_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null,
                        function(x)
                        {
                                if (s)
@@ -71,7 +71,7 @@
        var wifidevs = <%=luci.http.write_json(netdevs)%>;
        var arptable = <%=luci.http.write_json(arpcache)%>;
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "iface_status", table.concat(ifaces, ","))%>', null,
+       XHR.poll(5, '<%=url('admin/network/iface_status', table.concat(ifaces, ","))%>', null,
                function(x, ifcs)
                {
                        if (ifcs)
                                                d.innerHTML = String.format(
                                                        '<em><%:Unsupported protocol type.%></em><br />' +
                                                        '<a href="%h"><%:Install protocol extensions...%></a>',
-                                                               '<%=luci.dispatcher.build_url("admin/system/packages")%>?query=luci-proto&display=available'
+                                                               '<%=url("admin/system/packages")%>?query=luci-proto&display=available'
                                                );
                                        }
                                        else if (d && !ifc.ifname)
                                        {
                                                d.innerHTML = String.format(
                                                        '<em><%:Network without interfaces.%></em><br />' +
-                                                       '<a href="<%=luci.dispatcher.build_url("admin/network/network/%s")%>?tab.network.%s=physical"><%:Assign interfaces...%></a>',
+                                                       '<a href="<%=url("admin/network/network/%s")%>?tab.network.%s=physical"><%:Assign interfaces...%></a>',
                                                                ifc.name, ifc.name
                                                );
                                        }
                                        <td style="width:420px">
                                                <input type="button" class="cbi-button cbi-button-reload" style="width:100px" onclick="iface_shutdown('<%=net[1]%>', true)" title="<%:Reconnect this interface%>" value="<%:Connect%>" />
                                                <input type="button" class="cbi-button cbi-button-reset" style="width:100px" onclick="iface_shutdown('<%=net[1]%>', false)" title="<%:Shutdown this interface%>" value="<%:Stop%>" />
-                                               <input type="button" class="cbi-button cbi-button-edit" style="width:100px" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/network", net[1])%>'" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit" />
-                                               <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="if (confirm('<%:Really delete this interface? The deletion cannot be undone!\nYou might lose access to this device if you are connected via this interface.%>')) location.href='<%=luci.dispatcher.build_url("admin/network/iface_delete", net[1])%>'" title="<%:Delete this interface%>" value="<%:Delete%>" />
+                                               <input type="button" class="cbi-button cbi-button-edit" style="width:100px" onclick="location.href='<%=url("admin/network/network", net[1])%>'" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit" />
+                                               <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="if (confirm('<%:Really delete this interface? The deletion cannot be undone!\nYou might lose access to this device if you are connected via this interface.%>')) location.href='<%=url("admin/network/iface_delete", net[1])%>'" title="<%:Delete this interface%>" value="<%:Delete%>" />
                                        </td>
                                </tr>
                        <% end %>
                </table>
 
-               <input type="button" class="cbi-button cbi-button-add" value="<%:Add new interface...%>" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/iface_add")%>'" />
+               <input type="button" class="cbi-button cbi-button-add" value="<%:Add new interface...%>" onclick="location.href='<%=url("admin/network/iface_add")%>'" />
        </fieldset>
 </div>
index 8136383..1ebdbfc 100644 (file)
@@ -1,7 +1,7 @@
 <%+cbi/valueheader%>
 
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "iface_status", self.network)%>', null,
+       XHR.poll(5, '<%=url('admin/network/iface_status', self.network)%>', null,
                function(x, ifc)
                {
                        if (ifc && (ifc = ifc[0]))
index 0ba334e..ab8e732 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "dhcplease_status")%>', null,
+       XHR.poll(5, '<%=url('admin/network/dhcplease_status')%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('lease_status_table');
index b299575..53c35ae 100644 (file)
@@ -1,6 +1,6 @@
 <script type="text/javascript">//<![CDATA[
        var switches = [ '<%=table.concat(self.switches, "', '")%>' ];
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "switch_status")%>/' + switches.join(','), null,
+       XHR.poll(5, '<%=url('admin/network/switch_status')%>/' + switches.join(','), null,
                function(x, st)
                {
                        for (var i = 0; i < switches.length; i++)
index 431afb5..671d16e 100644 (file)
        </fieldset>
 </div>
 <div class="cbi-page-actions right">
-       <form class="inline" action="<%=luci.dispatcher.build_url("admin/network/wireless")%>" method="get">
+       <form class="inline" action="<%=url("admin/network/wireless")%>" method="get">
                <input class="cbi-button cbi-button-reset" type="submit" value="<%:Back to overview%>" />
        </form>
        <form class="inline" action="<%=REQUEST_URI%>" method="get">
index ca1f20b..17afe0d 100644 (file)
                                st.innerHTML = '<em><%:Wireless is restarting...%></em>';
                }
 
-               XHR.get('<%=luci.dispatcher.build_url("admin", "network")%>/wireless_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null,
+               XHR.get('<%=url('admin/network')%>/wireless_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null,
                        function(x)
                        {
                                if (s)
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "wireless_status", table.concat(netlist, ","))%>', null,
+       XHR.poll(5, '<%=url('admin/network/wireless_status', table.concat(netlist, ","))%>', null,
                function(x, st)
                {
                        if (st)
                                        <span id="<%=dev:name()%>-iw-devinfo"></span>
                                </td>
                                <td style="width:310px;text-align:right">
-                                       <input type="button" class="cbi-button cbi-button-find" style="width:100px" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/wireless_join")%>?device=<%=dev:name()%>'" title="<%:Find and join network%>" value="<%:Scan%>" />
-                                       <input type="button" class="cbi-button cbi-button-add" style="width:100px" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/wireless_add")%>?device=<%=dev:name()%>'" title="<%:Provide new network%>" value="<%:Add%>" />
+                                       <input type="button" class="cbi-button cbi-button-find" style="width:100px" onclick="location.href='<%=url("admin/network/wireless_join")%>?device=<%=dev:name()%>'" title="<%:Find and join network%>" value="<%:Scan%>" />
+                                       <input type="button" class="cbi-button cbi-button-add" style="width:100px" onclick="location.href='<%=url("admin/network/wireless_add")%>?device=<%=dev:name()%>'" title="<%:Provide new network%>" value="<%:Add%>" />
                                </td>
                        </tr>
                        <!-- /physical device -->
                                        <td class="cbi-value-field" style="width:310px;text-align:right">
                                                <input id="<%=net:id()%>-iw-toggle" type="button" class="cbi-button cbi-button-reload" style="width:100px" onclick="wifi_shutdown('<%=net:id()%>', this)" title="<%:Delete this network%>" value="<%:Enable%>" />
                                                <input type="button" class="cbi-button cbi-button-edit" style="width:100px" onclick="location.href='<%=net:adminlink()%>'" title="<%:Edit this network%>" value="<%:Edit%>" />
-                                               <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="if (confirm('<%:Really delete this wireless network? The deletion cannot be undone!\nYou might lose access to this device if you are connected via this network.%>')) location.href='<%=luci.dispatcher.build_url("admin/network/wireless_delete", net:ifname())%>'" title="<%:Delete this network%>" value="<%:Remove%>" />
+                                               <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="if (confirm('<%:Really delete this wireless network? The deletion cannot be undone!\nYou might lose access to this device if you are connected via this network.%>')) location.href='<%=url("admin/network/wireless_delete", net:ifname())%>'" title="<%:Delete this network%>" value="<%:Remove%>" />
                                        </td>
                                </tr>
                                <% end %>
index fa0a97b..04687f3 100644 (file)
@@ -1,7 +1,7 @@
 <%+cbi/valueheader%>
 
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "wireless_status", self.ifname)%>', null,
+       XHR.poll(5, '<%=url('admin/network/wireless_status', self.ifname)%>', null,
                function(x, iw)
                {
                        if (iw && (iw = iw[0]))
index c1f982d..3757388 100644 (file)
@@ -63,8 +63,8 @@
 
 <% if has_ip6tables then %>
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab<%= mode ~= 4 and "-disabled" %>"><a href="<%=luci.dispatcher.build_url("admin/status/iptables/4")%>"><%:IPv4 Firewall%></a></li>
-       <li class="cbi-tab<%= mode ~= 6 and "-disabled" %>"><a href="<%=luci.dispatcher.build_url("admin/status/iptables/6")%>"><%:IPv6 Firewall%></a></li>
+       <li class="cbi-tab<%= mode ~= 4 and "-disabled" %>"><a href="<%=url("admin/status/iptables/4")%>"><%:IPv4 Firewall%></a></li>
+       <li class="cbi-tab<%= mode ~= 6 and "-disabled" %>"><a href="<%=url("admin/status/iptables/6")%>"><%:IPv6 Firewall%></a></li>
 </ul>
 <% end %>
 
index 0a6df10..c1f3361 100644 (file)
@@ -5,6 +5,6 @@
 -%>
 
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/system/flashops")%>"><%:Actions%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=url("admin/system/flashops")%>"><%:Actions%></a></li>
        <li class="cbi-tab"><a href="#"><%:Configuration%></a></li>
 </ul>
index 84e1510..19be072 100644 (file)
@@ -1,7 +1,7 @@
 <%+cbi/valueheader%>
 
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "system", "clock_status")%>', null,
+       XHR.poll(5, '<%=url('admin/system/clock_status')%>', null,
                function(x, rv)
                {
                        var s = document.getElementById('<%=self.option%>-clock-status');
@@ -17,7 +17,7 @@
                btn.disabled = true;
                btn.value    = '<%:Synchronizing...%>';
 
-               XHR.get('<%=luci.dispatcher.build_url("admin", "system", "clock_status")%>',
+               XHR.get('<%=url('admin/system/clock_status')%>',
                        { set: Math.floor((new Date()).getTime() / 1000) },
                        function()
                        {
index 6b812e8..a7ff4e5 100644 (file)
@@ -5,6 +5,6 @@
 -%>
 
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/system/packages")%>"><%:Actions%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=url("admin/system/packages")%>"><%:Actions%></a></li>
        <li class="cbi-tab"><a href="#"><%:Configuration%></a></li>
 </ul>
index b2e1683..dbf3820 100644 (file)
@@ -11,7 +11,7 @@
 %>
 
 <% if has_latlon then %>
-       <iframe style="width:100%; height:640px; border:none" src="<%=luci.dispatcher.build_url("freifunk/map/content")%>"></iframe>
+       <iframe style="width:100%; height:640px; border:none" src="<%=url("freifunk/map/content")%>"></iframe>
        <h3><%:Legend%>:</h3>
        <ul>
                <li><strong><span style="color:#00cc00"><%:Green%></span></strong>:<%:Very good (ETX < 2)%></li>