return new Error401();
}
} else if(tokens.length == 2 && tokens[1].equals("new")) {
if(accessLevel >= ModuleHelper.ADD)
return new ContentType() {
@Override
public String getName() {
return "Add Page";
}
@Override
protected String getHTML() {
return "<div class='claymus-h1'>" + getName() + "</div>" +
"<div id='claymus-PageEditor'></div>" +
"<script type='text/javascript' src='/com.claymus.site.module.page.pages.editor.gwt/com.claymus.site.module.page.pages.editor.gwt.nocache.js'></script>";
}
};
else
return new Error401();
} else if(tokens.length == 2 && tokens[1].equals("edit")) {
String encoded = ClaymusMain.getRequest().getParameter("key");
if(encoded == null)
return null;
final Page page = PageData.getPage(KeyFactory.stringToKey(encoded));
if(page == null)
return null;
if(accessLevel >= ModuleHelper.ADD_EDIT || (accessLevel == ModuleHelper.ADD && page.getCreator().equals(user)))
return new ContentType() {
@Override
public String getName() {
return page.getTitle() != null
? "Editing Page: " + page.getTitle()