Sourcecode in Story/macros.js:
1: function onlinelink_macro(param) {
2: if (session.user) {
3: try {
4: this.checkEdit(session.user, req.data.memberlevel);
5: } catch (deny) {
6: return;
7: }
8: if (this.online && param.mode != "toggle")
9: return;
10: delete param.mode;
11: param.linkto = "edit";
12: param.urlparam = "set=" + (this.online ? "offline" : "online");
13: Html.openTag("a", this.createLinkParam(param));
14: if (param.image && this.site.images.get(param.image))
15: this.site.renderImage(this.site.images.get(param.image), param);
16: else {
17: // currently, only the "set online" text is customizable, since this macro
18: // is by default only used in that context outside the story manager.
19: if (this.online)
20: res.write(getMessage("Story.setOffline"));
21: else
22: res.write(param.text ? param.text : getMessage("Story.setOnline"));
23: }
24: Html.closeTag("a");
25: }
26: return;
27: }
|