Sourcecode in Story/actions.js:
1: function delete_action() {
2: if (req.data.cancel)
3: res.redirect(this.site.stories.href());
4: else if (req.data.remove) {
5: try {
6: res.message = this.site.stories.deleteStory(this);
7: res.redirect(this.site.stories.href());
8: } catch (err) {
9: res.message = err.toString();
10: }
11: }
12:
13: res.data.action = this.href(req.action);
14: res.data.title = getMessage("Story.deleteTitle");
15: if (this.title)
16: res.data.title += ": " + encode(this.title);
17:
18: if (this.title)
19: var skinParam = {
20: description: getMessage("Story.deleteDescription"),
21: detail: this.title
22: };
23: else
24: var skinParam = {description: getMessage("Story.deleteDescriptionNoTitle")};
25: res.data.body = this.renderSkinAsString("delete", skinParam);
26: this.site.renderSkin("page");
27: return;
28: }
|