antville/code/Story/delete.hac

31 lines
885 B
Text
Raw Normal View History

checkIfLoggedIn(this.href(req.action));
2001-10-07 19:31:19 +00:00
var deny = this.isDeleteDenied(session.user);
2001-09-05 21:54:06 +00:00
if (deny) {
res.message = deny;
res.redirect(this.site.href());
2001-09-05 21:54:06 +00:00
}
2001-06-18 08:57:33 +00:00
if (req.data.submit == "cancel" || req.data.cancel)
res.redirect(path.site.stories.href());
else if (req.data.submit == "delete" || req.data.remove) {
var result = this.site.stories.deleteStory(this);
res.message = result.message;
res.redirect(path.site.stories.href());
}
2001-06-18 08:57:33 +00:00
2002-05-15 23:12:41 +00:00
res.data.action = this.href(req.action);
res.data.title = this.site.title;
if (this.title)
res.data.title += " - " + encode(this.title);
2001-06-18 08:57:33 +00:00
2001-09-05 21:54:06 +00:00
var skinParam = new Object();
if (this.title)
skinParam.what = "the story "" + this.title + """;
else
skinParam.what = "a story";
skinParam.what += " from <b>" + this.creator.name + "</b>";
res.data.body = this.renderSkinAsString("delete",skinParam);
path.site.renderSkin("page");