antville/code/Story/delete.hac
Robert Gaggl 67a6f7792f changed because the prototype weblog was renamed to site
plus story.author was renamed to story.creator
2002-06-26 16:15:43 +00:00

31 lines
No EOL
885 B
Text

checkIfLoggedIn(this.href(req.action));
var deny = this.isDeleteDenied(session.user);
if (deny) {
res.message = deny;
res.redirect(this.site.href());
}
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());
}
res.data.action = this.href(req.action);
res.data.title = this.site.title;
if (this.title)
res.data.title += " - " + encode(this.title);
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");