Sourcecode in MtApi/moveabletypeAPI.js:
1: function getPostCategories(postid, username, password) {
2: var usr = root.blogger.getUser(username, password);
3: var entry = root.storiesByID.get(postid.toString());
4: if (!entry)
5: throw("Couldn't find the story with id " + postid);
6: var level = entry.site.members.getMembershipLevel(usr);
7: try {
8: entry.checkView(usr, level);
9: } catch (deny) {
10: throw("You are not allowed to view the story with id " + postid);
11: }
12: var topics = new Array();
13: if (entry.topic) {
14: var param = new Object();
15: param.categoryId = entry.topic;
16: param.categoryName = entry.topic;
17: param.isPrimary = true;
18: topics[0] = param;
19: }
20: return topics;
21: }
|