2003-08-02 12:20:05 +00:00
|
|
|
/**
|
|
|
|
* main action
|
|
|
|
*/
|
|
|
|
function main_action() {
|
|
|
|
res.data.title = "View image: " + this.alias;
|
|
|
|
res.data.body = this.renderSkinAsString("main");
|
2003-11-23 17:47:30 +00:00
|
|
|
res.handlers.context.renderSkin("page");
|
2003-08-02 12:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* edit action
|
|
|
|
*/
|
|
|
|
function edit_action() {
|
|
|
|
if (req.data.cancel)
|
|
|
|
res.redirect(this.href());
|
|
|
|
else if (req.data.save) {
|
|
|
|
res.message = this.evalImg(req.data, session.user);
|
|
|
|
res.redirect(this.href());
|
|
|
|
}
|
2003-11-23 17:47:30 +00:00
|
|
|
|
2003-08-02 12:20:05 +00:00
|
|
|
res.data.action = this.href(req.action);
|
|
|
|
res.data.title = "Edit image: " + this.alias;
|
|
|
|
res.data.body = this.renderSkinAsString("edit");
|
2003-11-23 17:47:30 +00:00
|
|
|
res.handlers.context.renderSkin("page");
|
2003-08-02 12:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* delete action
|
|
|
|
*/
|
|
|
|
function delete_action() {
|
|
|
|
if (req.data.cancel)
|
2003-10-07 15:14:47 +00:00
|
|
|
res.redirect(path.imagemgr.href());
|
2003-08-02 12:20:05 +00:00
|
|
|
else if (req.data.remove) {
|
|
|
|
try {
|
|
|
|
var url = this._parent.href();
|
|
|
|
res.message = this._parent.deleteImage(this);
|
|
|
|
res.redirect(url);
|
|
|
|
} catch (err) {
|
|
|
|
res.message = err.toString();
|
|
|
|
}
|
|
|
|
}
|
2003-11-23 17:47:30 +00:00
|
|
|
|
2003-08-02 12:20:05 +00:00
|
|
|
res.data.action = this.href(req.action);
|
|
|
|
res.data.title = "Delete image: " + this.alias;
|
|
|
|
var sp = new Object();
|
|
|
|
sp.what = "the image "" + this.alias + """;
|
|
|
|
res.data.body = this.renderSkinAsString("delete", sp);
|
2003-11-23 17:47:30 +00:00
|
|
|
res.handlers.context.renderSkin("page");
|
2003-10-07 15:14:47 +00:00
|
|
|
}
|