antville/code/Poll/delete.hac
2002-05-15 23:12:41 +00:00

29 lines
No EOL
810 B
Text

checkIfLoggedIn(this.href(req.action));
var deny = this.isDeleteDenied(user);
if (deny) {
res.message = deny;
res.redirect(this.weblog.href());
}
if (req.data.submit == "cancel" || req.data.cancel)
res.redirect(path.weblog.polls.href());
else if (req.data.submit == "delete" || req.data.remove) {
var result = this.weblog.polls.deletePoll(this);
res.message = result.message;
res.redirect(path.weblog.polls.href());
}
res.skin = "weblog.page";
res.data.action = this.href(req.action);
res.data.title = this.weblog.title;
var skinParam = new Object();
if (this.title)
skinParam.what = "the poll "" + this.title + """;
else
skinParam.what = "a poll";
skinParam.what += " from <b>" + this.creator.name + "</b>";
res.data.body = this.renderSkinAsString("delete", skinParam);