projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96e7e81
)
* luci/libs/uvl: prepare support for @type[n] notation in luci.uvl.uvlitem.cid()
author
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 7 Sep 2008 03:29:54 +0000
(
03:29
+0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 7 Sep 2008 03:29:54 +0000
(
03:29
+0000)
libs/uvl/luasrc/uvl.lua
patch
|
blob
|
history
diff --git
a/libs/uvl/luasrc/uvl.lua
b/libs/uvl/luasrc/uvl.lua
index 089789a5aaf34509ca0cd6185b3ccb7c970b1395..98e7dfba6a249a32b886781e4a2e2c0823583035 100644
(file)
--- a/
libs/uvl/luasrc/uvl.lua
+++ b/
libs/uvl/luasrc/uvl.lua
@@
-813,7
+813,17
@@
end
uvlitem = luci.util.class()
function uvlitem.cid(self)
- return table.concat( self.cref, '.' )
+ if #self.cref == 1 then
+ return self.cref[1]
+ else
+ local r = { unpack(self.cref) }
+ local c = self.c
+ if c and c[r[2]] and c[r[2]]['.anonymous'] and c[r[2]]['.index'] then
+ r[2] = '@' .. c[r[2]]['.type'] ..
+ '[' .. tostring(c[r[2]]['.index']) .. ']'
+ end
+ return table.concat( r, '.' )
+ end
end
function uvlitem.sid(self)