19 lines
453 B
Lua
19 lines
453 B
Lua
local function cmd(args)
|
|
local entries = env.xmlFindTags(env.db,"entries")[1]
|
|
for i,entry in pairs(entries.children) do
|
|
if entry.attrs.id == args[2] then
|
|
for i,field in pairs(entry.children) do
|
|
if field.tag == "field" then
|
|
if field.attrs.name == args[3] then
|
|
table.remove(entry.children,i)
|
|
entry.attrs.date = env.stringDate(os.date("*t",os.time()))
|
|
env.changed = true
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
return cmd
|