Created
April 17, 2011 22:17
-
-
Save mikevalstar/924525 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.post('/admin/ajax/theme.:format', function(req, res){ aServ.ajax.theme(req, res); }); | |
theme: function(req, res){ | |
if( !this._start(req, res) ) return; | |
var Status = this.Status; | |
cb_func = function(theme, error){ | |
if(error){ | |
res.send({ status: 404, message: "Theme not found: " + error}); | |
return; | |
} | |
res.send({ status: 200, message: "Theme loaded", theme: theme, current: theme.theme == Status.Theme.theme }); | |
} | |
if( req.body && req.body.current ){ | |
cb_func(this.Status.Theme, false); | |
}else if(req.body && req.body.id){ | |
var theme = new Theme(); | |
theme.Load(req.body.id, this.Status.themepath, cb_func); | |
}else{ | |
res.send({ status: 403, message: "Missing parameter: id"}); | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment