Sorry for the late reply.
The template you attached has serious problems.
It has a doubled deletion system, that's very confusing.
By clicking the gray "delete" button, you are using the standard system, and no macro will be used.
By clicking the red X, you are using a user scripted system, that's actually bugged. Consider these lines
{.if|{.and| {.get|can delete.} | {.urlvar|deleteroot.} .}|{:
{.delete|%folder-resource%\{.urlvar|fldname.}|bin=0.}
:}/if.}
it's checking for delete permission (ok), and then for the variable "deleteroot", that doesn't exist, because it's "fldname" that was named just after.