antville/code/Poll/delete.hac
2002-01-25 17:57:44 +00:00

28 lines
No EOL
797 B
Text

autoLogin();
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.title = "Antville - " + 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);