diff options
42 files changed, 545 insertions, 72 deletions
diff --git a/docs/api/index.html b/docs/api/index.html index 5e3f3c211a..66a27a33bc 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -127,6 +127,10 @@ </li> <li> + <a href="modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="modules/nixio.html">nixio</a> </li> @@ -329,6 +333,11 @@ LuCI system utilities / wifi related functions.</td> </tr> <tr> + <td class="name"><a href="modules/luci.xml.html">luci.xml</a></td> + <td class="summary"></td> + </tr> + + <tr> <td class="name"><a href="modules/nixio.html">nixio</a></td> <td class="summary"> General POSIX IO library.</td> diff --git a/docs/api/modules/luci.dispatcher.html b/docs/api/modules/luci.dispatcher.html index ea33a5c706..32cb49573b 100644 --- a/docs/api/modules/luci.dispatcher.html +++ b/docs/api/modules/luci.dispatcher.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.http.conditionals.html b/docs/api/modules/luci.http.conditionals.html index 8c940bd3f6..14ee627f68 100644 --- a/docs/api/modules/luci.http.conditionals.html +++ b/docs/api/modules/luci.http.conditionals.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.http.date.html b/docs/api/modules/luci.http.date.html index 1ec5beb8b7..680dd43137 100644 --- a/docs/api/modules/luci.http.date.html +++ b/docs/api/modules/luci.http.date.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.http.html b/docs/api/modules/luci.http.html index 4731727849..3e8799e744 100644 --- a/docs/api/modules/luci.http.html +++ b/docs/api/modules/luci.http.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.http.mime.html b/docs/api/modules/luci.http.mime.html index 85eaf53ab0..756b0727ae 100644 --- a/docs/api/modules/luci.http.mime.html +++ b/docs/api/modules/luci.http.mime.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.i18n.html b/docs/api/modules/luci.i18n.html index 0f315bebd5..5ba44b4c01 100644 --- a/docs/api/modules/luci.i18n.html +++ b/docs/api/modules/luci.i18n.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.ip.cidr.html b/docs/api/modules/luci.ip.cidr.html index ae6c61dc5d..cfe1909352 100644 --- a/docs/api/modules/luci.ip.cidr.html +++ b/docs/api/modules/luci.ip.cidr.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.ip.html b/docs/api/modules/luci.ip.html index 0599396b6f..8d503bd655 100644 --- a/docs/api/modules/luci.ip.html +++ b/docs/api/modules/luci.ip.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.json.html b/docs/api/modules/luci.json.html index db2d1da3f4..5885556d50 100644 --- a/docs/api/modules/luci.json.html +++ b/docs/api/modules/luci.json.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.jsonc.html b/docs/api/modules/luci.jsonc.html index 79deb933d7..f6ab990faa 100644 --- a/docs/api/modules/luci.jsonc.html +++ b/docs/api/modules/luci.jsonc.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.jsonc.parser.html b/docs/api/modules/luci.jsonc.parser.html index 709cb9afc5..54e1e487d5 100644 --- a/docs/api/modules/luci.jsonc.parser.html +++ b/docs/api/modules/luci.jsonc.parser.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.model.ipkg.html b/docs/api/modules/luci.model.ipkg.html index a0af3187b7..e97097db51 100644 --- a/docs/api/modules/luci.model.ipkg.html +++ b/docs/api/modules/luci.model.ipkg.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.model.uci.html b/docs/api/modules/luci.model.uci.html index c1eaf5f813..84b6ecc1b8 100644 --- a/docs/api/modules/luci.model.uci.html +++ b/docs/api/modules/luci.model.uci.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.rpcc.html b/docs/api/modules/luci.rpcc.html index 18065788bd..10d628ff43 100644 --- a/docs/api/modules/luci.rpcc.html +++ b/docs/api/modules/luci.rpcc.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.rpcc.ruci.html b/docs/api/modules/luci.rpcc.ruci.html index 7348f1932b..598020df7e 100644 --- a/docs/api/modules/luci.rpcc.ruci.html +++ b/docs/api/modules/luci.rpcc.ruci.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.sys.html b/docs/api/modules/luci.sys.html index b86d280fba..f601e17dd3 100644 --- a/docs/api/modules/luci.sys.html +++ b/docs/api/modules/luci.sys.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.sys.init.html b/docs/api/modules/luci.sys.init.html index e2c51f9531..b178cafca3 100644 --- a/docs/api/modules/luci.sys.init.html +++ b/docs/api/modules/luci.sys.init.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.sys.iptparser.html b/docs/api/modules/luci.sys.iptparser.html index 5928281cf4..aa9f7ce1c5 100644 --- a/docs/api/modules/luci.sys.iptparser.html +++ b/docs/api/modules/luci.sys.iptparser.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.sys.net.html b/docs/api/modules/luci.sys.net.html index e7802bb244..bf1bb54aa6 100644 --- a/docs/api/modules/luci.sys.net.html +++ b/docs/api/modules/luci.sys.net.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.sys.process.html b/docs/api/modules/luci.sys.process.html index d3664817cc..ec42ecadd9 100644 --- a/docs/api/modules/luci.sys.process.html +++ b/docs/api/modules/luci.sys.process.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.sys.user.html b/docs/api/modules/luci.sys.user.html index b2307ad385..27b13ccbbf 100644 --- a/docs/api/modules/luci.sys.user.html +++ b/docs/api/modules/luci.sys.user.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.sys.wifi.html b/docs/api/modules/luci.sys.wifi.html index 6c893244c1..37e7053fd7 100644 --- a/docs/api/modules/luci.sys.wifi.html +++ b/docs/api/modules/luci.sys.wifi.html @@ -125,6 +125,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/luci.util.html b/docs/api/modules/luci.util.html index f8baddf410..1fc2539928 100644 --- a/docs/api/modules/luci.util.html +++ b/docs/api/modules/luci.util.html @@ -125,6 +125,10 @@ <li><strong>luci.util</strong></li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> @@ -342,10 +346,11 @@ value or 0 if the unit is unknown.</td> </tr> <tr> - <td class="name" nowrap><a href="#pcdata">pcdata</a> (value)</td> + <td class="name" nowrap><a href="luci.xml.html#pcdata">pcdata</a> (value)</td> <td class="summary"> -Create valid XML PCDATA from given string.</td> +Create valid XML PCDATA from given string. +This is a wrapper for <a href="luci.xml.html#pcdata">luci.xml.pcdata()</a>.</td> </tr> <tr> @@ -409,10 +414,11 @@ Strips unnecessary lua bytecode from given string.</td> </tr> <tr> - <td class="name" nowrap><a href="#striptags">striptags</a> (value)</td> + <td class="name" nowrap><a href="luci.xml.html#striptags">striptags</a> (value)</td> <td class="summary"> -Strip HTML tags from given string.</td> +Strip HTML tags from given string. +This is a wrapper for <a href="luci.xml.html#striptags">luci.xml.striptags()</a>.</td> </tr> <tr> @@ -1178,38 +1184,6 @@ Number containing the canonical value -<dt><a name="pcdata"></a><strong>pcdata</strong> (value)</dt> -<dd> - - -Create valid XML PCDATA from given string. - - - -<h3>Parameters</h3> -<ul> - - <li> - value: String value containing the data to escape - </li> - -</ul> - - - - - - -<h3>Return value:</h3> -String value containing the escaped data - - - -</dd> - - - - <dt><a name="perror"></a><strong>perror</strong> (obj)</dt> <dd> @@ -1524,38 +1498,6 @@ String value containing the stripped lua byte code -<dt><a name="striptags"></a><strong>striptags</strong> (value)</dt> -<dd> - - -Strip HTML tags from given string. - - - -<h3>Parameters</h3> -<ul> - - <li> - value: String containing the HTML text - </li> - -</ul> - - - - - - -<h3>Return value:</h3> -String with HTML tags stripped of - - - -</dd> - - - - <dt><a name="threadlocal"></a><strong>threadlocal</strong> ()</dt> <dd> diff --git a/docs/api/modules/luci.xml.html b/docs/api/modules/luci.xml.html new file mode 100644 index 0000000000..63a91e4eb6 --- /dev/null +++ b/docs/api/modules/luci.xml.html @@ -0,0 +1,321 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> + <title>Reference</title> + <link rel="stylesheet" href="../luadoc.css" type="text/css" /> + <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> +</head> + +<body> +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + +<div id="main"> + +<div id="navigation"> + + +<h1>LuaDoc</h1> +<ul> + + <li><a href="../index.html">Index</a></li> + +</ul> + + +<!-- Module list --> + +<h1>Modules</h1> +<ul> + + <li> + <a href="../modules/luci.dispatcher.html">luci.dispatcher</a> + </li> + + <li> + <a href="../modules/luci.http.html">luci.http</a> + </li> + + <li> + <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a> + </li> + + <li> + <a href="../modules/luci.http.date.html">luci.http.date</a> + </li> + + <li> + <a href="../modules/luci.http.mime.html">luci.http.mime</a> + </li> + + <li> + <a href="../modules/luci.i18n.html">luci.i18n</a> + </li> + + <li> + <a href="../modules/luci.ip.html">luci.ip</a> + </li> + + <li> + <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a> + </li> + + <li> + <a href="../modules/luci.json.html">luci.json</a> + </li> + + <li> + <a href="../modules/luci.jsonc.html">luci.jsonc</a> + </li> + + <li> + <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a> + </li> + + <li> + <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a> + </li> + + <li> + <a href="../modules/luci.model.uci.html">luci.model.uci</a> + </li> + + <li> + <a href="../modules/luci.rpcc.html">luci.rpcc</a> + </li> + + <li> + <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a> + </li> + + <li> + <a href="../modules/luci.sys.html">luci.sys</a> + </li> + + <li> + <a href="../modules/luci.sys.init.html">luci.sys.init</a> + </li> + + <li> + <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a> + </li> + + <li> + <a href="../modules/luci.sys.net.html">luci.sys.net</a> + </li> + + <li> + <a href="../modules/luci.sys.process.html">luci.sys.process</a> + </li> + + <li> + <a href="../modules/luci.sys.user.html">luci.sys.user</a> + </li> + + <li> + <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a> + </li> + + <li> + <a href="../modules/luci.util.html">luci.sys.wifi</a> + </li> + + <li><strong>luci.xml</strong></li> + + <li> + <a href="../modules/nixio.html">nixio</a> + </li> + + <li> + <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a> + </li> + + <li> + <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a> + </li> + + <li> + <a href="../modules/nixio.File.html">nixio.File</a> + </li> + + <li> + <a href="../modules/nixio.README.html">nixio.README</a> + </li> + + <li> + <a href="../modules/nixio.Socket.html">nixio.Socket</a> + </li> + + <li> + <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a> + </li> + + <li> + <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a> + </li> + + <li> + <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a> + </li> + + <li> + <a href="../modules/nixio.bin.html">nixio.bin</a> + </li> + + <li> + <a href="../modules/nixio.bit.html">nixio.bit</a> + </li> + + <li> + <a href="../modules/nixio.crypto.html">nixio.crypto</a> + </li> + + <li> + <a href="../modules/nixio.fs.html">nixio.fs</a> + </li> + +</ul> + + + +<!-- File list --> + + + + + + + +</div><!-- id="navigation" --> + +<div id="content"> + +<h1>Class <code>luci.xml</code></h1> + +<p></p> + + + + + + + +<h2>Functions</h2> +<table class="function_list"> + + <tr> + <td class="name" nowrap><a href="#pcdata">pcdata</a> (value)</td> + <td class="summary"> + +Create valid XML PCDATA from given string.</td> + </tr> + + <tr> + <td class="name" nowrap><a href="#striptags">striptags</a> (value)</td> + <td class="summary"> + +Strip HTML tags from given string.</td> + </tr> + +</table> + + + + + + +<br/> +<br/> + + +<h2><a name="functions"></a>Functions</h2> +<dl class="function"> + + + +<dt><a name="pcdata"></a><strong>pcdata</strong> (value)</dt> +<dd> + + +Create valid XML PCDATA from given string. + + + +<h3>Parameters</h3> +<ul> + + <li> + value: String value containing the data to escape + </li> + +</ul> + + + + + + +<h3>Return value:</h3> +String value containing the escaped data + + + +</dd> + + + + +<dt><a name="striptags"></a><strong>striptags</strong> (value)</dt> +<dd> + + +Strip HTML tags from given string. + + + +<h3>Parameters</h3> +<ul> + + <li> + value: String containing the HTML text + </li> + +</ul> + + + + + + +<h3>Return value:</h3> +String with HTML tags stripped of + + + +</dd> + + + +</dl> + + + + + +</div> <!-- id="content" --> + +</div> <!-- id="main" --> + +<div id="about"> + <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> +</div> <!-- id="about" --> + +</div> <!-- id="container" --> +</body> +</html> diff --git a/docs/api/modules/nixio.CHANGELOG.html b/docs/api/modules/nixio.CHANGELOG.html index 94b44a5ca6..0def9a4512 100644 --- a/docs/api/modules/nixio.CHANGELOG.html +++ b/docs/api/modules/nixio.CHANGELOG.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.CryptoHash.html b/docs/api/modules/nixio.CryptoHash.html index 7d2f48b1e5..a333c407d5 100644 --- a/docs/api/modules/nixio.CryptoHash.html +++ b/docs/api/modules/nixio.CryptoHash.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.File.html b/docs/api/modules/nixio.File.html index 7a7500a773..b46a317bc1 100644 --- a/docs/api/modules/nixio.File.html +++ b/docs/api/modules/nixio.File.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.README.html b/docs/api/modules/nixio.README.html index e140659cc7..b8481ef55a 100644 --- a/docs/api/modules/nixio.README.html +++ b/docs/api/modules/nixio.README.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.Socket.html b/docs/api/modules/nixio.Socket.html index 185099125d..f1d48ef2b6 100644 --- a/docs/api/modules/nixio.Socket.html +++ b/docs/api/modules/nixio.Socket.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.TLSContext.html b/docs/api/modules/nixio.TLSContext.html index c84d318955..247670c561 100644 --- a/docs/api/modules/nixio.TLSContext.html +++ b/docs/api/modules/nixio.TLSContext.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.TLSSocket.html b/docs/api/modules/nixio.TLSSocket.html index 5d6098a9f5..20cdaa55a1 100644 --- a/docs/api/modules/nixio.TLSSocket.html +++ b/docs/api/modules/nixio.TLSSocket.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.UnifiedIO.html b/docs/api/modules/nixio.UnifiedIO.html index 6410ffb42e..8521e3e2af 100644 --- a/docs/api/modules/nixio.UnifiedIO.html +++ b/docs/api/modules/nixio.UnifiedIO.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.bin.html b/docs/api/modules/nixio.bin.html index c8ef018317..aeb14eb53e 100644 --- a/docs/api/modules/nixio.bin.html +++ b/docs/api/modules/nixio.bin.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.bit.html b/docs/api/modules/nixio.bit.html index 419736363c..d0ce111db2 100644 --- a/docs/api/modules/nixio.bit.html +++ b/docs/api/modules/nixio.bit.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.crypto.html b/docs/api/modules/nixio.crypto.html index b91fe28c1d..498620bcdf 100644 --- a/docs/api/modules/nixio.crypto.html +++ b/docs/api/modules/nixio.crypto.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.fs.html b/docs/api/modules/nixio.fs.html index c9d34591c2..956c0e93a8 100644 --- a/docs/api/modules/nixio.fs.html +++ b/docs/api/modules/nixio.fs.html @@ -127,6 +127,10 @@ </li> <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + + <li> <a href="../modules/nixio.html">nixio</a> </li> diff --git a/docs/api/modules/nixio.html b/docs/api/modules/nixio.html index bf93619c91..36895486c7 100644 --- a/docs/api/modules/nixio.html +++ b/docs/api/modules/nixio.html @@ -126,6 +126,10 @@ <a href="../modules/luci.util.html">luci.util</a> </li> + <li> + <a href="../modules/luci.xml.html">luci.xml</a> + </li> + <li><strong>nixio</strong></li> <li> diff --git a/libs/luci-lib-base/luasrc/util.lua b/libs/luci-lib-base/luasrc/util.lua index a30e8b72f3..38e00ad83b 100644 --- a/libs/luci-lib-base/luasrc/util.lua +++ b/libs/luci-lib-base/luasrc/util.lua @@ -159,8 +159,12 @@ end -- String and data manipulation routines -- +-- compatibility wrapper for xml.pcdata function pcdata(value) - return value and tparser.pcdata(tostring(value)) + local xml = require "luci.xml" + + perror("luci.util.pcdata() has been replaced by luci.xml.pcdata() - Please update your code.") + return xml.pcdata(value) end function urlencode(value) @@ -182,8 +186,12 @@ function urldecode(value, decode_plus) return nil end +-- compatibility wrapper for xml.striptags function striptags(value) - return value and tparser.striptags(tostring(value)) + local xml = require "luci.xml" + + perror("luci.util.striptags() has been replaced by luci.xml.striptags() - Please update your code.") + return xml.striptags(value) end function shellquote(value) @@ -343,8 +351,6 @@ function parse_units(ustr) end -- also register functions above in the central string class for convenience -string.pcdata = pcdata -string.striptags = striptags string.split = split string.trim = trim string.cmatch = cmatch diff --git a/libs/luci-lib-base/luasrc/util.luadoc b/libs/luci-lib-base/luasrc/util.luadoc index 4ec68dd1ef..3168d9c220 100644 --- a/libs/luci-lib-base/luasrc/util.luadoc +++ b/libs/luci-lib-base/luasrc/util.luadoc @@ -70,10 +70,13 @@ Recursively dumps a table to stdout, useful for testing and debugging. ---[[ Create valid XML PCDATA from given string. +This is just a compatibility wrapper for luci.xml.padata() + @class function @name pcdata @param value String value containing the data to escape @return String value containing the escaped data +@see luci.xml.pcdata ]] ---[[ @@ -100,10 +103,13 @@ URL-encode given string. ---[[ Strip HTML tags from given string. +This is just a compatibility wrapper for luci.xml.striptags() + @class function @name striptags @param value String containing the HTML text @return String with HTML tags stripped of +@see luci.xml.striptags ]] ---[[ diff --git a/modules/luci-base/luasrc/xml.lua b/modules/luci-base/luasrc/xml.lua new file mode 100644 index 0000000000..30b37210bd --- /dev/null +++ b/modules/luci-base/luasrc/xml.lua @@ -0,0 +1,26 @@ +-- Copyright 2008 Steven Barth <steven@midlink.org> +-- Licensed to the public under the Apache License 2.0. + +local tparser = require "luci.template.parser" +local string = require "string" + +local tostring = tostring + +module "luci.xml" + +-- +-- String and data manipulation routines +-- + +function pcdata(value) + return value and tparser.pcdata(tostring(value)) +end + +function striptags(value) + return value and tparser.striptags(tostring(value)) +end + + +-- also register functions above in the central string class for convenience +string.pcdata = pcdata +string.striptags = striptags diff --git a/modules/luci-base/luasrc/xml.luadoc b/modules/luci-base/luasrc/xml.luadoc new file mode 100644 index 0000000000..58de533966 --- /dev/null +++ b/modules/luci-base/luasrc/xml.luadoc @@ -0,0 +1,23 @@ +---[[ +LuCI utility functions. +]] +module "luci.xml" + +---[[ +Create valid XML PCDATA from given string. + +@class function +@name pcdata +@param value String value containing the data to escape +@return String value containing the escaped data +]] + +---[[ +Strip HTML tags from given string. + +@class function +@name striptags +@param value String containing the HTML text +@return String with HTML tags stripped of +]] + |